SlideShare ist ein Scribd-Unternehmen logo
1 von 48
Downloaden Sie, um offline zu lesen
M6103Q: Optimization in Engineering Design
December 19, 2012
Final Report
Turnstile Generator: Maximize Energy Output
Wayne Justin Smith Jr.
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
1
Table of Contents
i. List of Figures....................................................................................................................2
ii. List of Tables......................................................................................................................3
1. Introduction.......................................................................................................................4
2. Previous Work ..................................................................................................................6
3. Problem Definition....................................................................................................... 11
3.1. Variables............................................................................................................................... 12
3.1.1. Active Variables......................................................................................................................12
3.1.2. Inactive Variables...................................................................................................................12
3.2. Objective Functions.......................................................................................................... 13
3.3. Constraints........................................................................................................................... 14
3.4. Analyzing the Equations ................................................................................................. 15
3.4.1. Explanation of Equations....................................................................................................15
3.4.2. Equations Breakdown..........................................................................................................18
3.5. The Compromise Decision Support Problem (DSP) ............................................. 18
4. Applied Methods ........................................................................................................... 20
4.1. Archimedean Weighting Scheme (Exhaustive Search)........................................ 20
4.1.1. Method Setup...........................................................................................................................20
4.1.2. Results ........................................................................................................................................22
4.2. Penalty & Barrier .............................................................................................................. 27
4.2.1. Method Setup...........................................................................................................................27
4.2.2. Results ........................................................................................................................................27
4.3. Fmincon ................................................................................................................................ 30
4.3.1. Method Setup...........................................................................................................................30
4.3.2. Results ........................................................................................................................................31
5. Comparison of Methods.............................................................................................. 33
5.1. Quality................................................................................................................................... 35
5.2. Speed...................................................................................................................................... 35
5.3. Ease of Use ........................................................................................................................... 35
5.4. Robustness........................................................................................................................... 36
6. Conclusion ....................................................................................................................... 36
7. Future Work.................................................................................................................... 37
8. Appendix A ...................................................................................................................... 39
8.1. Definition of Variables..................................................................................................... 39
8.2. Matlab Code......................................................................................................................... 39
8.2.1. Archimedean Weighting Scheme (Exhaustive Search) ..........................................39
8.2.2. Penalty & Barrier Method...................................................................................................41
8.2.3. fmincon.......................................................................................................................................45
9. Works Cited..................................................................................................................... 47
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
2
i. List of Figures
Figure 1: Original Design Diagram of Turnstile Design ...........................................................5
Figure 2: Final 3D Diagram of Turnstile ........................................................................................6
Figure 3: Constructed Turnstile Prototype...................................................................................8
Figure 4: Gearbox with Hubless Spur Gears.................................................................................9
Figure 5: Typical Distance Traveled per Turnstile Arm .......................................................11
Figure 6: Relationship Between No. of Teeth & Cost .............................................................17
Figure 7: Hierarchal Breakdown of Objective Function Equations..................................18
Figure 8: Gear Ratio vs. Power Output ........................................................................................21
Figure 9: Exhaustive Search Sample Output (Scenario 3) ...................................................22
Figure 10: Archimedean Weighted Output of Scenario 3 with T=0.5..............................23
Figure 11: Archimedean Weighted Output of Scenario 3 with T=3 .................................24
Figure 12: Archimedean Weighted Contour Plot (Scenario 1) ..........................................24
Figure 13: Archimedean Weighted Output Mesh Plot (Scenario 1).................................25
Figure 14: Archimedean Weighted Contour Plot (Scenario 3) ..........................................26
Figure 15: Archimedean Weighted Example Mesh Plot (Scenario 3) .............................26
Figure 16: Penalty & Barrier Method Contour Plot Converged for Run2 ......................29
Figure 17: Penalty & Barrier Method Contour Plot Converged for Run5 ......................29
Figure 18: Penalty & Barrier Method Example Mesh Plot...................................................30
Figure 19: Fmincon Contour Plot Converged for Run1.........................................................32
Figure 20: Fmincon Example Mesh Plot .....................................................................................32
Figure 21: Fmincon Contour Plot Converged for Run10......................................................33
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
3
ii. List of Tables
Table 1: Typical Pull-Force Values for Turnstile Arms .........................................................10
Table 2: Average Work Generated per Person.........................................................................11
Table 3: Archimedean Weighted Scheme Run Results..........................................................22
Table 4: Penalty & Barrier Run Results.......................................................................................28
Table 5: Fmincon Run Results ........................................................................................................31
Table 6: Summary of Archimedean Weighted Exhaustive Search Results....................34
Table 7: Combined Results of Penalty & Barrier Method and Fmincon.........................34
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
4
1. Introduction
As the amount of natural resources decline and the environmental protection
movement grows in popularity, the search for renewable energy is becoming
increasingly more important. Throughout our society, many common and mundane
daily activities present opportunities for us to capture and convert seemingly
valueless and unmemorable activities into a prolific energy conservation program.
Capturing and converting just a minute portion of human energy in large enough
amounts could generate a measurable increase of supplemental power to augment
our extensive electrical grid. During everyday life, there are many such tasks that
are performed without thinking about the wasted energy that could possibly be
recovered and stored for future use. In fact, while working in my undergraduate
senior design class, my group developed an idea for a turnstile generator, which is
simply a turnstile that has been fitted to power a small generator and capture the
energy transmitted from the users pushing the turnstile arms. The idea was created
by focusing on energy regeneration through harvesting wasted energy from
everyday actions. To the best of our knowledge, the design was the first of its kind,
with the only similar idea coming from Shibuya, Japan, where modified floor tiles in
a train station are used to create and store electricity.
The turnstile design generates electricity by using the force applied to the turnstile
arms, geared-up for increased angular velocity, to spin the motor shaft on a DC
motor, and store the created electricity in a battery. There are several available
markets for which this product could be retro-fitted to include: arenas, stadiums,
transit stations, amusement parks, or any high traffic area where a large amount of
wasted human energy could be captured. In addition, each place mentioned uses a
large amount of electricity and could use the power generated by the turnstiles to
help reduce their overall electrical costs.
Even though this project is a viable and achievable goal, problems arose during
prototype construction that did not allow us to demonstrate a functional final
product. When machining one of the gear shafts, some of the teeth on one of the
smaller gears were destroyed, thus altering the desired total gear reduction ratio of
21.53 to 1. Our group had to quickly improvise a workaround for the broken gear
which reduced the gear ratio to 4.64 to 1, which drastically reduced the maximum
amount of power produced by the turnstile.
Before construction of the prototype, a preliminary design of the turnstile was
created using modeling software, which is shown below in Figure 1. Note that there
are not any supports shown for the gear box, motor and batteries, and consequently,
that lack of design specificity became problematic during prototype construction.
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
5
Figure 1: Original Design Diagram of Turnstile Design
As seen in Figure 1 above, the torque created by the user is transferred by the
universal joint to the shaft containing the drive gear. At that point, the gear
reduction takes place, with the pinion connected to the motor shaft of the DC motor.
The electrical leads from the motor are then connected to a rechargeable battery,
which was the original idea for storing the energy. As seen in the figure above, there
were three sets of gears used to increase the angular velocity input to the motor
shaft by a significant amount. As with most initial designs, however, the final
product deviated from the original plan to remediate unexpected problems
encountered during production and compensate for unforeseen manufacturing
constraints.
The final design of the prototype is shown below in Figure 2. A couple changes from
the original design are the number of gears used to increase the angular velocity and
the method of storing the energy. Due to unforeseen construction complications, the
output power was reduced to approximately 1/5 of the anticipated power, and
therefore, displaying a working prototype became much more complex. One
adjustment made was incorporating a 1.5V DC motor to show that the turnstile
actually did generate power.
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
6
Figure 2: Final 3D Diagram of Turnstile
Since the prototype was demonstrated in front of a panel of professors, it was
decided that the best way to exhibit the functionality of the product was to connect a
second motor in series with the first, then attach strings to the second motor shaft to
prove that the turnstile was generating energy. The design augmentation worked as
expected and the second motor shaft spun each time someone walked through the
turnstile thus generating an electrical current from the original DC motor.
I believe the idea for a turnstile generator is feasible and practical, and prematurely
abandoned because it seemed that the power output form the prototype was not
worth recovering. This optimization project is focused on redeeming the turnstile
generator idea by identifying the optimal power output while taking into
consideration the manufacturing cost constraints.
2. Previous Work
As mentioned in Section 1, to the best of my knowledge, there are no products that
are currently on the market with which this product competes. During the initial
design, there was not much previous work on the optimization of the power output
and thus all the work completed in this report is original.
The only valuable work taken from the original project was the effort performed
during the initial construction of the prototype in 2009. The main purpose of the
original project however, was not to optimize the power output by prototype, but to
create an original and marketable product that could compete in the current
marketplace and be manufactured at a profit. With the only goal of constructing a
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
7
working prototype, many assumptions made in the original design calculations are
now optimized for higher power output and greater market feasibility in this
analysis.
Unfortunately, the market for regenerative power systems is still small. It is
currently in more of the prototype phase than full-scale deployment, which makes
evaluating our idea against the competitors difficult due to the lack of competition.
There are however, a few similar ideas that harvest energy from pedestrian traffic.
The most notable example is being tested in Shibuya train station in Japan, where
they have installed floor tiles that turn the weight of pedestrian traffic into usable
electricity for powering lighting or the ticket machines. Although the tiles only
generate about 0.1 watts per step there are over 2.4 million people who pass
through the Shibuya station each weekday. Given the enormous amount of foot
traffic through the station each day, the aggregate amount of electricity available for
harvesting then becomes worth recovering. In evaluating the performance of a
turnstile based energy recovery system, I would have to compare energy generated
per step at the Shibuya train station with the energy generated by one person
passing through a turnstile. There is also a system being studied that would
generate electricity from the footsteps of pedestrians walking down stairs. The
system is being considered for the Spinnaker Tower viewing platform in
Portsmouth, United Kingdom. The idea here is that there could be considerable
energy available from people descending the stairs of the tower that would
otherwise be wasted in the compressive action of the human body working to
absorb the impact of the heel striking the step below. Unfortunately there are no
power output figures for this system that could be compared to the turnstile idea.
As discussed in the introduction, a full-scale prototype was built to measure actual
data for power output, which in turn reveals the actual feasibility of this product on
the market. A photograph of the final constructed turnstile is shown in Figure 3.
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
8
Figure 3: Constructed Turnstile Prototype
This is a front view of the turnstile, which displays the turnstile arms and body. For
a better view of the gearbox, Figure 4 on the next page shows the two sets of gears
that lead to the motor shaft. As seen in the picture, the construction was
rudimentary, which led to increased friction and rotating shafts that were off-
balance. This created a poor mesh between the spur gears, which ultimately led to
increased stress on the gear teeth.
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
9
Figure 4: Gearbox with Hubless Spur Gears
To compare the amount of force allowable by the prototype, actual force
measurements were taken by a turnstile at the University of Maryland’s Comcast
Center. Since these turnstiles are used to enter sporting events, it was decided that
these readings would be the basis from which our prototype’s calculations would be
based. When measuring the force used to turn the turnstile, a force meter was used
to take 25 measurements at approximately 0.30 meters from the base of the
turnstile arm, which are shown below in Table 1.
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
10
Table 1: Typical Pull-Force Values for Turnstile Arms
In the original calculations, it was decided that the maximum tangential force used
on the arm of the turnstile is 50N because it was assumed that a 10% increase could
be applied to the force needed to push the turnstile arms. In this report, the same
assumption will be made for the maximum force so that the arms do not become too
difficult to turn.
Using the 0.30 meter distance from the base of the turnstile arm to the point where
the moment is applied, and an assumed profile angle of 45° between the turnstile
arms, it can be calculated that the effective radius of the centripetal motion of the
turnstile arms is 0.212 m. Using this, the linear distance traveled 1/3 around the
circular revolution of each arm is:
( ) ( ) ( )
A pictorial representation of the 1/3 turn of the turnstile (which simulates a single
person passing through) is shown below in Figure 5.
36.69 49.38 46.87
47.72 33.66 41.21
47.39 48.11 36.81
40.88 50.83 41.07
51.55 53.51 51.73
53.88 41.12 52.99
36.13 44.01 45.77
34.31 48.77
41.88 52.59
Avg
Std Dev
Force (N)
45.15
6.41
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
11
Figure 5: Typical Distance Traveled per Turnstile Arm
To calculate the work performed by one person passing through the turnstile,
simply multiply the force by the distance, which yields:
∫ ̅ ( ) ( )
These calculations were performed in the previous class and a summary is shown
below in Table 2.
Table 2: Average Work Generated per Person
From this, the average work per person was used to calculate the amount of energy
created per year by each train station. This was, in turn, used in the cost analysis of
the product to determine the economic viability of the turnstile generator idea. One
downside, however, is that the output power was never optimized in conjunction
with keeping the product economically viable. Through the path that was previously
taken, the optimal variable values were used to calculate the amount of power that
should be expected, but it was determined that the cost-benefit analysis showed
that the amount of energy recovered was not worth retrofitting turnstiles with the
designed product.
3. Problem Definition
Before beginning any work on the optimization problem, it is important to clearly
and precisely define the problem at hand. This section focuses on the problem
Linear Distance per
120° Rotation (m)
Avg Work per
Person (J)
0.444 20.060
0.4443m
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
12
definition, equation breakdown and the compromise decision support problem
(DSP). With a clearer idea of the problem that needs solved, constructing the
algorithms and finding the correct solutions becomes much easier.
3.1.Variables
To properly evaluate the equations, it is important to take a close look at the
variables used in the objective functions. There were also several other variables
that had assumed values in this optimization to ensure that the problem didn’t
become too complicated with too many variables and objective functions.
3.1.1. Active Variables
As seen in the objective functions, there are four variables that are used to optimize
this problem: gear reduction ratio, number of gears used, and the amount of time it
takes to for one person to push through the turnstile. These active variables allow
the problem to explore the design space thoroughly, while keeping the control on
the problem not too confusing.
The active variables are as follows:
( )
( )
These variables were chosen for the optimization of the problem because the design
of this device is largely dependent on the gear ratio, which determines how fast the
motor shaft spins and thus, how much energy is created. The variable T was chosen
to be an active variable because it is an uncontrolled variable imparting a large
effect on the output which is desired to see how much effect that has on the
optimization of the device.
3.1.2. Inactive Variables
As previously mentioned, there were other variables that were not included in the
calculations of this optimization problem. Due to the overall complexity of the
problem, assumptions were made with respect to some of the variables. These
assumptions limited the complexity of the problem allowing for future work on the
optimization of the project to achieve an even more realistic representation of the
problem.
The inactive variables are as follows:
( )
( )
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
13
The force applied to the turnstile arm was set as a constant rather than a variable
because a relationship exists between the force applied and the amount of time it
takes to rotate around the axis, which is already an active variable. Rather, a
constant force of 50N was used in the calculations, which matches the
measurements and assumptions made during the construction of the prototype. In
conjunction with this assumption, the turnstile arm length was also set as the
constant of 0.30m to match the work previously performed. The turnstile arm
length also has a predictable effect on the power output and was thus excluded from
this study.
The material used for the gears was not considered in the scope of this report
because changing the material would change two other variables- the amount of
stress that the gear teeth can handle and the cost of the gears. Since a continuous
cost relationship could not be developed between the material and the cost, a
discrete search method would need to be implemented to find the optimal solution.
Also, the stresses on the gear teeth are not considered in this report due to the
complexity that it introduces. Rather, that will be considered during the future work
and is discussed in Section 7. Another item not researched in the scope of this study
is the possibility of adding a flywheel to the motor shaft, which is also further
discussed in Section 7.
3.2.Objective Functions
In order to define the problem, the first step is to determine what objectives are to
be met. In this problem, the primary purpose of the optimization is to increase the
energy output of the DC motor attached to the pinion at the end of the gear
reduction. Additional objective functions are added to retain the feasibility and
functionality of the final product.
The objective functions for the problem are provided below. Note that the
definitions of the variables are found in Appendix A in Section 8.1.
Maximize: ( ) ( ) ( ( ) ) ( ( ) ( ))
The first objective function listed above is the one that maximizes the power output
of the DC motor. To find this function, the power output equation was found in
terms of rotational velocity, and then the rotational velocity was found in terms of
the number of gear teeth for the large gear and small gear. The breakdown of
equations is shown later in Section 3.4.2.
Minimize: ( ) ( )
The second objective function, shown above, is the total height of the gears, which
helps determine the total size of the device. In order to retrofit this device into
existing turnstiles, it is important that the size be kept as small as possible to ensure
that there is enough room to fit the device.
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
14
Minimize: (( ) (
)
The third and final objective function is the cost of the device. Cleary, this equation
does not incorporate the entire cost of the entire device, but it includes the major
components that change with the optimization. For instance, the shafts and gearbox
are not accounted for in this equation, but these are insignificant in comparison to
the motor and gear costs. To find the equation for cost, it had to be found in terms of
a common variable with the other equations. A relationship was found between the
number of gear teeth and the cost of the gear, which was substituted into the cost
equation to be optimized with the other objective functions. More discussion on this
model formulation is discussed in Section 3.4.1.
3.3.Constraints
The energy capture device presented in this report must follow certain constraints
for the concept to be realistic and accepted, including: the size of the device, the
number of gears, and the amount of time it takes for the user to push through the
turnstile. A defining characteristic of a constraint is that it must be followed for a
concept to be adequate, and in the event the constraint is adhered to, the value of
the product does not increase. An important design characteristic for this product is
its size. The energy regeneration device must fit inside a turnstile to be able to
capture the energy exerted by the person passing through. If the device is too large,
the size of the turnstile must increase and might not be able to retroactively fit into
the space allotted for it by the venue or station. The inner workings of the device
must be durable and able to withstand intermittent stresses because in reality, a
constant force is not applied. The turnstile does not necessarily need to be highly
resistant to corrosion because it will be housed in a protective casing.
The constraints in this problem are used to set bounds for the variables. The
constraints for the problem are given below.
Gear Sizes:
Number of Gears:
Time to push through turnstile:
The way that the constraints were chosen for the number of gear teeth is that
typically spur gears were researched for cost and number of teeth available. This
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
15
helps determine the possible gear ratios available. From the provider researched, it
was found that the maximum number of teeth on each gear was 120, where 20 was
the smallest. (Steel, Hubless Spur Gears) This set the bounds on the number of teeth
for each gear. It is also obvious that it is desired for the larger gear to have a larger
diameter than the smaller gear, otherwise the angular velocity of the motor shaft
would be less than that of the turnstile arms.
To determine the constraints on the number of gears, a lower limit of zero and an
upper limit of ten were found to create a realistic and sufficiently encompassing
design space. To allow the optimization algorithms to find the absolute minimum, all
realistic and possible combinations must be explored, thus a scenario without gear
reductions and a scenario with 10 gear reductions is tested.
The amount of time it takes for someone to push through a turnstile varies with age,
handicap, and schedule of the user. It was determined that setting the limits
between 0.5 and 3 seconds is a realistic range that encompasses situations from a
child or handicapped person, all the way to a healthy adult rushing through the
turnstile.
3.4.Analyzing the Equations
This section contains a breakdown of the equations used in the calculations for this
problem, to include the assumed variables and constants. Through this breakdown
structure, it is possible to see the relationships between the various equations for
the objective functions and constraints, along with the overlap of variables and
constants within those equations. Breaking down the equations to the basic
elements allows the analysis of the relationships between each of the equations,
which helps later explain any trends or effects that the constraints play on the
objective functions or that the objective functions play on each other.
3.4.1. Explanation of Equations
All of the equations used to create the objective functions are provided in this
section. Each equation will be discussed as it was presented in Section 3.2. As
previously mentioned, the definition of the variables and constants are provided in
Appendix A, Section 8.1. To help aid in the visualization of the equation breakdown,
a hierarchy of the equations is displayed in Section 3.4.2.
Below, the original power output equation is presented, with the power shown as a
function of the angular velocity of the motor shaft.
( ) ( )
This shows that the power output of the motor is a quadratic function, only
dependent on the variable ω, which is the angular velocity of the motor shaft. The
other symbols in this equation are constants that are dependent on the motor.
Again, the motor was chosen to handle the amount of power that the turnstile
generator can possibly output, so those constants are pre-defined. For this specific
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
16
problem, a 1.5V-6V DC motor was selected to handle the power output from the
device, which has a stall torque of τs=2*10-3 N-m and a no-load angular velocity of
ωn=200π rad/sec. (Product Data Sheet, 2012) Also, the cost of the motor is
approximately $2.00. The problem with this equation is that the angular velocity
needs to be broken into the variables so that the objective functions can be
optimized.
The angular velocity of the motor shaft is a function of the gear ratio multiplied by
the angular velocity of the turnstile arm, as shown in the equation below. Note that
in the equation below, the variable n represents the number of times the angular
velocity is increased by the introduction of a small and large gear combination.
The gear ratio, α, is dependent on the ratio of the diameters (or number of teeth)
between the gears. That ratio is defined by the equation below, where dl and ds are
the diameter of the large and small gears, respectively. Similarly, the variables tl and
ts are the number of teeth of the large and small gears, respectively.
The angular velocity of the turnstile arms can also be broken into active variables
that were defined in Section 3.1.1. The breakdown of the turnstile arm angular
velocity is shown below. This equation is derived from the basic formula for angular
velocity, ω=θ/dt. Since it is known that the turnstile arm will travel 120°, or 2π/3
radians, the angular velocity equation is updated to provide the following:
Since all of the equations are now broken-down to the basic active variables, the
equations are substituted back into the original power output function to find the
final objective function, which was previously shown in Section 3.2.
The second objective function, which minimizes the height of the device, is shown
next.
( ) ( )
The height of the device was found in terms of the diameter, but a relationship
between the diameter of the gears and the number of teeth was discovered- the
pitch diameter (in millimeters) and number of teeth are equal for each gear. Due to
this linear relationship, the number of teeth was substituted for the diameter size of
the gears, which provided the objective function for the size of the gear box in terms
of active variables.
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
17
( ) ( )
As with the first objective function, the height is now suitable to be optimized in a
solver algorithm because it is in a form with the only variables as active variables.
The cost objective function began with the equation shown below.
Since the cost of the motor, CM, is a constant for this problem, it cannot be broken
into smaller variables. The cost of the gears, however, can be broken down by the
number of gears in the gearbox. This equation is shown below.
( )
The next step is to find the relationship between the cost of the gears and the
number of teeth in each. To do this, a list of 19 different gears was plotted with the
number of teeth against the cost of each gear. A polynomial "best fit" line was
created for the plot and is shown below in Figure 6 to yield a continuous
relationship function between the cost of the gears and the number of teeth.
Figure 6: Relationship Between No. of Teeth & Cost
The relationship of the gear cost and number of teeth is given below for the large
and small gears, respectively.
To find the objective function, these equations are substituted back into the original
equations and the objective function is written in terms of the active variables.
y = 0.0017x2 + 0.1472x + 3.1014
0
5
10
15
20
25
30
35
40
45
50
0 20 40 60 80 100 120 140
Cost($)
Number of Teeth
Number of Teeth vs. Cost
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
18
3.4.2. Equations Breakdown
Below, the objective function equations are broken-down in a graphical and
hierarchal fashion, which were explained previously in Section 3.4.1. In this
structure, any variable that is not assigned a constant value is defined in the next
level with its corresponding equation.
Figure 7: Hierarchal Breakdown of Objective Function Equations
As seen in Figure 7 above, the equation breakdown structure begins with the
objective functions, then works its way down to define the non-constants in the
equations. This is merely a visual of the same breakdown in the previous section.
3.5.The Compromise Decision Support Problem (DSP)
Given:
The relevant information for the system:
F: User input force on turnstile arm- user defined
: Stall torque- user input
: No-load angular velocity- user input
w1, w2, w3: Goals weights- user input
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
19
Find:
System Variables:
To determine the gear ratio and geometry of the device,
t1, t2, n and T
Deviation Variables:
d1+ represents the overachievement in the large gear teeth count
d1- represents the underachievement in the large gear teeth count
d2+ represents the overachievement of the small gear teeth count
d2- represents the underachievement of the small gear teeth count
d3+ represents the overachievement of the number of gears
d3- represents the underachievement of the number of gears
d4+ represents the overachievement of the time through turnstile
d4- represents the underachievement of the time through turnstile
Satisfy:
Geometry constraints:
1. ts-tl≤0
Bounds
1. 20 ≤ t1 ≤ 120
2. 20 ≤ t2 ≤ 120
3. 0 ≤ n ≤ 10
4. 0.5 ≤ T ≤ 3 [seconds]
Minimize:
Deviation function [Z(x)]:
Case A: Archimedean Form
Z(x) = w1*d1- + w2*d2- + w3*d3-
Where wi = 1; 0 ≤ wi
Case B: Preemptive Form (lexicographic)
Z(x) = [Z1, Z2, Z3]
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
20
WhereZ1 = d1-
Z2 = d2-
Z3 = d3-
4. Applied Methods
In order to verify the solution of the problem, various search algorithms are
implemented and compared in this section. The methods that are utilized are the
exhaustive search, Newton Method, and Penalty & Barrier method. The application
and results of each implemented method are shown below.
4.1.Archimedean Weighting Scheme (Exhaustive Search)
The advantages of using an exhaustive search are that the calculations are quite
simple and there is not much room for the algorithm to converge on a local
minimum. The bounds of the search dictate the design space and also the search
criteria for an exhaustive search, which makes it useful when attempting to obtain
an initial idea of what a function looks like as the variables are changed. Also,
changing the weight on an Archimedean Search will help illustrate the influence that
the objective functions have on the optimal point. By changing the weight of one
objective function to eclipse the effects that the other objective functions have, the
trade-offs between the different functions can clearly be seen.
4.1.1. Method Setup
To begin this search algorithm, a closer look at the functions and their behaviors
were studied. By studying the functions before running the search algorithms,
trends in the results can be expected and verified to ensure the programs are
running as desired. To start, the relationship between the gear ratio and power
output was plotted, which can be seen in Figure 8 below. The plot shows that as the
gear ratio (tl/ts) is increased, the output power also steadily increases. Also seen in
the graph is the difference in n values, which represents the number of gear
reductions in the device. It can also be seen that as the number of gear reductions
increase, the power output rises.
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
21
Figure 8: Gear Ratio vs. Power Output
It may seem obvious that the model responds in this way, but the difficulty lies in
modeling the cost and height in conjunction with the power output. Since the cost
restricts the number of gear reductions and the gear ratio, simulations must be run
in the Archimedean Weighting search algorithm to see how the objective functions
interfere with one another.
For the sake of limiting the variables within this problem, the value of T was set to
0.5 seconds to simulate the fastest time a person can push through the turnstile.
After testing various values of T, however, it was found that changing this variable
did not make a large difference in finding the optimal solution. A more detailed
discussion on this is given in Section 4.1.2.
The Archimedean Weighting search algorithm created for the mousetrap homework
assignment was altered to search the objective functions in this problem. The code
for this algorithm is given in Section 8.2.1. As seen in the code, the objective
functions were searched in an exhaustive search method with the bounds of the
problems used as the upper and lower limits for the variables. With this method, an
n x m x p matrix is then created of all the points tested in the objective functions and
the minimum point is found. The algorithm reports this point as the optimal point
and displays the coordinates, along with the values for the objective functions at
that point. A graph of the objective functions with the optimal point is output for the
user to graphically verify that the found point is indeed the optimized solution.
0
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0 1 2 3 4 5 6 7
PowerOutput(W)
Gear Ratio (tl/ts)
Gear Ratio vs. Power Output
n=1
n=2
n=3
n=4
n=5
n=6
n=7
n=8
n=9
n=10
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
22
4.1.2. Results
After re-writing the algorithm to incorporate the function in this problem, several
scenarios were run using various weights for the problem. A sample output from
Matlab is shown below in Figure 9.
Figure 9: Exhaustive Search Sample Output (Scenario 3)
The figure above shows the optimized solution for one of the scenarios run using
the Archimedean Weighted search algorithm. A full list of the scenarios run using
the algorithm is given below in Table 3.
Table 3: Archimedean Weighted Scheme Run Results
The chart above has the inputs as weights and outputs as the optimized values,
which were then plugged into the objective function equations to calculate those
values.
As seen in the table, the change in weights does not severely change the outcome of
the optimization. The reason for this is due to the units of each optimized variable.
w1 w2 w3 tl ts n
1 1 1 1 20 20 1 0.0083217 40 15.45
2 0.00002 0.49999 0.49999 20 20 1 0.0083217 40 15.45
3 0.99998 0.00001 0.00001 120 20 10 0.3015929 770 521.71
4 0.00001 0.99998 0.00001 20 20 1 0.0083217 40 15.45
5 0.0001 0.0001 0.9998 20 20 1 0.0083217 40 15.45
6 0.8 0.1 0.1 20 20 1 0.0083217 40 15.45
7 0.9 0.1 0.1 20 20 1 0.0083217 40 15.45
8 0.99 0.005 0.005 20 20 1 0.0083217 40 15.45
9 0.999 0.0005 0.0005 20 20 1 0.0083217 40 15.45
10 0.9995 0.00025 0.00025 85 20 7 0.1998018 420 244.35
11 0.9998 0.0001 0.0001 111 20 10 0.2929221 720.5 473.12
12 0.9999 0.00005 0.00005 120 20 10 0.3015929 770 521.71
Cost ($)Scenario
Weights Optimized Values
Power (W) Height (mm)
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
23
Note that the magnitude of the height is in millimeters and the cost is in dollars,
both of which have values of two significant digits in front of the decimal. The power
output, however, is in watts and is four to five decimals smaller than the other two
objective function outputs. Since the Archimedean Weighted search algorithm does
not take units into account when comparing unlike units, this causes the weight of
the power output to need a much higher value than the other two to have a
significant effect on the weighted equation. This is seen in scenarios 10 through 12,
where a weight of 0.9995 was needed for w1 to make the power output objective
function outweigh the importance of the other two objective functions. To
compensate for this, the units of the power output can be changed to mW, which
would allow all three outputs to have the same order of magnitude for the number
comparisons.
As previously mentioned, T was set to a constant value to avoid exceeding the
allowable dimensions for a matrix within Matlab. Since T is only a variable of the
power output objective function, it makes sense to study the effect T has on the
output while weighing the first objective function heavily within the Archimedean
weighting scheme. To test the effect, Scenario 3 from Table 3 was used and the
output results were compared. To test the extremes of the T values, two simulations
of Scenario 3 were run and compared. Figure 10 below shows the output of Scenario
3 with a T value of T=0.5.
Figure 10: Archimedean Weighted Output of Scenario 3 with T=0.5
For comparison, the same simulation was run after the T value was changed to T=3.
The output results from that simulation are given below in Figure 11.
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
24
Figure 11: Archimedean Weighted Output of Scenario 3 with T=3
As seen in the two figures above, the output results are almost identical, with only
the minimum value of the Archimedean Weighted function differing slightly. Since
the variation in the results is not profound and the algorithm converges on the same
solution even though a heavy weight was given to the power output objective
function, it was determined that allowing T to be a constant value of T=0.5 would
not make a significant difference in the outcome of the scenario simulations.
In order to graphically verify the accuracy of the results, plots of the output
weighted function are needed. Below in Figure 12 is a contour plot of Scenario 1,
which has the same output as most of the other scenarios.
Figure 12: Archimedean Weighted Contour Plot (Scenario 1)
As seen in the plot above, the optimal point is plotted on top of the objective
function contour lines. Also seen in the plot, the contour lines have smaller values as
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
25
the number of teeth on each gear decrease. To help with the visualization, a mesh
plot of Scenario 1 is given below in Figure 13. As seen in the mesh plot, the objective
function decreases as the number of gear teeth decrease. This correlates as expected
because the power output objective function is overwhelmed by the cost and height
objective functions.
Figure 13: Archimedean Weighted Output Mesh Plot (Scenario 1)
As mentioned earlier, one of two options can be employed to allow the power
output objective function to be the same order of magnitude as the other two
objective functions. Either the units of the power output can be changed or the
weight corresponding to that objective function can be drastically increased above
the other weights. The latter was employed in Scenario 3, which has its contour plot
given below in Figure 14.
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
26
Figure 14: Archimedean Weighted Contour Plot (Scenario 3)
The plot above seems to follow a less linear pattern than that in Figure 12. To gain a
fuller understanding of what is happening in the plot, this scenario is plotted in a
mesh grid, which is given below in Figure 15.
Figure 15: Archimedean Weighted Example Mesh Plot (Scenario 3)
With the power output as the primary concern for the optimization, the optimal
solution is given as the highest gear ratio (6:1) and 10 gear reductions (n=10). Even
though the power output from this “optimal” solution is approximately four times
the power output from the other scenarios, it is about 34 times the cost, which is
completely unacceptable. Even though producing the most effective device is a high
engineering priority, the product must be marketable and profitable, which is not
going to happen if it costs over $521.71.
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
27
4.2.Penalty & Barrier
The Penalty & Barrier method is typically implemented when there exists a problem
with an objective function that has both feasible and infeasible regions. If the
starting point lies within the feasible region, the Barrier method is enabled, which
keeps the algorithm from moving into the feasible region. If the starting point is
within the infeasible region, however, the algorithm implements the Penalty
method. This part of the algorithm moves the optimal point very close to the
constraint, which gives the user an output that lies on the constraint line and is
therefore a feasible solution. The advantage to this algorithm is that the entire
design space is available for the user to start in, which is beneficial when little is
known about the objective function or constraints. Additionally, it is a very robust
algorithm that typically does not get stuck in local minima or “false” optimal points
like some other search algorithms. One last advantage is that the program converges
relatively quickly. When compared to the fmincon algorithm, the number of
iterations to convergence was equal or less than those needed for fmincon. The
Penalty & Barrier method was chosen as the second search algorithm implemented
in this report to find the optimal solution for the turnstile generator device.
4.2.1. Method Setup
In order to fit the problem into the proper format for the Penalty & Barrier method,
the cost and height objective functions were transformed into constraints to create
feasible and infeasible regions within the design space. To find reasonable values to
set as the limits for the cost and height of the product, it is prudent to refer to the
previous work performed on this project in 2009. It was determined that to make
the product cost-efficient, a set price of $30 is plausible. Additionally, a constraint on
the height of h ≤ 0.20m is a realistic constraint due to the size of the turnstiles and
the amount of room available inside the turnstiles.
With these conversions of objective functions to constraints, the models can be
created within the Matlab algorithm, which is shown explicitly in Section 8.2.2. It
should be noted that the tl and ts values in the objective function and constraints
have been converted to x1 and x2, respectively. This made it easier to retrofit this
problem to the algorithms created in previous assignments.
The purpose of the Penalty & Barrier Method is to ensure that the function
optimizes within the feasible region and finds the best solution while adhering to
the constraints placed on the system. The objective for this problem is to find the
maximum power output while keeping inside the constraints of a maximum cost of
$30 and a maximum height of 0.20 meters.
4.2.2. Results
As with any other search algorithm, it is necessary to use several starting locations
with the Penalty & Barrier method to ensure that the converged solution is the
global minimum. To thoroughly test the algorithm, a mixture of feasible and
infeasible starting locations were selected as starting points to ensure that both the
Penalty and Barrier search algorithms were working as anticipated. The starting
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
28
locations, along with the optimal solutions corresponding to each, are given below
in Table 4.
Table 4: Penalty & Barrier Run Results
As noticed in the table, the starting point of (0, 0) did not converge on a solution.
The reason for this is due to the Penalty and Barrier search algorithms; the gradient
of the objective function is calculated and solved using the variable values from the
starting location. Since the gradient of the power output objective function involves
dividing by one of the variables, that returns a solution that is insolvable and thus
the optimal solution is NA.
Another noticeable feature of the table is that Run2 through Run4 converge at to the
point (20, 20), which is the optimal solution for this search algorithm. This is
confirmed as the optimal solution because the f value for that point is 0.0083, which
is smaller than the next lowest value of 0.0206 at (49.97, 20).
To verify the solutions graphically, several plots of the objective function and
constraints were created. Below in Figure 16 is a contour plot of the objective
function, cost constraint and the optimal point for Run2.
x1 x2 x1 x2
1 0 0 N/A N/A N/A N/A
2 10 10 20 20 1 0.0083
3 -10 -10 20 20 3 0.0083
4 -50 10 20 20 2 0.0083
5 1000 -10 68.797 20 18 0.0282
6 -1000 1000 23.03 23.03 1 0.0083
7 1000 -1000 68.797 20 2 0.0282
8 -1000 -1000 23.03 23.03 1 0.0083
9 80 1 68.797 20 1 0.0282
10 50 1 49.97 20 1 0.0206
Run
Starting Point Optimized Point
# of Iterations f value
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
29
Figure 16: Penalty & Barrier Method Contour Plot Converged for Run2
To see the difference between the optimized points, another contour plot was
created for a different starting point. The contour plot of Run5 is given below in
Figure 17.
Figure 17: Penalty & Barrier Method Contour Plot Converged for Run5
As in the previous section, it is difficult to visualize a three dimensional view the
objective function and constraints, so a mesh plot of the problem is provided below
in Figure 18.
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
30
Figure 18: Penalty & Barrier Method Example Mesh Plot
In the mesh plot above, it is much clearer to see how the objective function changes
with the variation in the x1 and x2 variables. As the function reaches the lower
values of x1, the plot raises sharply corresponding to the changes in x2. The reason
for this is because the variables appear as ratios within the objective function and
thus affect one another at each point in the design space. With the lower bounds set
at 20 for both x1 and x2, it is clear to see that the minimal point on the mesh plot is
at (20, 20).
4.3.Fmincon
This search algorithm is a line-search-based algorithm that is built within the Matlab
Optimization Toolbox, and is a convenient and easy search algorithm to implement.
The only parameters that the user must specify to run the algorithm are: the
objective function, the constraints, the upper and lower bounds (if applicable) and
the starting search point. After these are specified, the tool uses a version of a line
search to calculate the optimal point within the feasible area. From previous work,
however, it is noted that sometimes the algorithm gets trapped at a local minimum
or other point and does not converge on the true global minimum for the problem.
Thus, it is important to test several different starting points to ensure that the
minimum point is truly the minimum, and not just a falsely reported point.
4.3.1. Method Setup
In this search algorithm, the height constraint was dropped because it over-
constrained the problem and did not allow for any of the solutions to be feasible.
Since the height constraint was removed, each of the output solutions is investigated
manually to determine if they are feasible with respect to the device height. With
this, the power output is the only objective function and the cost constraint is the
only constraint on the problem. To keep the design space restricted to the area of
concern, the number of gear teeth was limited by upper and lower limits, which
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
31
were 120 and 20, respectively. This forced the algorithm to only report solutions
where the large gear teeth count and the small gear teeth count were both within
the allowable range for purchasable gears from an online vendor. (Steel, Hubless
Spur Gears)
The algorithm for this problem is the same code generated for homework
assignment 5, but is tweaked to allow for multiple constraints and specified bounds.
To see a full version of the code written for this algorithm, see Section 8.2.3 in
Appendix A. As with the Penalty & Barrier method, the tl and ts constraints have
been converted to x1 and x2, respectively.
4.3.2. Results
To obtain verified and confident results from the fmincon algorithm, several
iterations must be performed using various starting points. This ensures that the
true optimal point is found and that the algorithm does not get stuck at a local
minimum or other “false” point, which happens on occasion. In this report, 10
different runs were performed using the fmincon function and the results are shown
below in Table 5.
Table 5: Fmincon Run Results
One interesting point about these results is that all of the outputs have the same f
value. The reason for this is that the variables appear as a fraction within the
objective function and each of the optimal values for x1 and x2 are equal. Since the
variables are equal in each optimal point, the ratio of the two is 1:1 for each run,
which thus produces the same f value for each simulation. As seen in the table
above, the point (20, 20) is the most common point that the algorithm converges
upon. This point is the minimum point in this optimization given the constraints. As
mentioned earlier, the height constraint was removed so that the function could
converge within the feasible region of the cost constraint. To determine the
relationship between the height constraint and the power output objective function,
the cost constraint was replaced by the height constraint and the simulations in
x1 x2 x1 x2
1 0 0 20 20 1 0.0083
2 10 10 20 20 1 0.0083
3 -10 -10 20 20 1 0.0083
4 -50 10 20 20 1 0.0083
5 1000 -10 23.16 23.16 7 0.0083
6 -1000 1000 45.94 45.94 8 0.0083
7 1000 -1000 23.2 23.2 7 0.0083
8 -1000 -1000 20 20 1 0.0083
9 80 1 24.65 24.65 6 0.0083
10 50 1 41.43 41.43 5 0.0083
Starting Point Optimized Point
# of IterationsRun f value
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
32
Table 5 were rerun. Every scenario, however, converged on the point (20, 20) and
is therefore not necessary to put into tabular form.
To gain a fuller understanding of the problem and verify the results graphically, the
contour plot of the objective function and optimal point is shown below in Figure
19.
Figure 19: Fmincon Contour Plot Converged for Run1
As in the previous sections, the contour plot does not show a complete view of the
objective function, so a mesh plot was also created. The mesh plot for the fmincon
simulations is given below in Figure 20.
Figure 20: Fmincon Example Mesh Plot
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
33
In the plots, notice that the upper and lower bounds for the number of gear teeth are
not plotted. These limits are 120 and 20, respectively, which is why the fmincon
algorithm converged on the point (20, 20).
Figure 21: Fmincon Contour Plot Converged for Run10
Even though the lower bounds for x1 and x2 are not shown in the contour plots
above, it is clear that minimum point for the objective function lies at the point (20,
20), which was confirmed by the output of the fmincon algorithm.
5. Comparison of Methods
As is typical of any group of search algorithms, each one has its own distinct
advantages and disadvantages. To compare the algorithms used in this study,
several characteristics of the programs are investigated, including the quality,
speed, robustness and ease of use. Since each of the algorithms was used to solve
the problem and find the optimal solution, the advantages of all the algorithms
supplement one another to compensate for any disadvantages that may exist. To
assist in comparing the algorithms, the results table from each algorithm are
consolidated in this section and shown below in Table 6 and Table 7.
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
34
Table 6: Summary of Archimedean Weighted Exhaustive Search Results
Table 7: Combined Results of Penalty & Barrier Method and Fmincon
Due to the difference in outputs between the Archimedean weighted exhaustive
search and the latter two search algorithms, they were kept in separate tables.
w1 w2 w3 tl ts n
1 1 1 1 20 20 1
2 0.00002 0.49999 0.49999 20 20 1
3 0.99998 0.00001 0.00001 120 20 10
4 0.00001 0.99998 0.00001 20 20 1
5 0.0001 0.0001 0.9998 20 20 1
6 0.8 0.1 0.1 20 20 1
7 0.9 0.1 0.1 20 20 1
8 0.99 0.005 0.005 20 20 1
9 0.999 0.0005 0.0005 20 20 1
10 0.9995 0.00025 0.00025 85 20 7
11 0.9998 0.0001 0.0001 111 20 10
12 0.9999 0.00005 0.00005 120 20 10
Optimized ValuesWeights
Run
x1 x2 x1 x2
1 0 0 N/A N/A N/A N/A
2 10 10 20 20 1 0.0083
3 -10 -10 20 20 3 0.0083
4 -50 10 20 20 2 0.0083
5 1000 -10 68.797 20 18 0.0282
6 -1000 1000 23.03 23.03 1 0.0083
7 1000 -1000 68.797 20 2 0.0282
8 -1000 -1000 23.03 23.03 1 0.0083
9 80 1 68.797 20 1 0.0282
10 50 1 49.97 20 1 0.0206
1 0 0 20 20 1 0.0083
2 10 10 20 20 1 0.0083
3 -10 -10 20 20 1 0.0083
4 -50 10 20 20 1 0.0083
5 1000 -10 23.16 23.16 7 0.0083
6 -1000 1000 45.94 45.94 8 0.0083
7 1000 -1000 23.2 23.2 7 0.0083
8 -1000 -1000 20 20 1 0.0083
9 80 1 24.65 24.65 6 0.0083
10 50 1 41.43 41.43 5 0.0083
fmincon
Run
Starting Point Optimized Point
# of Iterations f value
Penalty&BarrierMethod
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
35
5.1.Quality
As far as the quality of the algorithms is concerned, the Penalty & Barrier algorithm
is the best. Since the objective function can be constrained with the constraint
equations, it is a higher quality than the exhaustive search and on the same level as
the fmincon search function. Since the fmincon predetermines the search algorithm
used to find the optimal solution, it is deemed lower quality than the Penalty &
Barrier method. The reason that the Archimedean weighted exhaustive search is
ranked lower than the other two in terms of quality is that there is a maximum
number of variables allowable within that algorithm, which is restricted by the
maximum allowable number of dimensions (three) in a matrix in Matlab. The
fmincon and Penalty & Barrier search methods, however, can optimize a
multivariable function without limits on the variables, which makes them more
effective for higher-order functions that are more complex.
5.2.Speed
To compare the speed of the algorithms, the number of iterations is considered
along with the amount of time it takes for the algorithms to converge. As far as the
time it takes for each to converge, the Penalty & Barrier method and the fmincon
search are much faster than the Archimedean weighted exhaustive search. The
reason for this is that the exhaustive search populates an entire matrix that contains
thousands of entries of the calculated Archimedean weighted formula at each point,
which the algorithm then uses to find the minimum. This is a highly iterative and
lengthy process, which is the reason that the Archimedean weighted exhaustive
search takes much longer than the other two algorithms. As seen in Table 7 above,
the Penalty & Barrier method and the fmincon search tool require approximately
the same number of iterations to converge, depending on the starting point. Since
this problem is not as complex as many other engineering studies, the amount of
time it takes for the algorithms to converge is trivial because the variation is in the
order of magnitude of seconds. If this problem was more complex and the difference
in the time to convergence was more than an hour, the speed could influence the
cost and this parameter would have much more weight in the quality of each search
algorithm.
5.3.Ease of Use
In terms of the ease of use, the Penalty & Barrier method along with the fmincon
search algorithm only needs variation in starting points to change the outcome. This
is very simple to implement and obtain diverse results. The exhaustive search
requires a change in the weights to change the shape of the Archimedean weighted
formula. This is also uncomplicated to implement, however it requires three inputs
rather than one.
As far as the complexity of the algorithms, the Archimedean weighted exhaustive
search is by far the simplest of the three codes. Not only is the math straightforward
and explicit, but the way that the code runs is linear without any continuously
running loops, functions or wrappers. Since it is so direct, the algorithm is easy to
troubleshoot and change if any problems arise. The Penalty & Barrier method is
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
36
similar, but longer with “while” and “for” loops, which adds to the complexity.
However, since I developed the program, it is easy for me to troubleshoot. The
fmincon search algorithm, however, is an optimization tool provided by Matlab and
is not able to be modified. These are factors that determine the ease of use of each
algorithm and should be considered when determining which algorithm is suitable
for use in future projects.
5.4.Robustness
The most robust algorithm of the three presented in this project is the Penalty &
Barrier method. Since the starting point typically converges on the correct solution
and can start in the feasible or infeasible region, this program is able to withstand
any input and output a reliable converged solution. This fmincon function, however,
is not quite as dependable. This program gets stuck in local minima and other
random points, which may not be the optimal solution of the system. To work
around this, several starting points must be tested and the f value for each should be
compared to determine the actual global minimum. Additionally, sufficient
conditions such as the Karush-Kuhn-Tucker (KKT) should be implemented to verify
that the optimized solution is indeed the best solution.
Much like the Penalty & Barrier method, the Archimedean weighted exhaustive
search is exceedingly robust. Due to the simplicity of the algorithm, the vigor of the
program is raised because there is less that can malfunction during the calculations.
As with many systems, the simplest systems are typically the most reliable, and this
case proves to be no different.
6. Conclusion
Through the work performed in this report, it seems that the project idea is not as
economically feasible as previously anticipated. It appears that with the lack of
power output and the higher-than-anticipated costs, the construction and
production of this device is not worth pursuing. The results show that the optimal
power output is a gear ratio of 1:1, which entails that the turnstile arm angular
velocity is not increased at all, but rather that the shaft is connected directly to the
DC motor for energy capture. Despite what these results indicate, they are only as
accurate as the models that were used in the search algorithms. These results
should be verified by actual data through prototype testing to ensure that the device
is actually ineffective. As in the optimization, different gear sizes should be
implemented to find the relationship between the changes in power output from the
motor.
Strictly speaking on the study, however, this idea has been rendered economically
infeasible and therefore not worth pursuing. Since the optimal solution in each of
the three search algorithms determined that the best scenario is for a 1:1 ratio, it
means that the gearbox used to increase the rotational velocity of the turnstile arm
is too costly and capturing the energy from a turnstile arm is impractical because
the setup does not generate enough power to make it worth pursuing.
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
37
7. Future Work
To expand upon this project and make it encompass more of the reality of the
problem, there are several additional aspects that can be examined. For instance,
from a feasibility standpoint, it is important to determine if the material of the gears
are able to withstand the stresses applied due to the angular velocity and torque of
the turnstile arms. Due to the steep increase of angular velocity of the motor shaft,
the stresses on the gear teeth are raised as well, thus possibly exceeding the
maximum limit of the currently chosen gears. To avoid this, a relationship could be
determined between the different materials from which the gears are fabricated and
the maximum allowable torque on the teeth. This could then be used as another
constraint in the compromise DSP to help with the feasibility of the problem. In
conjunction with the different gear materials, perhaps it would be appropriate to
research the different types of gears, such as gears with hubs. From a construction
perspective, this would decrease the complexity and lower the cost on assembly.
Another characteristic of the problem that has been overlooked is the cost of all the
components. As with the gears, a model can be created to incorporate the cost of all
the components of the device, which would help account for all the extraneous costs,
such as the gear shafts and gearbox casing.
Two last items that can be incorporated into the problem are the turnstile arm
length and the force applied to the turnstile arm. These will affect the amount of
power generated per person and thus have a direct effect on the optimized solution.
Since these were only assumptions in this problem, they can be changed to variables
and varied in the optimization algorithms to determine the best solution.
Even though the work in this report shows that it is not profitable, there are several
other variables that can be investigated further for possible improvement on the
idea. One option that can be incorporated into the design of this device is a free
spinning flywheel attached to the output motor shaft. By adding a flywheel to the
design, the motor shaft will continue to spin, even after the user has passed through
the turnstile and the turnstile arm shaft has stopped spinning. By adding the
capability of the flywheel to engage and disengage the motor shaft, the initial
rotational moment of inertia can be effortlessly overcome and will thus reduce the
amount of force required to spin the turnstile arms. Another parameter that can be
investigated further is the correlation between the gear ratio and the amount of
force required to turn the turnstile arms. Each gear increases the resistance and
adds more force necessary to spin the arms and pass through the turnstile, which is
a relationship that is worth studying and incorporating into the model.
Despite what the outputs from the algorithms show, one must remember that the
results must be analyzed with a critical eye. The results from an algorithm should be
used to help engineers make decisions on real systems, not be the deciding factor on
whether an idea is worth pursuing. Also, it is important to keep in mind that garbage
in is equal to garbage out, which means that if the models created for this report
were not completely accurate, then all results generated from this study are null and
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
38
void. To verify these findings without investing too much time or money, it is
recommended that another prototype be built for this device and that a few of the
various gear ratios be tested to determine if the power output correlates with the
data generated in this study.
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
39
8. Appendix A
8.1.Definition of Variables
( )
( )
( )
( )
( )
8.2.Matlab Code
The codes used to find the optimal solutions are shown in the following section.
Note that the program used to create the following codes was Matlab 2012a.
8.2.1. Archimedean Weighting Scheme (Exhaustive Search)
Exhaustive_Search_Method
%% ME6103 TURNSTILE GENERATOR OPTIMIZATION
%Wayne Smith- December 19, 2012
%%Archimedean Weights Solver for Turnstile Generator
%
%Specify Design Variables
%tl=number of teeth on large gear
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
40
%ts=number of teeth on small gear
%n=number of gears (large and small)
%T=amount of time it takes to push through turnstile (secs)
clear;clc;close all;
%DEFINE CONSTANTS
%Motor properties
tau_s=2*10^(-3); %stall torque (N-m)
wn=200*pi(); %unloaded ang velocity (rad/sec)
cm=2; %cost of 1.5V DC motor (in $)
T=3; %time to push through turnstile
%Set Weights
w1=.00001; %weight for output power
w2=.00001; %weight for size of gearbox
w3=.00001; %weight for cost of motor and gears
%SYSTEM BOUNDS
%Lower Bounds
tl_l=20;
ts_l=20;
n_l=1;
%Upper Bounds
tl_u=120;
ts_u=120;
n_u=10;
%Adjusted bounds for proper matrix construction
tll=tl_l-19;
tsl=ts_l-19;
tlu=tl_u-19;
tsu=ts_u-19;
for i=tll:1:tlu
for j=tsl:1:tsu
for k=n_l:1:n_u
power(i,j,k)=-(tau_s/wn)*(k.*((i+19)./(j+19)).*...
((2*pi())/(3*T)))^2+tau_s.*(k.*((i+19)./(j+19))*...
((2*pi())/(3*T)));
h(i,j,k)=((k+1)/2)*((i+19)+(j+19));
cost(i,j,k)=cm+k*((0.0017.*(i+19).^2+0.1472.*(i+19)+...
3.1014)+(0.0017.*(j+19).^2+0.1472.*(j+19)+3.1014));
end
end
end
%Weighted Function
A=-w1.*power+w2.*h+w3.*cost;
%FIND THE MINIMUM
[minA idx] = min(A(:));
[n m p] = ind2sub(size(A),idx);
%CALCULATE OPTIMAL VALUES
tl_opt=n+19; %optimal value for tl
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
41
ts_opt=m+19; %optimal value for ts
n_opt=p; %optimal value for n
%GRAPH FUNCTION
%convert all zeroes and '-inf' to 'inf'
A(A==0)=Inf; A(A==-Inf)=Inf;
B=min(A,[],3); %search 3d matrix for min values and output nxm min
matrix
hold on
contour(B,40)
plot(tl_opt,ts_opt,'o') %add the optimal point to the graph
xlabel('Number of Large Gear Teeth')
ylabel('Number of Small Gear Teeth')
zlabel('Optimal Number of Gears')
title('Minimized Archimedean Solutions')
grid on
hold off
%DISPLAY FINAL VALUES
fprintf('nMinimum Value:'),disp(minA)
fprintf('nOptimal Number of Large Gear Teeth:'),disp(tl_opt)
fprintf('nOptimal Number of Small Gear Teeth:'),disp(ts_opt)
fprintf('nOptimal Number of GearsMinimum Value:'),disp(n_opt)
8.2.2. Penalty & Barrier Method
Combined_method
%% Combined Penalty & Barrier Method
%Conversion of Constrained Optimization to Unconstrained Optimization
%
% This code takes an objective function with constraints and outputs:
% 1. The optimal x1 and x2 values
% 2. The final penalty parameter value, r
% 3. The number of iterations it took to converge, iter
% 4. The objective function value at the optimal point
% 5. The inequality constraint value
clear all;clc;close all;warning off;
format compact
%DEFINE PARAMETERS
iter=0; %initialize iteration value
g_vio=1; %initialize violated constraint value
f_val_diff=100; %initialize obj fun difference value
%DEFINE VARIABLES
x=[10;10]; %starting point
r=1; %starting value for penalty parameter, r
iter_max=15; %maximum # of iterations before code stops
eps=1e-4; %limit for the difference in optimal obj fun val
g_limit=1e-6; %limit for the sum of constraints values before code
stops
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
42
%DEFINE FUNCTIONS
syms x1 x2 f g h F grad1 grad2
assumeAlso(x1,'real') %sets x1 to only take real values
assumeAlso(x2,'real') %sets x2 to only take real values
f=-((2*10^-3)/(200*pi()))*(1*((x1/x2)*(2*pi())/1.5))^2+...
(2*10^-3)*(1*(x1/x2)*(2*pi())/1.5); %objective function
g_sym=[-28+1*((0.0017*x1^2+0.1472*x1+3.1014)+... %constraints
(0.0017*x2^2+0.1472*x2+3.1014));
20-x1;
20-x2;
x2-x1;];
%TEST TO FIND VIOLATED CONSTRAINTS
g_vals=subs(g_sym,[x1 x2],[x(1) x(2)]);
test1=max(0,g_vals);
if any(test1>0)
%sorts through elements to find entries >0
num=find(test1>0);
%calls entries>0 from symbolic constraint functions
cons_vio=g_sym(num);
else
cons_vio=0;
end
cons_vio; %constructed array of violated constraints
%DISPLAY NUMBER OF CONSTRAINTS VIOLATED
N=length(cons_vio);
if (cons_vio==0)
fprintf('No Constraints Violated!n')
elseif (N==1)
fprintf('1 Constraint Violated!n')
elseif (N==2)
fprintf('2 Constraints Violated!n')
elseif (N==3)
fprintf('3 Constraints Violated!n')
elseif (N==4)
fprintf('4 Constraints Violated!n')
elseif (N==5)
fprintf('5 Constraints Violated!n')
elseif (N>5)
fprintf('More than 5 Constraints Violated!n')
end
fprintf('----------------------------------------------------------n')
fprintf('Constraints Violated:n')
disp(cons_vio)
fprintf('----------------------------------------------------------n')
%DETERMINE IF PENALTY OR BARRIER METHOD IS NEEDED
%STARTING POINT IN FEASIBLE REGION
%BARRIER METHOD ENABLED
if (cons_vio==0)
fprintf('nStarting Point is in Feasible Region. ')
fprintf('Barrier Method Enabled.n')
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
43
fprintf('n----------------------------------------------------------
n')
N=length(g_sym);
for i=1:N
pen_term(i)=1/(g_sym(i));
i=i+1;
end
while f_val_diff>eps
g=sum(pen_term);
F=f-r*g; %the unconstrained function
f_val_prev=subs(F,[x1 x2],[x(1) x(2)]);
Fs = @(x) subs(F,[x1 x2],[x(1) x(2)]);
x=fsolve(Fs,x)
%CALCULATE DIFFERENCE IN OBJ FUN VALUES
f_val_new=subs(F,[x1 x2],[x(1) x(2)]);
f_val_diff=abs((f_val_new-f_val_prev)/(f_val_new));
r=.1*r; %find new value of r
iter=iter+1; %add 1 to iteration count
end
n1=length(x);
for i=1:n1
f_val1(i)=subs(f,{x1,x2},{x(i,1),x(i,2)});
end
opt_pt=[x(2,1), x(2,2)];
f_val=subs(f,{x1,x2},{x(2,1),x(2,2)});
fprintf('nOptimal Point Coordinates:'), disp(opt_pt)
fprintf('nFinal Penalty Parameter Value (r):'), disp(r)
fprintf('nNumber of Iterations to Convergence:'), disp(iter)
fprintf('nObjective Function Value:'), disp(f_val)
%PLOT THE FUNCTION
hold on
ezcontour(f,[-20,20],30) %create contour plot
n=length(g_sym);
for i=1:n
ezplot(g_sym(i),[-20,20]) %show constraint lines on plot
end
plot(opt_pt(1),opt_pt(2),'o') %add the optimal point to the graph
text((opt_pt(1)+2),(opt_pt(2)-2),['(', num2str(opt_pt(1)), ', ',...
num2str(opt_pt(2)), ')'])
text(opt_pt(1),opt_pt(2),' leftarrow Optimal Point')
title('HW5 Problem with Penalty: Objective Function f with Constraint
g')
grid on
hold off
%STARTING POINT IN INFEASIBLE REGION
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
44
%PENALTY METHOD ENABLED
else
fprintf('nStarting Point is in Infeasible Region. ')
fprintf('Penalty Method Enabled.n')
fprintf('n--------------------------------------------------------
--n')
N=length(cons_vio);
%CREATE AN ARRAY OF SQUARED CONSTRAINT TERMS
for i=1:N
pen_term(i)=(cons_vio(i))^2;
i=i+1;
end
while g_vio>g_limit && iter_max>iter
g=sum(pen_term);
F=f+r*g; %the unconstrained function
Fs = @(x) subs(F,[x1 x2],[x(1) x(2)]);
x=fsolve(Fs,x)
%TEST TO SEE IF ANY CONSTRAINTS ARE VIOLATED
test_cons=subs(g_sym,[x1 x2],[x(1) x(2)]);
%tests whether constraints are larger than 0
test2=max(0,test_cons);
%solve for g to determine if loop continues
g_vio=sum(subs(cons_vio,[x1 x2],[x(1) x(2)]));
r=10*r; %find new value of r
iter=iter+1; %add 1 to iteration count
end
f_val=subs(f,{x1,x2},{x(1),x(2)});
g_val=subs(g_sym,{x1,x2},{x(1),x(2)});
fprintf('nOptimal Point Coordinates:'), disp(x)
fprintf('nFinal Penalty Parameter Value (r):'), disp(r)
fprintf('nNumber of Iterations to Convergence:'), disp(iter)
fprintf('nObjective Function Value:'), disp(f_val)
fprintf('nInequality Constraint Value:'), disp(g_val)
%PLOT THE FUNCTION
hold on
ezcontour(f,[0,120]) %create contour plot
ezplot(g_sym(1),[0,120])
plot(x(1),x(2),'o') %add the optimal point to the graph
text((x(1)+2),(x(2)-5),['(', num2str(x(1)), ', ',...
num2str(x(2)), ')'])
text(x(1),x(2),' leftarrow Optimal Point')
title('Final Report Penalty & Barrier: Obj Fun f with Con g')
grid on
hold off
end
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
45
8.2.3. fmincon
run_fmincon
%% Run fmincon
clear all; clc; close all; warning off; %reset Matlab memory
fprintf('The values of function value and constraints at starting
point');
x0 = [50,1] % Make a starting guess at the solution
f=objfun(x0)
%Specify bounds
lb = [20,20]; % Set lower bounds
ub = [120,120]; % Set upper bounds
options=optimset('LargeScale','off','Display','iter');
[c, ceq]=constraints(x0)
[x, fval]=fmincon(@objfun,x0,[],[],[],[],lb,ub,@constraints,options)
fprintf('The values of constraints at optimum solution');
[c, ceq]=constraints(x) %check the constraint values at x
%Define the function symbolically
syms x1 x2
%Output Power Objective Function
f1=-((2*10^-3)/(200*pi()))*(1*((x1/x2)*(2*pi())/1.5))^2+...
(2*10^-3)*(1*(x1/x2)*(2*pi())/1.5);
%Cost Constraint
g_sym1=-28+1*((0.0017*x1^2+0.1472*x1+3.1014)+...
(0.0017*x2^2+0.1472*x2+3.1014));
%Height Constraint
% g_sym2=((10+1)/2)*(x1+x2)-0.2;
%PLOT THE FUNCTION
hold on
%ezsurf(f1,[0,120]) %create surface plot
ezcontour(f1,[0,120]) %create contour plot
n=length(g_sym1);
for i=1:n
ezplot(g_sym1(i),[0,120]) %show cost constraints on plot
end
plot(x(1),x(2),'o') %add the minimum point to the graph
text((x(1)+2),(x(2)-5),['(',num2str(x(1)), ', ', num2str(x(2)), ')'])
text(x(1),x(2),' leftarrow Optimal Point')
title('Final Report: Objective Function f with Constraints g')
grid on
hold off
objfun
function f=objfun(x)
f=-((2*10^-3)/(200*pi()))*(1*((x(1)/x(2))*(2*pi())/1.5))^2+...
(2*10^-3)*(1*(x(1)/x(2))*(2*pi())/1.5);
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
46
constraints
function [c, ceq]=constraints(x)
%Nonlilnear inequality constraints
%Cost constraint
c(1)=-28+1*((0.0017*x(1)^2+0.1472*x(1)+3.1014)+...
(0.0017*x(2)^2+0.1472*x(2)+3.1014))
%Gear geometry constraint
c(2)=x(2)-x(1)
%Height constraint
% c(3)=((10+1)/2)*(x(1)+x(2))-0.2;
%Nonlinear equality constraints
ceq=[];
Final Report: Turnstile Generator: Maximize Energy Output
M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr.
47
9. Works Cited
Angular Velocity. (2012, December 8). Retrieved 12 2012, 2012, from Wikipedia:
http://en.wikipedia.org/wiki/Angular_velocity
Product Data Sheet. (2012). Retrieved December 16, 2012, from Precision
Microdrives: https://catalog.precisionmicrodrives.com/.../107-001-7mm-dc-
motor-25mm-type-datasheet.pdf
DC Motor Specifications. (n.d.). Retrieved December 11, 2012, from The Electronic
Store: http://theelectrostore.com/datasheets/tsukasa_tech_05.pdf
Page, M. (1999). Understanding D.C. Motor Characteristics. Retrieved December 9,
2012, from Massachusetts Institute of Technology:
http://lancet.mit.edu/motors/motors3.html
Steel, Hubless Spur Gears. (n.d.). Retrieved December 7, 2012, from Quality
Transmission Components:
http://www.qtcgears.com/RFQ/default.asp?Page=../KHK/newgears/KHK06
4.html

Weitere ähnliche Inhalte

Was ist angesagt?

Daikin RXC-B (R32) manual service.pdf
Daikin RXC-B (R32) manual service.pdfDaikin RXC-B (R32) manual service.pdf
Daikin RXC-B (R32) manual service.pdfMaurizioDumitrache
 
Case w20 f wheel loader service repair manual
Case w20 f wheel loader service repair manualCase w20 f wheel loader service repair manual
Case w20 f wheel loader service repair manualfujsjefkskem
 
NÂNG CAO HIỆU QUẢ CỦA HOẠT ĐỘNG TÍN DỤNG KHÁCH HÀNG DOANH NGHIỆP TẠI NGÂN H...
NÂNG CAO HIỆU QUẢ CỦA HOẠT ĐỘNG  TÍN DỤNG KHÁCH HÀNG DOANH NGHIỆP TẠI  NGÂN H...NÂNG CAO HIỆU QUẢ CỦA HOẠT ĐỘNG  TÍN DỤNG KHÁCH HÀNG DOANH NGHIỆP TẠI  NGÂN H...
NÂNG CAO HIỆU QUẢ CỦA HOẠT ĐỘNG TÍN DỤNG KHÁCH HÀNG DOANH NGHIỆP TẠI NGÂN H...lamluanvan.net Viết thuê luận văn
 
ĐÁNH GIÁ MỨC ĐỘ HÀI LÒNG CỦA KHÁCH HÀNG ĐỐI VỚI DỊCH VỤ CHO VAY TIÊU DÙNG - T...
ĐÁNH GIÁ MỨC ĐỘ HÀI LÒNG CỦA KHÁCH HÀNG ĐỐI VỚI DỊCH VỤ CHO VAY TIÊU DÙNG - T...ĐÁNH GIÁ MỨC ĐỘ HÀI LÒNG CỦA KHÁCH HÀNG ĐỐI VỚI DỊCH VỤ CHO VAY TIÊU DÙNG - T...
ĐÁNH GIÁ MỨC ĐỘ HÀI LÒNG CỦA KHÁCH HÀNG ĐỐI VỚI DỊCH VỤ CHO VAY TIÊU DÙNG - T...Dịch vụ viết thuê Luận Văn - ZALO 0932091562
 
Manual usuario ECR SAMPOS ER-059
Manual usuario ECR SAMPOS ER-059Manual usuario ECR SAMPOS ER-059
Manual usuario ECR SAMPOS ER-059PCMIRA - ECR&POS
 
Stair climbing hand truck
Stair climbing hand truckStair climbing hand truck
Stair climbing hand truckShiyas Basheer
 
Szemely es vagyonor-kepzes_szobeli_vizsgakerdesek_
Szemely es vagyonor-kepzes_szobeli_vizsgakerdesek_Szemely es vagyonor-kepzes_szobeli_vizsgakerdesek_
Szemely es vagyonor-kepzes_szobeli_vizsgakerdesek_Baráth József
 
Corporate digital communication july 2020 CIM ASSIGNMENTS
Corporate digital communication july 2020 CIM ASSIGNMENTS Corporate digital communication july 2020 CIM ASSIGNMENTS
Corporate digital communication july 2020 CIM ASSIGNMENTS suren
 
Configuration eon4
Configuration eon4Configuration eon4
Configuration eon4papemignane
 
ANALYSE FINANCI RE DE LA POSTE TUNISIENNE
ANALYSE FINANCI RE DE LA POSTE TUNISIENNEANALYSE FINANCI RE DE LA POSTE TUNISIENNE
ANALYSE FINANCI RE DE LA POSTE TUNISIENNETina Gabel
 
Creating entrepreneurial change CIM ASSIGNMENTS
Creating entrepreneurial change CIM ASSIGNMENTS Creating entrepreneurial change CIM ASSIGNMENTS
Creating entrepreneurial change CIM ASSIGNMENTS suren
 
Luận văn: Hoàn thiện mô hình chấm điểm tín dụng và xếp hạng doanh nghiệp tại ...
Luận văn: Hoàn thiện mô hình chấm điểm tín dụng và xếp hạng doanh nghiệp tại ...Luận văn: Hoàn thiện mô hình chấm điểm tín dụng và xếp hạng doanh nghiệp tại ...
Luận văn: Hoàn thiện mô hình chấm điểm tín dụng và xếp hạng doanh nghiệp tại ...Dịch vụ viết thuê Khóa Luận - ZALO 0932091562
 
Caterpillar cat th514 c telehandler service repair manual
Caterpillar cat th514 c telehandler service repair manualCaterpillar cat th514 c telehandler service repair manual
Caterpillar cat th514 c telehandler service repair manualfjsiefkkskemm
 

Was ist angesagt? (20)

Luận Văn Nâng Cao Hiệu Quả Hoạt Động Cho Vay Doanh Nghiệp Tại Vietinbank
Luận Văn Nâng Cao Hiệu Quả Hoạt Động Cho Vay Doanh Nghiệp Tại VietinbankLuận Văn Nâng Cao Hiệu Quả Hoạt Động Cho Vay Doanh Nghiệp Tại Vietinbank
Luận Văn Nâng Cao Hiệu Quả Hoạt Động Cho Vay Doanh Nghiệp Tại Vietinbank
 
Daikin RXC-B (R32) manual service.pdf
Daikin RXC-B (R32) manual service.pdfDaikin RXC-B (R32) manual service.pdf
Daikin RXC-B (R32) manual service.pdf
 
Case w20 f wheel loader service repair manual
Case w20 f wheel loader service repair manualCase w20 f wheel loader service repair manual
Case w20 f wheel loader service repair manual
 
Human computer interaction
Human computer interactionHuman computer interaction
Human computer interaction
 
NÂNG CAO HIỆU QUẢ CỦA HOẠT ĐỘNG TÍN DỤNG KHÁCH HÀNG DOANH NGHIỆP TẠI NGÂN H...
NÂNG CAO HIỆU QUẢ CỦA HOẠT ĐỘNG  TÍN DỤNG KHÁCH HÀNG DOANH NGHIỆP TẠI  NGÂN H...NÂNG CAO HIỆU QUẢ CỦA HOẠT ĐỘNG  TÍN DỤNG KHÁCH HÀNG DOANH NGHIỆP TẠI  NGÂN H...
NÂNG CAO HIỆU QUẢ CỦA HOẠT ĐỘNG TÍN DỤNG KHÁCH HÀNG DOANH NGHIỆP TẠI NGÂN H...
 
ĐÁNH GIÁ MỨC ĐỘ HÀI LÒNG CỦA KHÁCH HÀNG ĐỐI VỚI DỊCH VỤ CHO VAY TIÊU DÙNG - T...
ĐÁNH GIÁ MỨC ĐỘ HÀI LÒNG CỦA KHÁCH HÀNG ĐỐI VỚI DỊCH VỤ CHO VAY TIÊU DÙNG - T...ĐÁNH GIÁ MỨC ĐỘ HÀI LÒNG CỦA KHÁCH HÀNG ĐỐI VỚI DỊCH VỤ CHO VAY TIÊU DÙNG - T...
ĐÁNH GIÁ MỨC ĐỘ HÀI LÒNG CỦA KHÁCH HÀNG ĐỐI VỚI DỊCH VỤ CHO VAY TIÊU DÙNG - T...
 
Manual usuario ECR SAMPOS ER-059
Manual usuario ECR SAMPOS ER-059Manual usuario ECR SAMPOS ER-059
Manual usuario ECR SAMPOS ER-059
 
Stair climbing hand truck
Stair climbing hand truckStair climbing hand truck
Stair climbing hand truck
 
Đề tài hoạt động thanh toán quốc tế tại hội sở ngân hàng
Đề tài hoạt động thanh toán quốc tế tại hội sở ngân hàngĐề tài hoạt động thanh toán quốc tế tại hội sở ngân hàng
Đề tài hoạt động thanh toán quốc tế tại hội sở ngân hàng
 
Szemely es vagyonor-kepzes_szobeli_vizsgakerdesek_
Szemely es vagyonor-kepzes_szobeli_vizsgakerdesek_Szemely es vagyonor-kepzes_szobeli_vizsgakerdesek_
Szemely es vagyonor-kepzes_szobeli_vizsgakerdesek_
 
Corporate digital communication july 2020 CIM ASSIGNMENTS
Corporate digital communication july 2020 CIM ASSIGNMENTS Corporate digital communication july 2020 CIM ASSIGNMENTS
Corporate digital communication july 2020 CIM ASSIGNMENTS
 
Đề tài: Nâng cao hiệu quả cho vay tiêu dùng tại ngân hàng Agribank
Đề tài: Nâng cao hiệu quả cho vay tiêu dùng tại ngân hàng AgribankĐề tài: Nâng cao hiệu quả cho vay tiêu dùng tại ngân hàng Agribank
Đề tài: Nâng cao hiệu quả cho vay tiêu dùng tại ngân hàng Agribank
 
Khóa Luận Phân Tích Tình Hình Cho Vay Hộ Sản Xuất Tại Agribank
Khóa Luận Phân Tích Tình Hình Cho Vay Hộ Sản Xuất Tại AgribankKhóa Luận Phân Tích Tình Hình Cho Vay Hộ Sản Xuất Tại Agribank
Khóa Luận Phân Tích Tình Hình Cho Vay Hộ Sản Xuất Tại Agribank
 
Configuration eon4
Configuration eon4Configuration eon4
Configuration eon4
 
ANALYSE FINANCI RE DE LA POSTE TUNISIENNE
ANALYSE FINANCI RE DE LA POSTE TUNISIENNEANALYSE FINANCI RE DE LA POSTE TUNISIENNE
ANALYSE FINANCI RE DE LA POSTE TUNISIENNE
 
Đề tài: Giải pháp nâng cao huy động vốn tại Agribank Hải Phòng
Đề tài: Giải pháp nâng cao huy động vốn tại Agribank Hải PhòngĐề tài: Giải pháp nâng cao huy động vốn tại Agribank Hải Phòng
Đề tài: Giải pháp nâng cao huy động vốn tại Agribank Hải Phòng
 
Creating entrepreneurial change CIM ASSIGNMENTS
Creating entrepreneurial change CIM ASSIGNMENTS Creating entrepreneurial change CIM ASSIGNMENTS
Creating entrepreneurial change CIM ASSIGNMENTS
 
Manual de PLC Micrologix 1100
Manual de PLC Micrologix 1100Manual de PLC Micrologix 1100
Manual de PLC Micrologix 1100
 
Luận văn: Hoàn thiện mô hình chấm điểm tín dụng và xếp hạng doanh nghiệp tại ...
Luận văn: Hoàn thiện mô hình chấm điểm tín dụng và xếp hạng doanh nghiệp tại ...Luận văn: Hoàn thiện mô hình chấm điểm tín dụng và xếp hạng doanh nghiệp tại ...
Luận văn: Hoàn thiện mô hình chấm điểm tín dụng và xếp hạng doanh nghiệp tại ...
 
Caterpillar cat th514 c telehandler service repair manual
Caterpillar cat th514 c telehandler service repair manualCaterpillar cat th514 c telehandler service repair manual
Caterpillar cat th514 c telehandler service repair manual
 

Ähnlich wie Optimization of an Energy-Generating Turnstile

How to manage future grid dynamics: system value of Smart Power Generation in...
How to manage future grid dynamics: system value of Smart Power Generation in...How to manage future grid dynamics: system value of Smart Power Generation in...
How to manage future grid dynamics: system value of Smart Power Generation in...Smart Power Generation
 
Fusegrade_FinalReport
Fusegrade_FinalReportFusegrade_FinalReport
Fusegrade_FinalReportDylan Moore
 
Final Design Report
Final Design ReportFinal Design Report
Final Design ReportJason Ro
 
Paul Ebbs (2011) - Can lean construction improve the irish construction industry
Paul Ebbs (2011) - Can lean construction improve the irish construction industryPaul Ebbs (2011) - Can lean construction improve the irish construction industry
Paul Ebbs (2011) - Can lean construction improve the irish construction industryPaul Ebbs
 
Grid connected pv power system
Grid connected pv power systemGrid connected pv power system
Grid connected pv power systemZelalem Girma
 
Utility-Scale Solar Photovoltaic Power Plants - A Project Developer’s Guide
Utility-Scale Solar Photovoltaic Power Plants - A Project Developer’s GuideUtility-Scale Solar Photovoltaic Power Plants - A Project Developer’s Guide
Utility-Scale Solar Photovoltaic Power Plants - A Project Developer’s GuidePrivate Consultants
 
WHAT CONSTITUTES AN AGILE ORGANIZATION? ? DESCRIPTIVE RESULTS OF AN EMPIRICAL...
WHAT CONSTITUTES AN AGILE ORGANIZATION? ? DESCRIPTIVE RESULTS OF AN EMPIRICAL...WHAT CONSTITUTES AN AGILE ORGANIZATION? ? DESCRIPTIVE RESULTS OF AN EMPIRICAL...
WHAT CONSTITUTES AN AGILE ORGANIZATION? ? DESCRIPTIVE RESULTS OF AN EMPIRICAL...iasaglobal
 
Solar Energy - A Complete Guide
Solar Energy - A Complete GuideSolar Energy - A Complete Guide
Solar Energy - A Complete GuideNaman Pratap Singh
 
Ifc+solar+report web+ 08+05
Ifc+solar+report web+ 08+05Ifc+solar+report web+ 08+05
Ifc+solar+report web+ 08+05Mohammed Selim
 
Gbr Version 060209 Addendum
Gbr Version 060209 AddendumGbr Version 060209 Addendum
Gbr Version 060209 Addendummatthromatka
 
Smith randall 15-rolling-element-bearing-diagnostics-cwu
Smith randall 15-rolling-element-bearing-diagnostics-cwuSmith randall 15-rolling-element-bearing-diagnostics-cwu
Smith randall 15-rolling-element-bearing-diagnostics-cwuProto Gonzales Rique
 
Protective Device Coordination
Protective Device CoordinationProtective Device Coordination
Protective Device Coordinationjoeengi
 
ES410 Report
ES410 ReportES410 Report
ES410 ReportMatt Dent
 
Cowell-measuring-inequality (1).pdf
Cowell-measuring-inequality (1).pdfCowell-measuring-inequality (1).pdf
Cowell-measuring-inequality (1).pdfsuranjanaarchive
 
BizTalk Practical Course Preview
BizTalk Practical Course PreviewBizTalk Practical Course Preview
BizTalk Practical Course PreviewMoustafaRefaat
 
Nine speed transmission design
Nine speed transmission designNine speed transmission design
Nine speed transmission designCarlos J Gutierrez
 

Ähnlich wie Optimization of an Energy-Generating Turnstile (20)

How to manage future grid dynamics: system value of Smart Power Generation in...
How to manage future grid dynamics: system value of Smart Power Generation in...How to manage future grid dynamics: system value of Smart Power Generation in...
How to manage future grid dynamics: system value of Smart Power Generation in...
 
Design Final Report
Design Final ReportDesign Final Report
Design Final Report
 
Fusegrade_FinalReport
Fusegrade_FinalReportFusegrade_FinalReport
Fusegrade_FinalReport
 
Final Design Report
Final Design ReportFinal Design Report
Final Design Report
 
Paul Ebbs (2011) - Can lean construction improve the irish construction industry
Paul Ebbs (2011) - Can lean construction improve the irish construction industryPaul Ebbs (2011) - Can lean construction improve the irish construction industry
Paul Ebbs (2011) - Can lean construction improve the irish construction industry
 
Grid connected pv power system
Grid connected pv power systemGrid connected pv power system
Grid connected pv power system
 
Utility-Scale Solar Photovoltaic Power Plants - A Project Developer’s Guide
Utility-Scale Solar Photovoltaic Power Plants - A Project Developer’s GuideUtility-Scale Solar Photovoltaic Power Plants - A Project Developer’s Guide
Utility-Scale Solar Photovoltaic Power Plants - A Project Developer’s Guide
 
WHAT CONSTITUTES AN AGILE ORGANIZATION? ? DESCRIPTIVE RESULTS OF AN EMPIRICAL...
WHAT CONSTITUTES AN AGILE ORGANIZATION? ? DESCRIPTIVE RESULTS OF AN EMPIRICAL...WHAT CONSTITUTES AN AGILE ORGANIZATION? ? DESCRIPTIVE RESULTS OF AN EMPIRICAL...
WHAT CONSTITUTES AN AGILE ORGANIZATION? ? DESCRIPTIVE RESULTS OF AN EMPIRICAL...
 
Solar Energy - A Complete Guide
Solar Energy - A Complete GuideSolar Energy - A Complete Guide
Solar Energy - A Complete Guide
 
Ifc+solar+report web+ 08+05
Ifc+solar+report web+ 08+05Ifc+solar+report web+ 08+05
Ifc+solar+report web+ 08+05
 
Tesi_Gasparetto_Walter
Tesi_Gasparetto_WalterTesi_Gasparetto_Walter
Tesi_Gasparetto_Walter
 
Gbr Version 060209 Addendum
Gbr Version 060209 AddendumGbr Version 060209 Addendum
Gbr Version 060209 Addendum
 
Tommy Marker
Tommy MarkerTommy Marker
Tommy Marker
 
Smith randall 15-rolling-element-bearing-diagnostics-cwu
Smith randall 15-rolling-element-bearing-diagnostics-cwuSmith randall 15-rolling-element-bearing-diagnostics-cwu
Smith randall 15-rolling-element-bearing-diagnostics-cwu
 
Protective Device Coordination
Protective Device CoordinationProtective Device Coordination
Protective Device Coordination
 
ES410 Report
ES410 ReportES410 Report
ES410 Report
 
Project Report
Project ReportProject Report
Project Report
 
Cowell-measuring-inequality (1).pdf
Cowell-measuring-inequality (1).pdfCowell-measuring-inequality (1).pdf
Cowell-measuring-inequality (1).pdf
 
BizTalk Practical Course Preview
BizTalk Practical Course PreviewBizTalk Practical Course Preview
BizTalk Practical Course Preview
 
Nine speed transmission design
Nine speed transmission designNine speed transmission design
Nine speed transmission design
 

Optimization of an Energy-Generating Turnstile

  • 1. M6103Q: Optimization in Engineering Design December 19, 2012 Final Report Turnstile Generator: Maximize Energy Output Wayne Justin Smith Jr.
  • 2. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 1 Table of Contents i. List of Figures....................................................................................................................2 ii. List of Tables......................................................................................................................3 1. Introduction.......................................................................................................................4 2. Previous Work ..................................................................................................................6 3. Problem Definition....................................................................................................... 11 3.1. Variables............................................................................................................................... 12 3.1.1. Active Variables......................................................................................................................12 3.1.2. Inactive Variables...................................................................................................................12 3.2. Objective Functions.......................................................................................................... 13 3.3. Constraints........................................................................................................................... 14 3.4. Analyzing the Equations ................................................................................................. 15 3.4.1. Explanation of Equations....................................................................................................15 3.4.2. Equations Breakdown..........................................................................................................18 3.5. The Compromise Decision Support Problem (DSP) ............................................. 18 4. Applied Methods ........................................................................................................... 20 4.1. Archimedean Weighting Scheme (Exhaustive Search)........................................ 20 4.1.1. Method Setup...........................................................................................................................20 4.1.2. Results ........................................................................................................................................22 4.2. Penalty & Barrier .............................................................................................................. 27 4.2.1. Method Setup...........................................................................................................................27 4.2.2. Results ........................................................................................................................................27 4.3. Fmincon ................................................................................................................................ 30 4.3.1. Method Setup...........................................................................................................................30 4.3.2. Results ........................................................................................................................................31 5. Comparison of Methods.............................................................................................. 33 5.1. Quality................................................................................................................................... 35 5.2. Speed...................................................................................................................................... 35 5.3. Ease of Use ........................................................................................................................... 35 5.4. Robustness........................................................................................................................... 36 6. Conclusion ....................................................................................................................... 36 7. Future Work.................................................................................................................... 37 8. Appendix A ...................................................................................................................... 39 8.1. Definition of Variables..................................................................................................... 39 8.2. Matlab Code......................................................................................................................... 39 8.2.1. Archimedean Weighting Scheme (Exhaustive Search) ..........................................39 8.2.2. Penalty & Barrier Method...................................................................................................41 8.2.3. fmincon.......................................................................................................................................45 9. Works Cited..................................................................................................................... 47
  • 3. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 2 i. List of Figures Figure 1: Original Design Diagram of Turnstile Design ...........................................................5 Figure 2: Final 3D Diagram of Turnstile ........................................................................................6 Figure 3: Constructed Turnstile Prototype...................................................................................8 Figure 4: Gearbox with Hubless Spur Gears.................................................................................9 Figure 5: Typical Distance Traveled per Turnstile Arm .......................................................11 Figure 6: Relationship Between No. of Teeth & Cost .............................................................17 Figure 7: Hierarchal Breakdown of Objective Function Equations..................................18 Figure 8: Gear Ratio vs. Power Output ........................................................................................21 Figure 9: Exhaustive Search Sample Output (Scenario 3) ...................................................22 Figure 10: Archimedean Weighted Output of Scenario 3 with T=0.5..............................23 Figure 11: Archimedean Weighted Output of Scenario 3 with T=3 .................................24 Figure 12: Archimedean Weighted Contour Plot (Scenario 1) ..........................................24 Figure 13: Archimedean Weighted Output Mesh Plot (Scenario 1).................................25 Figure 14: Archimedean Weighted Contour Plot (Scenario 3) ..........................................26 Figure 15: Archimedean Weighted Example Mesh Plot (Scenario 3) .............................26 Figure 16: Penalty & Barrier Method Contour Plot Converged for Run2 ......................29 Figure 17: Penalty & Barrier Method Contour Plot Converged for Run5 ......................29 Figure 18: Penalty & Barrier Method Example Mesh Plot...................................................30 Figure 19: Fmincon Contour Plot Converged for Run1.........................................................32 Figure 20: Fmincon Example Mesh Plot .....................................................................................32 Figure 21: Fmincon Contour Plot Converged for Run10......................................................33
  • 4. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 3 ii. List of Tables Table 1: Typical Pull-Force Values for Turnstile Arms .........................................................10 Table 2: Average Work Generated per Person.........................................................................11 Table 3: Archimedean Weighted Scheme Run Results..........................................................22 Table 4: Penalty & Barrier Run Results.......................................................................................28 Table 5: Fmincon Run Results ........................................................................................................31 Table 6: Summary of Archimedean Weighted Exhaustive Search Results....................34 Table 7: Combined Results of Penalty & Barrier Method and Fmincon.........................34
  • 5. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 4 1. Introduction As the amount of natural resources decline and the environmental protection movement grows in popularity, the search for renewable energy is becoming increasingly more important. Throughout our society, many common and mundane daily activities present opportunities for us to capture and convert seemingly valueless and unmemorable activities into a prolific energy conservation program. Capturing and converting just a minute portion of human energy in large enough amounts could generate a measurable increase of supplemental power to augment our extensive electrical grid. During everyday life, there are many such tasks that are performed without thinking about the wasted energy that could possibly be recovered and stored for future use. In fact, while working in my undergraduate senior design class, my group developed an idea for a turnstile generator, which is simply a turnstile that has been fitted to power a small generator and capture the energy transmitted from the users pushing the turnstile arms. The idea was created by focusing on energy regeneration through harvesting wasted energy from everyday actions. To the best of our knowledge, the design was the first of its kind, with the only similar idea coming from Shibuya, Japan, where modified floor tiles in a train station are used to create and store electricity. The turnstile design generates electricity by using the force applied to the turnstile arms, geared-up for increased angular velocity, to spin the motor shaft on a DC motor, and store the created electricity in a battery. There are several available markets for which this product could be retro-fitted to include: arenas, stadiums, transit stations, amusement parks, or any high traffic area where a large amount of wasted human energy could be captured. In addition, each place mentioned uses a large amount of electricity and could use the power generated by the turnstiles to help reduce their overall electrical costs. Even though this project is a viable and achievable goal, problems arose during prototype construction that did not allow us to demonstrate a functional final product. When machining one of the gear shafts, some of the teeth on one of the smaller gears were destroyed, thus altering the desired total gear reduction ratio of 21.53 to 1. Our group had to quickly improvise a workaround for the broken gear which reduced the gear ratio to 4.64 to 1, which drastically reduced the maximum amount of power produced by the turnstile. Before construction of the prototype, a preliminary design of the turnstile was created using modeling software, which is shown below in Figure 1. Note that there are not any supports shown for the gear box, motor and batteries, and consequently, that lack of design specificity became problematic during prototype construction.
  • 6. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 5 Figure 1: Original Design Diagram of Turnstile Design As seen in Figure 1 above, the torque created by the user is transferred by the universal joint to the shaft containing the drive gear. At that point, the gear reduction takes place, with the pinion connected to the motor shaft of the DC motor. The electrical leads from the motor are then connected to a rechargeable battery, which was the original idea for storing the energy. As seen in the figure above, there were three sets of gears used to increase the angular velocity input to the motor shaft by a significant amount. As with most initial designs, however, the final product deviated from the original plan to remediate unexpected problems encountered during production and compensate for unforeseen manufacturing constraints. The final design of the prototype is shown below in Figure 2. A couple changes from the original design are the number of gears used to increase the angular velocity and the method of storing the energy. Due to unforeseen construction complications, the output power was reduced to approximately 1/5 of the anticipated power, and therefore, displaying a working prototype became much more complex. One adjustment made was incorporating a 1.5V DC motor to show that the turnstile actually did generate power.
  • 7. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 6 Figure 2: Final 3D Diagram of Turnstile Since the prototype was demonstrated in front of a panel of professors, it was decided that the best way to exhibit the functionality of the product was to connect a second motor in series with the first, then attach strings to the second motor shaft to prove that the turnstile was generating energy. The design augmentation worked as expected and the second motor shaft spun each time someone walked through the turnstile thus generating an electrical current from the original DC motor. I believe the idea for a turnstile generator is feasible and practical, and prematurely abandoned because it seemed that the power output form the prototype was not worth recovering. This optimization project is focused on redeeming the turnstile generator idea by identifying the optimal power output while taking into consideration the manufacturing cost constraints. 2. Previous Work As mentioned in Section 1, to the best of my knowledge, there are no products that are currently on the market with which this product competes. During the initial design, there was not much previous work on the optimization of the power output and thus all the work completed in this report is original. The only valuable work taken from the original project was the effort performed during the initial construction of the prototype in 2009. The main purpose of the original project however, was not to optimize the power output by prototype, but to create an original and marketable product that could compete in the current marketplace and be manufactured at a profit. With the only goal of constructing a
  • 8. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 7 working prototype, many assumptions made in the original design calculations are now optimized for higher power output and greater market feasibility in this analysis. Unfortunately, the market for regenerative power systems is still small. It is currently in more of the prototype phase than full-scale deployment, which makes evaluating our idea against the competitors difficult due to the lack of competition. There are however, a few similar ideas that harvest energy from pedestrian traffic. The most notable example is being tested in Shibuya train station in Japan, where they have installed floor tiles that turn the weight of pedestrian traffic into usable electricity for powering lighting or the ticket machines. Although the tiles only generate about 0.1 watts per step there are over 2.4 million people who pass through the Shibuya station each weekday. Given the enormous amount of foot traffic through the station each day, the aggregate amount of electricity available for harvesting then becomes worth recovering. In evaluating the performance of a turnstile based energy recovery system, I would have to compare energy generated per step at the Shibuya train station with the energy generated by one person passing through a turnstile. There is also a system being studied that would generate electricity from the footsteps of pedestrians walking down stairs. The system is being considered for the Spinnaker Tower viewing platform in Portsmouth, United Kingdom. The idea here is that there could be considerable energy available from people descending the stairs of the tower that would otherwise be wasted in the compressive action of the human body working to absorb the impact of the heel striking the step below. Unfortunately there are no power output figures for this system that could be compared to the turnstile idea. As discussed in the introduction, a full-scale prototype was built to measure actual data for power output, which in turn reveals the actual feasibility of this product on the market. A photograph of the final constructed turnstile is shown in Figure 3.
  • 9. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 8 Figure 3: Constructed Turnstile Prototype This is a front view of the turnstile, which displays the turnstile arms and body. For a better view of the gearbox, Figure 4 on the next page shows the two sets of gears that lead to the motor shaft. As seen in the picture, the construction was rudimentary, which led to increased friction and rotating shafts that were off- balance. This created a poor mesh between the spur gears, which ultimately led to increased stress on the gear teeth.
  • 10. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 9 Figure 4: Gearbox with Hubless Spur Gears To compare the amount of force allowable by the prototype, actual force measurements were taken by a turnstile at the University of Maryland’s Comcast Center. Since these turnstiles are used to enter sporting events, it was decided that these readings would be the basis from which our prototype’s calculations would be based. When measuring the force used to turn the turnstile, a force meter was used to take 25 measurements at approximately 0.30 meters from the base of the turnstile arm, which are shown below in Table 1.
  • 11. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 10 Table 1: Typical Pull-Force Values for Turnstile Arms In the original calculations, it was decided that the maximum tangential force used on the arm of the turnstile is 50N because it was assumed that a 10% increase could be applied to the force needed to push the turnstile arms. In this report, the same assumption will be made for the maximum force so that the arms do not become too difficult to turn. Using the 0.30 meter distance from the base of the turnstile arm to the point where the moment is applied, and an assumed profile angle of 45° between the turnstile arms, it can be calculated that the effective radius of the centripetal motion of the turnstile arms is 0.212 m. Using this, the linear distance traveled 1/3 around the circular revolution of each arm is: ( ) ( ) ( ) A pictorial representation of the 1/3 turn of the turnstile (which simulates a single person passing through) is shown below in Figure 5. 36.69 49.38 46.87 47.72 33.66 41.21 47.39 48.11 36.81 40.88 50.83 41.07 51.55 53.51 51.73 53.88 41.12 52.99 36.13 44.01 45.77 34.31 48.77 41.88 52.59 Avg Std Dev Force (N) 45.15 6.41
  • 12. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 11 Figure 5: Typical Distance Traveled per Turnstile Arm To calculate the work performed by one person passing through the turnstile, simply multiply the force by the distance, which yields: ∫ ̅ ( ) ( ) These calculations were performed in the previous class and a summary is shown below in Table 2. Table 2: Average Work Generated per Person From this, the average work per person was used to calculate the amount of energy created per year by each train station. This was, in turn, used in the cost analysis of the product to determine the economic viability of the turnstile generator idea. One downside, however, is that the output power was never optimized in conjunction with keeping the product economically viable. Through the path that was previously taken, the optimal variable values were used to calculate the amount of power that should be expected, but it was determined that the cost-benefit analysis showed that the amount of energy recovered was not worth retrofitting turnstiles with the designed product. 3. Problem Definition Before beginning any work on the optimization problem, it is important to clearly and precisely define the problem at hand. This section focuses on the problem Linear Distance per 120° Rotation (m) Avg Work per Person (J) 0.444 20.060 0.4443m
  • 13. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 12 definition, equation breakdown and the compromise decision support problem (DSP). With a clearer idea of the problem that needs solved, constructing the algorithms and finding the correct solutions becomes much easier. 3.1.Variables To properly evaluate the equations, it is important to take a close look at the variables used in the objective functions. There were also several other variables that had assumed values in this optimization to ensure that the problem didn’t become too complicated with too many variables and objective functions. 3.1.1. Active Variables As seen in the objective functions, there are four variables that are used to optimize this problem: gear reduction ratio, number of gears used, and the amount of time it takes to for one person to push through the turnstile. These active variables allow the problem to explore the design space thoroughly, while keeping the control on the problem not too confusing. The active variables are as follows: ( ) ( ) These variables were chosen for the optimization of the problem because the design of this device is largely dependent on the gear ratio, which determines how fast the motor shaft spins and thus, how much energy is created. The variable T was chosen to be an active variable because it is an uncontrolled variable imparting a large effect on the output which is desired to see how much effect that has on the optimization of the device. 3.1.2. Inactive Variables As previously mentioned, there were other variables that were not included in the calculations of this optimization problem. Due to the overall complexity of the problem, assumptions were made with respect to some of the variables. These assumptions limited the complexity of the problem allowing for future work on the optimization of the project to achieve an even more realistic representation of the problem. The inactive variables are as follows: ( ) ( )
  • 14. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 13 The force applied to the turnstile arm was set as a constant rather than a variable because a relationship exists between the force applied and the amount of time it takes to rotate around the axis, which is already an active variable. Rather, a constant force of 50N was used in the calculations, which matches the measurements and assumptions made during the construction of the prototype. In conjunction with this assumption, the turnstile arm length was also set as the constant of 0.30m to match the work previously performed. The turnstile arm length also has a predictable effect on the power output and was thus excluded from this study. The material used for the gears was not considered in the scope of this report because changing the material would change two other variables- the amount of stress that the gear teeth can handle and the cost of the gears. Since a continuous cost relationship could not be developed between the material and the cost, a discrete search method would need to be implemented to find the optimal solution. Also, the stresses on the gear teeth are not considered in this report due to the complexity that it introduces. Rather, that will be considered during the future work and is discussed in Section 7. Another item not researched in the scope of this study is the possibility of adding a flywheel to the motor shaft, which is also further discussed in Section 7. 3.2.Objective Functions In order to define the problem, the first step is to determine what objectives are to be met. In this problem, the primary purpose of the optimization is to increase the energy output of the DC motor attached to the pinion at the end of the gear reduction. Additional objective functions are added to retain the feasibility and functionality of the final product. The objective functions for the problem are provided below. Note that the definitions of the variables are found in Appendix A in Section 8.1. Maximize: ( ) ( ) ( ( ) ) ( ( ) ( )) The first objective function listed above is the one that maximizes the power output of the DC motor. To find this function, the power output equation was found in terms of rotational velocity, and then the rotational velocity was found in terms of the number of gear teeth for the large gear and small gear. The breakdown of equations is shown later in Section 3.4.2. Minimize: ( ) ( ) The second objective function, shown above, is the total height of the gears, which helps determine the total size of the device. In order to retrofit this device into existing turnstiles, it is important that the size be kept as small as possible to ensure that there is enough room to fit the device.
  • 15. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 14 Minimize: (( ) ( ) The third and final objective function is the cost of the device. Cleary, this equation does not incorporate the entire cost of the entire device, but it includes the major components that change with the optimization. For instance, the shafts and gearbox are not accounted for in this equation, but these are insignificant in comparison to the motor and gear costs. To find the equation for cost, it had to be found in terms of a common variable with the other equations. A relationship was found between the number of gear teeth and the cost of the gear, which was substituted into the cost equation to be optimized with the other objective functions. More discussion on this model formulation is discussed in Section 3.4.1. 3.3.Constraints The energy capture device presented in this report must follow certain constraints for the concept to be realistic and accepted, including: the size of the device, the number of gears, and the amount of time it takes for the user to push through the turnstile. A defining characteristic of a constraint is that it must be followed for a concept to be adequate, and in the event the constraint is adhered to, the value of the product does not increase. An important design characteristic for this product is its size. The energy regeneration device must fit inside a turnstile to be able to capture the energy exerted by the person passing through. If the device is too large, the size of the turnstile must increase and might not be able to retroactively fit into the space allotted for it by the venue or station. The inner workings of the device must be durable and able to withstand intermittent stresses because in reality, a constant force is not applied. The turnstile does not necessarily need to be highly resistant to corrosion because it will be housed in a protective casing. The constraints in this problem are used to set bounds for the variables. The constraints for the problem are given below. Gear Sizes: Number of Gears: Time to push through turnstile: The way that the constraints were chosen for the number of gear teeth is that typically spur gears were researched for cost and number of teeth available. This
  • 16. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 15 helps determine the possible gear ratios available. From the provider researched, it was found that the maximum number of teeth on each gear was 120, where 20 was the smallest. (Steel, Hubless Spur Gears) This set the bounds on the number of teeth for each gear. It is also obvious that it is desired for the larger gear to have a larger diameter than the smaller gear, otherwise the angular velocity of the motor shaft would be less than that of the turnstile arms. To determine the constraints on the number of gears, a lower limit of zero and an upper limit of ten were found to create a realistic and sufficiently encompassing design space. To allow the optimization algorithms to find the absolute minimum, all realistic and possible combinations must be explored, thus a scenario without gear reductions and a scenario with 10 gear reductions is tested. The amount of time it takes for someone to push through a turnstile varies with age, handicap, and schedule of the user. It was determined that setting the limits between 0.5 and 3 seconds is a realistic range that encompasses situations from a child or handicapped person, all the way to a healthy adult rushing through the turnstile. 3.4.Analyzing the Equations This section contains a breakdown of the equations used in the calculations for this problem, to include the assumed variables and constants. Through this breakdown structure, it is possible to see the relationships between the various equations for the objective functions and constraints, along with the overlap of variables and constants within those equations. Breaking down the equations to the basic elements allows the analysis of the relationships between each of the equations, which helps later explain any trends or effects that the constraints play on the objective functions or that the objective functions play on each other. 3.4.1. Explanation of Equations All of the equations used to create the objective functions are provided in this section. Each equation will be discussed as it was presented in Section 3.2. As previously mentioned, the definition of the variables and constants are provided in Appendix A, Section 8.1. To help aid in the visualization of the equation breakdown, a hierarchy of the equations is displayed in Section 3.4.2. Below, the original power output equation is presented, with the power shown as a function of the angular velocity of the motor shaft. ( ) ( ) This shows that the power output of the motor is a quadratic function, only dependent on the variable ω, which is the angular velocity of the motor shaft. The other symbols in this equation are constants that are dependent on the motor. Again, the motor was chosen to handle the amount of power that the turnstile generator can possibly output, so those constants are pre-defined. For this specific
  • 17. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 16 problem, a 1.5V-6V DC motor was selected to handle the power output from the device, which has a stall torque of τs=2*10-3 N-m and a no-load angular velocity of ωn=200π rad/sec. (Product Data Sheet, 2012) Also, the cost of the motor is approximately $2.00. The problem with this equation is that the angular velocity needs to be broken into the variables so that the objective functions can be optimized. The angular velocity of the motor shaft is a function of the gear ratio multiplied by the angular velocity of the turnstile arm, as shown in the equation below. Note that in the equation below, the variable n represents the number of times the angular velocity is increased by the introduction of a small and large gear combination. The gear ratio, α, is dependent on the ratio of the diameters (or number of teeth) between the gears. That ratio is defined by the equation below, where dl and ds are the diameter of the large and small gears, respectively. Similarly, the variables tl and ts are the number of teeth of the large and small gears, respectively. The angular velocity of the turnstile arms can also be broken into active variables that were defined in Section 3.1.1. The breakdown of the turnstile arm angular velocity is shown below. This equation is derived from the basic formula for angular velocity, ω=θ/dt. Since it is known that the turnstile arm will travel 120°, or 2π/3 radians, the angular velocity equation is updated to provide the following: Since all of the equations are now broken-down to the basic active variables, the equations are substituted back into the original power output function to find the final objective function, which was previously shown in Section 3.2. The second objective function, which minimizes the height of the device, is shown next. ( ) ( ) The height of the device was found in terms of the diameter, but a relationship between the diameter of the gears and the number of teeth was discovered- the pitch diameter (in millimeters) and number of teeth are equal for each gear. Due to this linear relationship, the number of teeth was substituted for the diameter size of the gears, which provided the objective function for the size of the gear box in terms of active variables.
  • 18. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 17 ( ) ( ) As with the first objective function, the height is now suitable to be optimized in a solver algorithm because it is in a form with the only variables as active variables. The cost objective function began with the equation shown below. Since the cost of the motor, CM, is a constant for this problem, it cannot be broken into smaller variables. The cost of the gears, however, can be broken down by the number of gears in the gearbox. This equation is shown below. ( ) The next step is to find the relationship between the cost of the gears and the number of teeth in each. To do this, a list of 19 different gears was plotted with the number of teeth against the cost of each gear. A polynomial "best fit" line was created for the plot and is shown below in Figure 6 to yield a continuous relationship function between the cost of the gears and the number of teeth. Figure 6: Relationship Between No. of Teeth & Cost The relationship of the gear cost and number of teeth is given below for the large and small gears, respectively. To find the objective function, these equations are substituted back into the original equations and the objective function is written in terms of the active variables. y = 0.0017x2 + 0.1472x + 3.1014 0 5 10 15 20 25 30 35 40 45 50 0 20 40 60 80 100 120 140 Cost($) Number of Teeth Number of Teeth vs. Cost
  • 19. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 18 3.4.2. Equations Breakdown Below, the objective function equations are broken-down in a graphical and hierarchal fashion, which were explained previously in Section 3.4.1. In this structure, any variable that is not assigned a constant value is defined in the next level with its corresponding equation. Figure 7: Hierarchal Breakdown of Objective Function Equations As seen in Figure 7 above, the equation breakdown structure begins with the objective functions, then works its way down to define the non-constants in the equations. This is merely a visual of the same breakdown in the previous section. 3.5.The Compromise Decision Support Problem (DSP) Given: The relevant information for the system: F: User input force on turnstile arm- user defined : Stall torque- user input : No-load angular velocity- user input w1, w2, w3: Goals weights- user input
  • 20. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 19 Find: System Variables: To determine the gear ratio and geometry of the device, t1, t2, n and T Deviation Variables: d1+ represents the overachievement in the large gear teeth count d1- represents the underachievement in the large gear teeth count d2+ represents the overachievement of the small gear teeth count d2- represents the underachievement of the small gear teeth count d3+ represents the overachievement of the number of gears d3- represents the underachievement of the number of gears d4+ represents the overachievement of the time through turnstile d4- represents the underachievement of the time through turnstile Satisfy: Geometry constraints: 1. ts-tl≤0 Bounds 1. 20 ≤ t1 ≤ 120 2. 20 ≤ t2 ≤ 120 3. 0 ≤ n ≤ 10 4. 0.5 ≤ T ≤ 3 [seconds] Minimize: Deviation function [Z(x)]: Case A: Archimedean Form Z(x) = w1*d1- + w2*d2- + w3*d3- Where wi = 1; 0 ≤ wi Case B: Preemptive Form (lexicographic) Z(x) = [Z1, Z2, Z3]
  • 21. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 20 WhereZ1 = d1- Z2 = d2- Z3 = d3- 4. Applied Methods In order to verify the solution of the problem, various search algorithms are implemented and compared in this section. The methods that are utilized are the exhaustive search, Newton Method, and Penalty & Barrier method. The application and results of each implemented method are shown below. 4.1.Archimedean Weighting Scheme (Exhaustive Search) The advantages of using an exhaustive search are that the calculations are quite simple and there is not much room for the algorithm to converge on a local minimum. The bounds of the search dictate the design space and also the search criteria for an exhaustive search, which makes it useful when attempting to obtain an initial idea of what a function looks like as the variables are changed. Also, changing the weight on an Archimedean Search will help illustrate the influence that the objective functions have on the optimal point. By changing the weight of one objective function to eclipse the effects that the other objective functions have, the trade-offs between the different functions can clearly be seen. 4.1.1. Method Setup To begin this search algorithm, a closer look at the functions and their behaviors were studied. By studying the functions before running the search algorithms, trends in the results can be expected and verified to ensure the programs are running as desired. To start, the relationship between the gear ratio and power output was plotted, which can be seen in Figure 8 below. The plot shows that as the gear ratio (tl/ts) is increased, the output power also steadily increases. Also seen in the graph is the difference in n values, which represents the number of gear reductions in the device. It can also be seen that as the number of gear reductions increase, the power output rises.
  • 22. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 21 Figure 8: Gear Ratio vs. Power Output It may seem obvious that the model responds in this way, but the difficulty lies in modeling the cost and height in conjunction with the power output. Since the cost restricts the number of gear reductions and the gear ratio, simulations must be run in the Archimedean Weighting search algorithm to see how the objective functions interfere with one another. For the sake of limiting the variables within this problem, the value of T was set to 0.5 seconds to simulate the fastest time a person can push through the turnstile. After testing various values of T, however, it was found that changing this variable did not make a large difference in finding the optimal solution. A more detailed discussion on this is given in Section 4.1.2. The Archimedean Weighting search algorithm created for the mousetrap homework assignment was altered to search the objective functions in this problem. The code for this algorithm is given in Section 8.2.1. As seen in the code, the objective functions were searched in an exhaustive search method with the bounds of the problems used as the upper and lower limits for the variables. With this method, an n x m x p matrix is then created of all the points tested in the objective functions and the minimum point is found. The algorithm reports this point as the optimal point and displays the coordinates, along with the values for the objective functions at that point. A graph of the objective functions with the optimal point is output for the user to graphically verify that the found point is indeed the optimized solution. 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0 1 2 3 4 5 6 7 PowerOutput(W) Gear Ratio (tl/ts) Gear Ratio vs. Power Output n=1 n=2 n=3 n=4 n=5 n=6 n=7 n=8 n=9 n=10
  • 23. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 22 4.1.2. Results After re-writing the algorithm to incorporate the function in this problem, several scenarios were run using various weights for the problem. A sample output from Matlab is shown below in Figure 9. Figure 9: Exhaustive Search Sample Output (Scenario 3) The figure above shows the optimized solution for one of the scenarios run using the Archimedean Weighted search algorithm. A full list of the scenarios run using the algorithm is given below in Table 3. Table 3: Archimedean Weighted Scheme Run Results The chart above has the inputs as weights and outputs as the optimized values, which were then plugged into the objective function equations to calculate those values. As seen in the table, the change in weights does not severely change the outcome of the optimization. The reason for this is due to the units of each optimized variable. w1 w2 w3 tl ts n 1 1 1 1 20 20 1 0.0083217 40 15.45 2 0.00002 0.49999 0.49999 20 20 1 0.0083217 40 15.45 3 0.99998 0.00001 0.00001 120 20 10 0.3015929 770 521.71 4 0.00001 0.99998 0.00001 20 20 1 0.0083217 40 15.45 5 0.0001 0.0001 0.9998 20 20 1 0.0083217 40 15.45 6 0.8 0.1 0.1 20 20 1 0.0083217 40 15.45 7 0.9 0.1 0.1 20 20 1 0.0083217 40 15.45 8 0.99 0.005 0.005 20 20 1 0.0083217 40 15.45 9 0.999 0.0005 0.0005 20 20 1 0.0083217 40 15.45 10 0.9995 0.00025 0.00025 85 20 7 0.1998018 420 244.35 11 0.9998 0.0001 0.0001 111 20 10 0.2929221 720.5 473.12 12 0.9999 0.00005 0.00005 120 20 10 0.3015929 770 521.71 Cost ($)Scenario Weights Optimized Values Power (W) Height (mm)
  • 24. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 23 Note that the magnitude of the height is in millimeters and the cost is in dollars, both of which have values of two significant digits in front of the decimal. The power output, however, is in watts and is four to five decimals smaller than the other two objective function outputs. Since the Archimedean Weighted search algorithm does not take units into account when comparing unlike units, this causes the weight of the power output to need a much higher value than the other two to have a significant effect on the weighted equation. This is seen in scenarios 10 through 12, where a weight of 0.9995 was needed for w1 to make the power output objective function outweigh the importance of the other two objective functions. To compensate for this, the units of the power output can be changed to mW, which would allow all three outputs to have the same order of magnitude for the number comparisons. As previously mentioned, T was set to a constant value to avoid exceeding the allowable dimensions for a matrix within Matlab. Since T is only a variable of the power output objective function, it makes sense to study the effect T has on the output while weighing the first objective function heavily within the Archimedean weighting scheme. To test the effect, Scenario 3 from Table 3 was used and the output results were compared. To test the extremes of the T values, two simulations of Scenario 3 were run and compared. Figure 10 below shows the output of Scenario 3 with a T value of T=0.5. Figure 10: Archimedean Weighted Output of Scenario 3 with T=0.5 For comparison, the same simulation was run after the T value was changed to T=3. The output results from that simulation are given below in Figure 11.
  • 25. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 24 Figure 11: Archimedean Weighted Output of Scenario 3 with T=3 As seen in the two figures above, the output results are almost identical, with only the minimum value of the Archimedean Weighted function differing slightly. Since the variation in the results is not profound and the algorithm converges on the same solution even though a heavy weight was given to the power output objective function, it was determined that allowing T to be a constant value of T=0.5 would not make a significant difference in the outcome of the scenario simulations. In order to graphically verify the accuracy of the results, plots of the output weighted function are needed. Below in Figure 12 is a contour plot of Scenario 1, which has the same output as most of the other scenarios. Figure 12: Archimedean Weighted Contour Plot (Scenario 1) As seen in the plot above, the optimal point is plotted on top of the objective function contour lines. Also seen in the plot, the contour lines have smaller values as
  • 26. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 25 the number of teeth on each gear decrease. To help with the visualization, a mesh plot of Scenario 1 is given below in Figure 13. As seen in the mesh plot, the objective function decreases as the number of gear teeth decrease. This correlates as expected because the power output objective function is overwhelmed by the cost and height objective functions. Figure 13: Archimedean Weighted Output Mesh Plot (Scenario 1) As mentioned earlier, one of two options can be employed to allow the power output objective function to be the same order of magnitude as the other two objective functions. Either the units of the power output can be changed or the weight corresponding to that objective function can be drastically increased above the other weights. The latter was employed in Scenario 3, which has its contour plot given below in Figure 14.
  • 27. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 26 Figure 14: Archimedean Weighted Contour Plot (Scenario 3) The plot above seems to follow a less linear pattern than that in Figure 12. To gain a fuller understanding of what is happening in the plot, this scenario is plotted in a mesh grid, which is given below in Figure 15. Figure 15: Archimedean Weighted Example Mesh Plot (Scenario 3) With the power output as the primary concern for the optimization, the optimal solution is given as the highest gear ratio (6:1) and 10 gear reductions (n=10). Even though the power output from this “optimal” solution is approximately four times the power output from the other scenarios, it is about 34 times the cost, which is completely unacceptable. Even though producing the most effective device is a high engineering priority, the product must be marketable and profitable, which is not going to happen if it costs over $521.71.
  • 28. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 27 4.2.Penalty & Barrier The Penalty & Barrier method is typically implemented when there exists a problem with an objective function that has both feasible and infeasible regions. If the starting point lies within the feasible region, the Barrier method is enabled, which keeps the algorithm from moving into the feasible region. If the starting point is within the infeasible region, however, the algorithm implements the Penalty method. This part of the algorithm moves the optimal point very close to the constraint, which gives the user an output that lies on the constraint line and is therefore a feasible solution. The advantage to this algorithm is that the entire design space is available for the user to start in, which is beneficial when little is known about the objective function or constraints. Additionally, it is a very robust algorithm that typically does not get stuck in local minima or “false” optimal points like some other search algorithms. One last advantage is that the program converges relatively quickly. When compared to the fmincon algorithm, the number of iterations to convergence was equal or less than those needed for fmincon. The Penalty & Barrier method was chosen as the second search algorithm implemented in this report to find the optimal solution for the turnstile generator device. 4.2.1. Method Setup In order to fit the problem into the proper format for the Penalty & Barrier method, the cost and height objective functions were transformed into constraints to create feasible and infeasible regions within the design space. To find reasonable values to set as the limits for the cost and height of the product, it is prudent to refer to the previous work performed on this project in 2009. It was determined that to make the product cost-efficient, a set price of $30 is plausible. Additionally, a constraint on the height of h ≤ 0.20m is a realistic constraint due to the size of the turnstiles and the amount of room available inside the turnstiles. With these conversions of objective functions to constraints, the models can be created within the Matlab algorithm, which is shown explicitly in Section 8.2.2. It should be noted that the tl and ts values in the objective function and constraints have been converted to x1 and x2, respectively. This made it easier to retrofit this problem to the algorithms created in previous assignments. The purpose of the Penalty & Barrier Method is to ensure that the function optimizes within the feasible region and finds the best solution while adhering to the constraints placed on the system. The objective for this problem is to find the maximum power output while keeping inside the constraints of a maximum cost of $30 and a maximum height of 0.20 meters. 4.2.2. Results As with any other search algorithm, it is necessary to use several starting locations with the Penalty & Barrier method to ensure that the converged solution is the global minimum. To thoroughly test the algorithm, a mixture of feasible and infeasible starting locations were selected as starting points to ensure that both the Penalty and Barrier search algorithms were working as anticipated. The starting
  • 29. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 28 locations, along with the optimal solutions corresponding to each, are given below in Table 4. Table 4: Penalty & Barrier Run Results As noticed in the table, the starting point of (0, 0) did not converge on a solution. The reason for this is due to the Penalty and Barrier search algorithms; the gradient of the objective function is calculated and solved using the variable values from the starting location. Since the gradient of the power output objective function involves dividing by one of the variables, that returns a solution that is insolvable and thus the optimal solution is NA. Another noticeable feature of the table is that Run2 through Run4 converge at to the point (20, 20), which is the optimal solution for this search algorithm. This is confirmed as the optimal solution because the f value for that point is 0.0083, which is smaller than the next lowest value of 0.0206 at (49.97, 20). To verify the solutions graphically, several plots of the objective function and constraints were created. Below in Figure 16 is a contour plot of the objective function, cost constraint and the optimal point for Run2. x1 x2 x1 x2 1 0 0 N/A N/A N/A N/A 2 10 10 20 20 1 0.0083 3 -10 -10 20 20 3 0.0083 4 -50 10 20 20 2 0.0083 5 1000 -10 68.797 20 18 0.0282 6 -1000 1000 23.03 23.03 1 0.0083 7 1000 -1000 68.797 20 2 0.0282 8 -1000 -1000 23.03 23.03 1 0.0083 9 80 1 68.797 20 1 0.0282 10 50 1 49.97 20 1 0.0206 Run Starting Point Optimized Point # of Iterations f value
  • 30. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 29 Figure 16: Penalty & Barrier Method Contour Plot Converged for Run2 To see the difference between the optimized points, another contour plot was created for a different starting point. The contour plot of Run5 is given below in Figure 17. Figure 17: Penalty & Barrier Method Contour Plot Converged for Run5 As in the previous section, it is difficult to visualize a three dimensional view the objective function and constraints, so a mesh plot of the problem is provided below in Figure 18.
  • 31. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 30 Figure 18: Penalty & Barrier Method Example Mesh Plot In the mesh plot above, it is much clearer to see how the objective function changes with the variation in the x1 and x2 variables. As the function reaches the lower values of x1, the plot raises sharply corresponding to the changes in x2. The reason for this is because the variables appear as ratios within the objective function and thus affect one another at each point in the design space. With the lower bounds set at 20 for both x1 and x2, it is clear to see that the minimal point on the mesh plot is at (20, 20). 4.3.Fmincon This search algorithm is a line-search-based algorithm that is built within the Matlab Optimization Toolbox, and is a convenient and easy search algorithm to implement. The only parameters that the user must specify to run the algorithm are: the objective function, the constraints, the upper and lower bounds (if applicable) and the starting search point. After these are specified, the tool uses a version of a line search to calculate the optimal point within the feasible area. From previous work, however, it is noted that sometimes the algorithm gets trapped at a local minimum or other point and does not converge on the true global minimum for the problem. Thus, it is important to test several different starting points to ensure that the minimum point is truly the minimum, and not just a falsely reported point. 4.3.1. Method Setup In this search algorithm, the height constraint was dropped because it over- constrained the problem and did not allow for any of the solutions to be feasible. Since the height constraint was removed, each of the output solutions is investigated manually to determine if they are feasible with respect to the device height. With this, the power output is the only objective function and the cost constraint is the only constraint on the problem. To keep the design space restricted to the area of concern, the number of gear teeth was limited by upper and lower limits, which
  • 32. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 31 were 120 and 20, respectively. This forced the algorithm to only report solutions where the large gear teeth count and the small gear teeth count were both within the allowable range for purchasable gears from an online vendor. (Steel, Hubless Spur Gears) The algorithm for this problem is the same code generated for homework assignment 5, but is tweaked to allow for multiple constraints and specified bounds. To see a full version of the code written for this algorithm, see Section 8.2.3 in Appendix A. As with the Penalty & Barrier method, the tl and ts constraints have been converted to x1 and x2, respectively. 4.3.2. Results To obtain verified and confident results from the fmincon algorithm, several iterations must be performed using various starting points. This ensures that the true optimal point is found and that the algorithm does not get stuck at a local minimum or other “false” point, which happens on occasion. In this report, 10 different runs were performed using the fmincon function and the results are shown below in Table 5. Table 5: Fmincon Run Results One interesting point about these results is that all of the outputs have the same f value. The reason for this is that the variables appear as a fraction within the objective function and each of the optimal values for x1 and x2 are equal. Since the variables are equal in each optimal point, the ratio of the two is 1:1 for each run, which thus produces the same f value for each simulation. As seen in the table above, the point (20, 20) is the most common point that the algorithm converges upon. This point is the minimum point in this optimization given the constraints. As mentioned earlier, the height constraint was removed so that the function could converge within the feasible region of the cost constraint. To determine the relationship between the height constraint and the power output objective function, the cost constraint was replaced by the height constraint and the simulations in x1 x2 x1 x2 1 0 0 20 20 1 0.0083 2 10 10 20 20 1 0.0083 3 -10 -10 20 20 1 0.0083 4 -50 10 20 20 1 0.0083 5 1000 -10 23.16 23.16 7 0.0083 6 -1000 1000 45.94 45.94 8 0.0083 7 1000 -1000 23.2 23.2 7 0.0083 8 -1000 -1000 20 20 1 0.0083 9 80 1 24.65 24.65 6 0.0083 10 50 1 41.43 41.43 5 0.0083 Starting Point Optimized Point # of IterationsRun f value
  • 33. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 32 Table 5 were rerun. Every scenario, however, converged on the point (20, 20) and is therefore not necessary to put into tabular form. To gain a fuller understanding of the problem and verify the results graphically, the contour plot of the objective function and optimal point is shown below in Figure 19. Figure 19: Fmincon Contour Plot Converged for Run1 As in the previous sections, the contour plot does not show a complete view of the objective function, so a mesh plot was also created. The mesh plot for the fmincon simulations is given below in Figure 20. Figure 20: Fmincon Example Mesh Plot
  • 34. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 33 In the plots, notice that the upper and lower bounds for the number of gear teeth are not plotted. These limits are 120 and 20, respectively, which is why the fmincon algorithm converged on the point (20, 20). Figure 21: Fmincon Contour Plot Converged for Run10 Even though the lower bounds for x1 and x2 are not shown in the contour plots above, it is clear that minimum point for the objective function lies at the point (20, 20), which was confirmed by the output of the fmincon algorithm. 5. Comparison of Methods As is typical of any group of search algorithms, each one has its own distinct advantages and disadvantages. To compare the algorithms used in this study, several characteristics of the programs are investigated, including the quality, speed, robustness and ease of use. Since each of the algorithms was used to solve the problem and find the optimal solution, the advantages of all the algorithms supplement one another to compensate for any disadvantages that may exist. To assist in comparing the algorithms, the results table from each algorithm are consolidated in this section and shown below in Table 6 and Table 7.
  • 35. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 34 Table 6: Summary of Archimedean Weighted Exhaustive Search Results Table 7: Combined Results of Penalty & Barrier Method and Fmincon Due to the difference in outputs between the Archimedean weighted exhaustive search and the latter two search algorithms, they were kept in separate tables. w1 w2 w3 tl ts n 1 1 1 1 20 20 1 2 0.00002 0.49999 0.49999 20 20 1 3 0.99998 0.00001 0.00001 120 20 10 4 0.00001 0.99998 0.00001 20 20 1 5 0.0001 0.0001 0.9998 20 20 1 6 0.8 0.1 0.1 20 20 1 7 0.9 0.1 0.1 20 20 1 8 0.99 0.005 0.005 20 20 1 9 0.999 0.0005 0.0005 20 20 1 10 0.9995 0.00025 0.00025 85 20 7 11 0.9998 0.0001 0.0001 111 20 10 12 0.9999 0.00005 0.00005 120 20 10 Optimized ValuesWeights Run x1 x2 x1 x2 1 0 0 N/A N/A N/A N/A 2 10 10 20 20 1 0.0083 3 -10 -10 20 20 3 0.0083 4 -50 10 20 20 2 0.0083 5 1000 -10 68.797 20 18 0.0282 6 -1000 1000 23.03 23.03 1 0.0083 7 1000 -1000 68.797 20 2 0.0282 8 -1000 -1000 23.03 23.03 1 0.0083 9 80 1 68.797 20 1 0.0282 10 50 1 49.97 20 1 0.0206 1 0 0 20 20 1 0.0083 2 10 10 20 20 1 0.0083 3 -10 -10 20 20 1 0.0083 4 -50 10 20 20 1 0.0083 5 1000 -10 23.16 23.16 7 0.0083 6 -1000 1000 45.94 45.94 8 0.0083 7 1000 -1000 23.2 23.2 7 0.0083 8 -1000 -1000 20 20 1 0.0083 9 80 1 24.65 24.65 6 0.0083 10 50 1 41.43 41.43 5 0.0083 fmincon Run Starting Point Optimized Point # of Iterations f value Penalty&BarrierMethod
  • 36. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 35 5.1.Quality As far as the quality of the algorithms is concerned, the Penalty & Barrier algorithm is the best. Since the objective function can be constrained with the constraint equations, it is a higher quality than the exhaustive search and on the same level as the fmincon search function. Since the fmincon predetermines the search algorithm used to find the optimal solution, it is deemed lower quality than the Penalty & Barrier method. The reason that the Archimedean weighted exhaustive search is ranked lower than the other two in terms of quality is that there is a maximum number of variables allowable within that algorithm, which is restricted by the maximum allowable number of dimensions (three) in a matrix in Matlab. The fmincon and Penalty & Barrier search methods, however, can optimize a multivariable function without limits on the variables, which makes them more effective for higher-order functions that are more complex. 5.2.Speed To compare the speed of the algorithms, the number of iterations is considered along with the amount of time it takes for the algorithms to converge. As far as the time it takes for each to converge, the Penalty & Barrier method and the fmincon search are much faster than the Archimedean weighted exhaustive search. The reason for this is that the exhaustive search populates an entire matrix that contains thousands of entries of the calculated Archimedean weighted formula at each point, which the algorithm then uses to find the minimum. This is a highly iterative and lengthy process, which is the reason that the Archimedean weighted exhaustive search takes much longer than the other two algorithms. As seen in Table 7 above, the Penalty & Barrier method and the fmincon search tool require approximately the same number of iterations to converge, depending on the starting point. Since this problem is not as complex as many other engineering studies, the amount of time it takes for the algorithms to converge is trivial because the variation is in the order of magnitude of seconds. If this problem was more complex and the difference in the time to convergence was more than an hour, the speed could influence the cost and this parameter would have much more weight in the quality of each search algorithm. 5.3.Ease of Use In terms of the ease of use, the Penalty & Barrier method along with the fmincon search algorithm only needs variation in starting points to change the outcome. This is very simple to implement and obtain diverse results. The exhaustive search requires a change in the weights to change the shape of the Archimedean weighted formula. This is also uncomplicated to implement, however it requires three inputs rather than one. As far as the complexity of the algorithms, the Archimedean weighted exhaustive search is by far the simplest of the three codes. Not only is the math straightforward and explicit, but the way that the code runs is linear without any continuously running loops, functions or wrappers. Since it is so direct, the algorithm is easy to troubleshoot and change if any problems arise. The Penalty & Barrier method is
  • 37. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 36 similar, but longer with “while” and “for” loops, which adds to the complexity. However, since I developed the program, it is easy for me to troubleshoot. The fmincon search algorithm, however, is an optimization tool provided by Matlab and is not able to be modified. These are factors that determine the ease of use of each algorithm and should be considered when determining which algorithm is suitable for use in future projects. 5.4.Robustness The most robust algorithm of the three presented in this project is the Penalty & Barrier method. Since the starting point typically converges on the correct solution and can start in the feasible or infeasible region, this program is able to withstand any input and output a reliable converged solution. This fmincon function, however, is not quite as dependable. This program gets stuck in local minima and other random points, which may not be the optimal solution of the system. To work around this, several starting points must be tested and the f value for each should be compared to determine the actual global minimum. Additionally, sufficient conditions such as the Karush-Kuhn-Tucker (KKT) should be implemented to verify that the optimized solution is indeed the best solution. Much like the Penalty & Barrier method, the Archimedean weighted exhaustive search is exceedingly robust. Due to the simplicity of the algorithm, the vigor of the program is raised because there is less that can malfunction during the calculations. As with many systems, the simplest systems are typically the most reliable, and this case proves to be no different. 6. Conclusion Through the work performed in this report, it seems that the project idea is not as economically feasible as previously anticipated. It appears that with the lack of power output and the higher-than-anticipated costs, the construction and production of this device is not worth pursuing. The results show that the optimal power output is a gear ratio of 1:1, which entails that the turnstile arm angular velocity is not increased at all, but rather that the shaft is connected directly to the DC motor for energy capture. Despite what these results indicate, they are only as accurate as the models that were used in the search algorithms. These results should be verified by actual data through prototype testing to ensure that the device is actually ineffective. As in the optimization, different gear sizes should be implemented to find the relationship between the changes in power output from the motor. Strictly speaking on the study, however, this idea has been rendered economically infeasible and therefore not worth pursuing. Since the optimal solution in each of the three search algorithms determined that the best scenario is for a 1:1 ratio, it means that the gearbox used to increase the rotational velocity of the turnstile arm is too costly and capturing the energy from a turnstile arm is impractical because the setup does not generate enough power to make it worth pursuing.
  • 38. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 37 7. Future Work To expand upon this project and make it encompass more of the reality of the problem, there are several additional aspects that can be examined. For instance, from a feasibility standpoint, it is important to determine if the material of the gears are able to withstand the stresses applied due to the angular velocity and torque of the turnstile arms. Due to the steep increase of angular velocity of the motor shaft, the stresses on the gear teeth are raised as well, thus possibly exceeding the maximum limit of the currently chosen gears. To avoid this, a relationship could be determined between the different materials from which the gears are fabricated and the maximum allowable torque on the teeth. This could then be used as another constraint in the compromise DSP to help with the feasibility of the problem. In conjunction with the different gear materials, perhaps it would be appropriate to research the different types of gears, such as gears with hubs. From a construction perspective, this would decrease the complexity and lower the cost on assembly. Another characteristic of the problem that has been overlooked is the cost of all the components. As with the gears, a model can be created to incorporate the cost of all the components of the device, which would help account for all the extraneous costs, such as the gear shafts and gearbox casing. Two last items that can be incorporated into the problem are the turnstile arm length and the force applied to the turnstile arm. These will affect the amount of power generated per person and thus have a direct effect on the optimized solution. Since these were only assumptions in this problem, they can be changed to variables and varied in the optimization algorithms to determine the best solution. Even though the work in this report shows that it is not profitable, there are several other variables that can be investigated further for possible improvement on the idea. One option that can be incorporated into the design of this device is a free spinning flywheel attached to the output motor shaft. By adding a flywheel to the design, the motor shaft will continue to spin, even after the user has passed through the turnstile and the turnstile arm shaft has stopped spinning. By adding the capability of the flywheel to engage and disengage the motor shaft, the initial rotational moment of inertia can be effortlessly overcome and will thus reduce the amount of force required to spin the turnstile arms. Another parameter that can be investigated further is the correlation between the gear ratio and the amount of force required to turn the turnstile arms. Each gear increases the resistance and adds more force necessary to spin the arms and pass through the turnstile, which is a relationship that is worth studying and incorporating into the model. Despite what the outputs from the algorithms show, one must remember that the results must be analyzed with a critical eye. The results from an algorithm should be used to help engineers make decisions on real systems, not be the deciding factor on whether an idea is worth pursuing. Also, it is important to keep in mind that garbage in is equal to garbage out, which means that if the models created for this report were not completely accurate, then all results generated from this study are null and
  • 39. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 38 void. To verify these findings without investing too much time or money, it is recommended that another prototype be built for this device and that a few of the various gear ratios be tested to determine if the power output correlates with the data generated in this study.
  • 40. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 39 8. Appendix A 8.1.Definition of Variables ( ) ( ) ( ) ( ) ( ) 8.2.Matlab Code The codes used to find the optimal solutions are shown in the following section. Note that the program used to create the following codes was Matlab 2012a. 8.2.1. Archimedean Weighting Scheme (Exhaustive Search) Exhaustive_Search_Method %% ME6103 TURNSTILE GENERATOR OPTIMIZATION %Wayne Smith- December 19, 2012 %%Archimedean Weights Solver for Turnstile Generator % %Specify Design Variables %tl=number of teeth on large gear
  • 41. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 40 %ts=number of teeth on small gear %n=number of gears (large and small) %T=amount of time it takes to push through turnstile (secs) clear;clc;close all; %DEFINE CONSTANTS %Motor properties tau_s=2*10^(-3); %stall torque (N-m) wn=200*pi(); %unloaded ang velocity (rad/sec) cm=2; %cost of 1.5V DC motor (in $) T=3; %time to push through turnstile %Set Weights w1=.00001; %weight for output power w2=.00001; %weight for size of gearbox w3=.00001; %weight for cost of motor and gears %SYSTEM BOUNDS %Lower Bounds tl_l=20; ts_l=20; n_l=1; %Upper Bounds tl_u=120; ts_u=120; n_u=10; %Adjusted bounds for proper matrix construction tll=tl_l-19; tsl=ts_l-19; tlu=tl_u-19; tsu=ts_u-19; for i=tll:1:tlu for j=tsl:1:tsu for k=n_l:1:n_u power(i,j,k)=-(tau_s/wn)*(k.*((i+19)./(j+19)).*... ((2*pi())/(3*T)))^2+tau_s.*(k.*((i+19)./(j+19))*... ((2*pi())/(3*T))); h(i,j,k)=((k+1)/2)*((i+19)+(j+19)); cost(i,j,k)=cm+k*((0.0017.*(i+19).^2+0.1472.*(i+19)+... 3.1014)+(0.0017.*(j+19).^2+0.1472.*(j+19)+3.1014)); end end end %Weighted Function A=-w1.*power+w2.*h+w3.*cost; %FIND THE MINIMUM [minA idx] = min(A(:)); [n m p] = ind2sub(size(A),idx); %CALCULATE OPTIMAL VALUES tl_opt=n+19; %optimal value for tl
  • 42. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 41 ts_opt=m+19; %optimal value for ts n_opt=p; %optimal value for n %GRAPH FUNCTION %convert all zeroes and '-inf' to 'inf' A(A==0)=Inf; A(A==-Inf)=Inf; B=min(A,[],3); %search 3d matrix for min values and output nxm min matrix hold on contour(B,40) plot(tl_opt,ts_opt,'o') %add the optimal point to the graph xlabel('Number of Large Gear Teeth') ylabel('Number of Small Gear Teeth') zlabel('Optimal Number of Gears') title('Minimized Archimedean Solutions') grid on hold off %DISPLAY FINAL VALUES fprintf('nMinimum Value:'),disp(minA) fprintf('nOptimal Number of Large Gear Teeth:'),disp(tl_opt) fprintf('nOptimal Number of Small Gear Teeth:'),disp(ts_opt) fprintf('nOptimal Number of GearsMinimum Value:'),disp(n_opt) 8.2.2. Penalty & Barrier Method Combined_method %% Combined Penalty & Barrier Method %Conversion of Constrained Optimization to Unconstrained Optimization % % This code takes an objective function with constraints and outputs: % 1. The optimal x1 and x2 values % 2. The final penalty parameter value, r % 3. The number of iterations it took to converge, iter % 4. The objective function value at the optimal point % 5. The inequality constraint value clear all;clc;close all;warning off; format compact %DEFINE PARAMETERS iter=0; %initialize iteration value g_vio=1; %initialize violated constraint value f_val_diff=100; %initialize obj fun difference value %DEFINE VARIABLES x=[10;10]; %starting point r=1; %starting value for penalty parameter, r iter_max=15; %maximum # of iterations before code stops eps=1e-4; %limit for the difference in optimal obj fun val g_limit=1e-6; %limit for the sum of constraints values before code stops
  • 43. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 42 %DEFINE FUNCTIONS syms x1 x2 f g h F grad1 grad2 assumeAlso(x1,'real') %sets x1 to only take real values assumeAlso(x2,'real') %sets x2 to only take real values f=-((2*10^-3)/(200*pi()))*(1*((x1/x2)*(2*pi())/1.5))^2+... (2*10^-3)*(1*(x1/x2)*(2*pi())/1.5); %objective function g_sym=[-28+1*((0.0017*x1^2+0.1472*x1+3.1014)+... %constraints (0.0017*x2^2+0.1472*x2+3.1014)); 20-x1; 20-x2; x2-x1;]; %TEST TO FIND VIOLATED CONSTRAINTS g_vals=subs(g_sym,[x1 x2],[x(1) x(2)]); test1=max(0,g_vals); if any(test1>0) %sorts through elements to find entries >0 num=find(test1>0); %calls entries>0 from symbolic constraint functions cons_vio=g_sym(num); else cons_vio=0; end cons_vio; %constructed array of violated constraints %DISPLAY NUMBER OF CONSTRAINTS VIOLATED N=length(cons_vio); if (cons_vio==0) fprintf('No Constraints Violated!n') elseif (N==1) fprintf('1 Constraint Violated!n') elseif (N==2) fprintf('2 Constraints Violated!n') elseif (N==3) fprintf('3 Constraints Violated!n') elseif (N==4) fprintf('4 Constraints Violated!n') elseif (N==5) fprintf('5 Constraints Violated!n') elseif (N>5) fprintf('More than 5 Constraints Violated!n') end fprintf('----------------------------------------------------------n') fprintf('Constraints Violated:n') disp(cons_vio) fprintf('----------------------------------------------------------n') %DETERMINE IF PENALTY OR BARRIER METHOD IS NEEDED %STARTING POINT IN FEASIBLE REGION %BARRIER METHOD ENABLED if (cons_vio==0) fprintf('nStarting Point is in Feasible Region. ') fprintf('Barrier Method Enabled.n')
  • 44. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 43 fprintf('n---------------------------------------------------------- n') N=length(g_sym); for i=1:N pen_term(i)=1/(g_sym(i)); i=i+1; end while f_val_diff>eps g=sum(pen_term); F=f-r*g; %the unconstrained function f_val_prev=subs(F,[x1 x2],[x(1) x(2)]); Fs = @(x) subs(F,[x1 x2],[x(1) x(2)]); x=fsolve(Fs,x) %CALCULATE DIFFERENCE IN OBJ FUN VALUES f_val_new=subs(F,[x1 x2],[x(1) x(2)]); f_val_diff=abs((f_val_new-f_val_prev)/(f_val_new)); r=.1*r; %find new value of r iter=iter+1; %add 1 to iteration count end n1=length(x); for i=1:n1 f_val1(i)=subs(f,{x1,x2},{x(i,1),x(i,2)}); end opt_pt=[x(2,1), x(2,2)]; f_val=subs(f,{x1,x2},{x(2,1),x(2,2)}); fprintf('nOptimal Point Coordinates:'), disp(opt_pt) fprintf('nFinal Penalty Parameter Value (r):'), disp(r) fprintf('nNumber of Iterations to Convergence:'), disp(iter) fprintf('nObjective Function Value:'), disp(f_val) %PLOT THE FUNCTION hold on ezcontour(f,[-20,20],30) %create contour plot n=length(g_sym); for i=1:n ezplot(g_sym(i),[-20,20]) %show constraint lines on plot end plot(opt_pt(1),opt_pt(2),'o') %add the optimal point to the graph text((opt_pt(1)+2),(opt_pt(2)-2),['(', num2str(opt_pt(1)), ', ',... num2str(opt_pt(2)), ')']) text(opt_pt(1),opt_pt(2),' leftarrow Optimal Point') title('HW5 Problem with Penalty: Objective Function f with Constraint g') grid on hold off %STARTING POINT IN INFEASIBLE REGION
  • 45. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 44 %PENALTY METHOD ENABLED else fprintf('nStarting Point is in Infeasible Region. ') fprintf('Penalty Method Enabled.n') fprintf('n-------------------------------------------------------- --n') N=length(cons_vio); %CREATE AN ARRAY OF SQUARED CONSTRAINT TERMS for i=1:N pen_term(i)=(cons_vio(i))^2; i=i+1; end while g_vio>g_limit && iter_max>iter g=sum(pen_term); F=f+r*g; %the unconstrained function Fs = @(x) subs(F,[x1 x2],[x(1) x(2)]); x=fsolve(Fs,x) %TEST TO SEE IF ANY CONSTRAINTS ARE VIOLATED test_cons=subs(g_sym,[x1 x2],[x(1) x(2)]); %tests whether constraints are larger than 0 test2=max(0,test_cons); %solve for g to determine if loop continues g_vio=sum(subs(cons_vio,[x1 x2],[x(1) x(2)])); r=10*r; %find new value of r iter=iter+1; %add 1 to iteration count end f_val=subs(f,{x1,x2},{x(1),x(2)}); g_val=subs(g_sym,{x1,x2},{x(1),x(2)}); fprintf('nOptimal Point Coordinates:'), disp(x) fprintf('nFinal Penalty Parameter Value (r):'), disp(r) fprintf('nNumber of Iterations to Convergence:'), disp(iter) fprintf('nObjective Function Value:'), disp(f_val) fprintf('nInequality Constraint Value:'), disp(g_val) %PLOT THE FUNCTION hold on ezcontour(f,[0,120]) %create contour plot ezplot(g_sym(1),[0,120]) plot(x(1),x(2),'o') %add the optimal point to the graph text((x(1)+2),(x(2)-5),['(', num2str(x(1)), ', ',... num2str(x(2)), ')']) text(x(1),x(2),' leftarrow Optimal Point') title('Final Report Penalty & Barrier: Obj Fun f with Con g') grid on hold off end
  • 46. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 45 8.2.3. fmincon run_fmincon %% Run fmincon clear all; clc; close all; warning off; %reset Matlab memory fprintf('The values of function value and constraints at starting point'); x0 = [50,1] % Make a starting guess at the solution f=objfun(x0) %Specify bounds lb = [20,20]; % Set lower bounds ub = [120,120]; % Set upper bounds options=optimset('LargeScale','off','Display','iter'); [c, ceq]=constraints(x0) [x, fval]=fmincon(@objfun,x0,[],[],[],[],lb,ub,@constraints,options) fprintf('The values of constraints at optimum solution'); [c, ceq]=constraints(x) %check the constraint values at x %Define the function symbolically syms x1 x2 %Output Power Objective Function f1=-((2*10^-3)/(200*pi()))*(1*((x1/x2)*(2*pi())/1.5))^2+... (2*10^-3)*(1*(x1/x2)*(2*pi())/1.5); %Cost Constraint g_sym1=-28+1*((0.0017*x1^2+0.1472*x1+3.1014)+... (0.0017*x2^2+0.1472*x2+3.1014)); %Height Constraint % g_sym2=((10+1)/2)*(x1+x2)-0.2; %PLOT THE FUNCTION hold on %ezsurf(f1,[0,120]) %create surface plot ezcontour(f1,[0,120]) %create contour plot n=length(g_sym1); for i=1:n ezplot(g_sym1(i),[0,120]) %show cost constraints on plot end plot(x(1),x(2),'o') %add the minimum point to the graph text((x(1)+2),(x(2)-5),['(',num2str(x(1)), ', ', num2str(x(2)), ')']) text(x(1),x(2),' leftarrow Optimal Point') title('Final Report: Objective Function f with Constraints g') grid on hold off objfun function f=objfun(x) f=-((2*10^-3)/(200*pi()))*(1*((x(1)/x(2))*(2*pi())/1.5))^2+... (2*10^-3)*(1*(x(1)/x(2))*(2*pi())/1.5);
  • 47. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 46 constraints function [c, ceq]=constraints(x) %Nonlilnear inequality constraints %Cost constraint c(1)=-28+1*((0.0017*x(1)^2+0.1472*x(1)+3.1014)+... (0.0017*x(2)^2+0.1472*x(2)+3.1014)) %Gear geometry constraint c(2)=x(2)-x(1) %Height constraint % c(3)=((10+1)/2)*(x(1)+x(2))-0.2; %Nonlinear equality constraints ceq=[];
  • 48. Final Report: Turnstile Generator: Maximize Energy Output M6103Q: Optimization in Engineering Design | Wayne Justin Smith Jr. 47 9. Works Cited Angular Velocity. (2012, December 8). Retrieved 12 2012, 2012, from Wikipedia: http://en.wikipedia.org/wiki/Angular_velocity Product Data Sheet. (2012). Retrieved December 16, 2012, from Precision Microdrives: https://catalog.precisionmicrodrives.com/.../107-001-7mm-dc- motor-25mm-type-datasheet.pdf DC Motor Specifications. (n.d.). Retrieved December 11, 2012, from The Electronic Store: http://theelectrostore.com/datasheets/tsukasa_tech_05.pdf Page, M. (1999). Understanding D.C. Motor Characteristics. Retrieved December 9, 2012, from Massachusetts Institute of Technology: http://lancet.mit.edu/motors/motors3.html Steel, Hubless Spur Gears. (n.d.). Retrieved December 7, 2012, from Quality Transmission Components: http://www.qtcgears.com/RFQ/default.asp?Page=../KHK/newgears/KHK06 4.html