SlideShare a Scribd company logo
TREBUCHET
PARAMETRIC DESIGN
OPTIMIZATION
Image taken from: http://joemonster.org/art/28956
Ben Johnson
4/20/2016
ME 644 Final Project: Trebuchet
Parametric Design Optimization
Comparative trebuchet design optimizations conducted with
Matlab® (3 degree of freedom model) as well as ANSYS®
(full 3D finite element model).
PA R A M ETR I C D ES I G N O PTI M I ZA TI O N FO R R A N G E
EFFI C I EN C Y
ME 644 Final Project – Ben Johnson
Page 1
INTRODUCTION | ONE
Once upon a time, the trebuchet was a mighty medieval weapon used to hurl projectiles at the walls of a
castle during the terror of a siege. Although today they may be more commonly associated with launching
pumpkins for reality TV, the motion exhibited by a trebuchet is of academic interest to someone studying
nonlinear dynamics. A trebuchet operates by converting the potential energy of a large raised mass to the
kinetic energy of a projectile at the end of a sling. From an engineering standpoint we may quantify the
effectiveness of a particular trebuchet design by the efficiency in which it completes this conversion.
PROJECT OBJECTIVE | TWO
The overall objective of this project is to apply parametric design optimization techniques in an attempt to
arrive at an optimal solution for trebuchet design. Utilizing an online article “Trebuchet Mechanics” by
Donald Siano [1] as a primary basis this project will also attempt to verify a couple assertions made in the
article regarding optimum trebuchet design. The first assertion to be tested is that the maximum range
efficiency1 of an idealized analytical model of a trebuchet is 83%. The second assertion to be tested is that
including component mass in the model necessarily reduces the system efficiency below 83%.
Although the 2D model provides both a revealing analytical tool and a promising starting point for a real
design, it is a mathematical abstraction whose assumptions do not hold up in reality. Addressing the
reduction in range efficiency upon the inclusion of component mass will involve applying an ANSYS
response surface optimization to a parametric trebuchet design and comparing efficiency results achieved by
the 2D and 3D models. The ANSYS model overcomes the limitations of the analytical model providing for
the inclusion of realistic considerations such as part dimensions, material properties, and factors of safety.
BACKGROUND | THREE
Geometry of the Trebuchet
Centuries of design iterations have produced several popular trebuchet designs available for present day
analysis. The type of trebuchet to be considered for this project may be described by its two main
characteristics, a hinged counterweight and projectile sling.
1 Range efficiency defined in section three (Background).
ME 644 Final Project – Ben Johnson
Page 2
Figure 1.1 Trebuchet Diagram with Dimension Definitions
The variable parameters available to the designer include the illustrated lengths L1-L4 as well as the masses
of the counterweight and projectile m1 and m2 respectively.
Trebuchet Operation
A trebuchet is loaded by rotating the main beam to elevate the counterweight thus imparting to the weight
some potential energy. A firing mechanism fixes the beam rotation maintaining the weight in the elevated
position until ready to fire. A projectile is loaded to the sling whose attachment to the main beam provides
for releasing the projectile at some predetermined angle. When ready to launch, the firing mechanism is
unlocked and the weight of m1 imparts an angular acceleration to the beam. The beam motion is transferred
to the projectile through the sling whose rotation accelerates through an arc until reaching the predetermined
firing angle at which point the sling partially disengages from the beam thus releasing the projectile.
Figure 3.2 Illustration of Trebuchet Operation2
2 Image obtained from online resource at http://www.tasigh.org/ingenium/physics.html
ME 644 Final Project – Ben Johnson
Page 3
Trebuchet Efficiency
Although the efficiency of a trebuchet may be described in multiple ways, the means chosen for this analysis
is what Siano has designated “range efficiency” in “Trebuchet Mechanics.” The range efficiency in this
context is the ratio of a given trebuchet’s range to the range of an idealized trebuchet where the total
potential energy of the counterweight is converted to the kinetic energy of the projectile and the projectile is
released at the optimum angle of 45 degrees. The formula for range efficiency is straightforward to obtain
and is verified in multiple online resources to be:
𝑅𝑎𝑛𝑔𝑒 𝐸𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑐𝑦 =
𝑚2 𝑣0
2(𝑠𝑖𝑛𝛼)(𝑐𝑜𝑠𝛼)
𝑚1 𝑔 ℎ
Eq 3.1
Where v0 is the projectile release velocity, α is the angle of v0 measured with respect to the horizontal
ground, g is the acceleration due to gravity, and h is the vertical travel of the counterweight.
As was previously mentioned, “Trebuchet Mechanics” asserts the maximum range efficiency for the hinged
counterweight/projectile sling type of trebuchet to be 83%. A major goal of this paper is to verify this
maximum because although other sources [2] [3] make reference to this optimum basis independent
verifications of the theoretical maximum have not been forthcoming.
TWO DIMENSIONAL MODEL (MATLAB®) | FOUR
Assumptions of the 2D model
The two dimensional model assumes that the only system components to exhibit mass are the counterweight
and the projectile. All components are assumed to be rigid and all connections are assumed to be
frictionless. All aerodynamics forces are neglected as was done in “Trebuchet Mechanics” and all
simulations use a starting angle for the beam of 45 degrees from vertical i.e. the beam rotates through 135
degrees to the point of minimum potential energy upon firing.
Defining the Lagrangian
The Lagrangian of the system may be defined with respect to the potential and kinetic energies of the system
components. It is similar to that of a double pendulum but with an additional pendulum segment (the
counterweight and pivot) which points upwards contributing similar but opposite sign terms to the equation.
𝑇 (𝑖. 𝑒. 𝐾𝑖𝑛𝑒𝑡𝑖𝑐 𝐸𝑛𝑒𝑟𝑔𝑦) =
1
2
𝜃̇1
2
(𝑚1 𝐿1
2
+ 𝑚2 𝐿4
2
+ 𝜃̇1 [2𝐿3 𝐿4 𝑚2 𝜃̇3 cos( 𝜃1 − 𝜃3 ) −
2𝐿1 𝐿2 𝑚1 𝜃̇2 cos( 𝜃1 − 𝜃2 )] + 𝐿2
2
𝑚1 𝜃̇2
2
+ 𝐿3
2
𝑚2 𝜃̇3
2
)
Eq 4.1
𝑉 (𝑖. 𝑒. 𝑃𝑜𝑡𝑒𝑛𝑡𝑖𝑎𝑙 𝐸𝑛𝑒𝑟𝑔𝑦) = 𝑔𝑐𝑜𝑠( 𝜃1)(𝐿4 𝑚2 − 𝐿1 𝑚1 ) + 𝑔𝐿2 𝑚1cos(𝜃2 ) + 𝑔𝐿3 𝑚2cos(𝜃3 )
Eq 4.2
The Lagrangian is:
ME 644 Final Project – Ben Johnson
Page 4
𝐿 = 𝑇 − 𝑉 Eq 4.3
And the equations of motion are produced for each coordinate, qj, according to:
𝑑
𝑑𝑡
(
𝜕𝐿
𝜕𝑞̇ 𝑗
) − (
𝜕𝐿
𝜕𝑞 𝑗
) = 0 Eq 4.4
Evaluating Eq. 4.4 for each qj, (θ1, θ2, θ3) provides the following 3 equations of motion for the system:
𝑚1 𝐿1
2
𝜃̈1 + 𝑚2 𝐿4
2
𝜃̈1 − 𝐿1 𝐿2 𝑚1 𝜃̇2
2
sin( 𝜃1 − 𝜃2) − 𝐿1 𝐿2 𝑚1 𝜃̈2cos( 𝜃1 − 𝜃2 ) + 𝐿3 𝐿4 𝑚2 𝜃̇3
2
sin( 𝜃1 −
𝜃3) + 𝐿3 𝐿4 𝑚2 𝜃̈3cos( 𝜃1 − 𝜃3) − 𝑔𝐿1 𝑚1 sin( 𝜃1 ) + 𝑔𝐿4 𝑚2sin( 𝜃1) = 0
Eq 4.5
𝐿2 𝜃̈2 + 𝐿1 𝜃̇1
2
sin( 𝜃1 − 𝜃2) − 𝐿1 𝜃̈1cos( 𝜃1 − 𝜃2) + 𝑔 sin( 𝜃2) = 0 Eq 4.6
𝐿3 𝜃̈3 − 𝐿4 𝜃̇1
2
sin( 𝜃1 − 𝜃3) + 𝐿4 𝜃̈1cos( 𝜃1 − 𝜃2) + 𝑔 sin( 𝜃3) = 0 Eq 4.7
Formatting the Equations of Motion for Runge-Kutta
In order to simulate the system motion equations 4.5-4.7 must be formatted in a manner suitable for a Runge-
Kutta solver. By representing the equations in matrix form and utilizing Gaussian elimination, the equations3
may be rearranged so that each includes only a single acceleration term. The equations may then be
transposed to a state space representation providing six first order expressions for the state variable
derivatives which are ready to be solved with Matlab.
Optimizing System Design Parameters
Utilizing the Matlab function “fmincon” the system may be optimized for range efficiency. The output of
the optimization is provided in figure 4.1. The syntax required to pass extra arguments (L2-L4 and M2 in this
case) to the Matlab built in ODE45 function may be found in the appendix. Another special provision found
in the appendix is the events function which stops ODE45 execution once a given value of sling rotation is
achieved. Adding events was necessary to bound the objective function output since changing the system
parameters significantly impacts the operational period of the trebuchet.
3 See appendix for Matlab® .m file code.
ME 644 Final Project – Ben Johnson
Page 5
Figure 4.1 Optimization Results
As can be seen in the figure, after 20 iterations a new optimum basis which provides the underlined value of
92.6% range efficiency has been produced. The “final point” values of 4.846, 1.737, 4.12, and 130.024
correspond to parameters L2, L3, L4, and M1 respectively. Length L1 is given a value of 1m and projectile
mass is given a value of 1kg. A plot of the motion is displayed in figure 4.2 below.
ME 644 Final Project – Ben Johnson
Page 6
Figure 4.2 System Motion for Optimum Basis
The lower datatip displays the max range efficiency of 92.6% occurring at t=0.693 seconds and the upper
datatip shows the sling rotation of 2.418 radians (for t=0.693 seconds) which corresponds to an angle of 38
degrees with the ground (this is not the same as projectile velocity relative to horizontal). The physical
meaning of the chart is admittedly difficult to appreciate without a graphical rendering of the motion. At this
point it is sufficient to convey that the motion of the beam is arrested very near the optimum point of release.
This indicates that the rotational energy of the beam has been efficiently converted to sling rotation and that
the timing of this conversion is near optimal.
Justification for New Optimum Basis
The optimization presented herein differs from that of “Trebuchet Mechanics” in a couple aspects. First of
all, in “Trebuchet Mechanics” the optimization was performed on individual parameters as a ratio to a single
other parameter. In effect, only one parameter was optimized at a time. The fmincon function presented
here approaches the optimum basis by varying all parameters at once. In this way interacting terms in the
objective function can be optimized as well as the first order terms. The second difference between
optimization methods was that for “Trebuchet Mechanics” a “Monte Carlo” method of optimization was
used. Monte Carlo in this context amounts to testing the objective function for a series of random parameter
values. The method applied by the fmincon function uses knowledge of the objective function gradients
relative to decision variables to direct its iterative progression toward an optimum basis. The combination of
these two differences provides justification for the improved performance of the new trebuchet design.
ME 644 Final Project – Ben Johnson
Page 7
THREE DIMENSIONAL MODEL (ANSYS)| SIX
Additional Considerations of the 3D Model
For the finite element model the dimensions and material of each component are included. Material
considerations include but are not limited to density, Young’s modulus, Poisson’s ratio, tensile and
compressive yield strength. All of the prior system length and mass parameters (L1-L4 and M1-M2) are still
included in the optimization with the addition of various component dimensions critical to system function
and stresses encountered during operation.
Optimizing Part and Assembly Geometry
The ANSYS response surface optimization feature was utilized to tune the range efficiency of the 3D model.
While the geometry of the counterweight arm and the projectile sling were optimized for stresses, the impact
of their cross section on range efficiency was of insufficient significance to justify investigating any sort of
tapered designs. The beam, on the other hand, is a different story. The inclusion of several geometric
parameters was necessary to achieve maximum range efficiency. The most important aspect of the beam is
the tapered portion which becomes narrower approaching the sling connection. This design aspect reduces
the moment of inertia of the beam but must be optimized against bending stresses encountered during
operation. The geometry was created by defining a spline from the corners near the pivot to the corners near
the sling, the length of which is defined by dimensions L21+L46. The construction points that are set a
width of L22 apart control the rapidity of the taper. Length L21 sets the distance of the taper point from the
start of the spline. Length L44 at the bottom right sets the final tapered beam width. The length of the beam
extending prismatically beyond the spline is set by L26, the dimension which corresponds to L4 in the 2D
model. The second most important aspect of the geometry is the widened portion to the left of the pivot
(located at the origin) which moves the center of mass in that direction.
ME 644 Final Project – Ben Johnson
Page 8
Figure 6.1 Beam Geometry and Dimensioning Scheme
Optimal Solution
After several design iterations, a maximum range efficiency of 83% was achieved by the ANSYS model with
a minimum beam factor of safety around 2. Factors of safety for all other parts are >10. All parts are
specified as steel except the sling which is polyethylene. Beam dimensions for the final design may be found
in figure 6.2.
Figure 6.2 Beam Final Dimensions, Range Efficiency, and Minimum Factor of Safety
Behavior of Optimized Trebuchet
ME 644 Final Project – Ben Johnson
Page 9
Results of the ANSYS optimization model indicate that the inclusion of component mass and flexibility need
not lead to a dramatic reduction in trebuchet efficiency. It becomes clear upon watching the simulation4
that
for an efficiently designed trebuchet almost all rotational motion imparted to the beam by the counterweight
is passed on to the projectile sling at as close to the optimum release angle as is feasible.
CONCLUSIONS|SIX
The models presented herein have achieved their intended purpose. Applying an improved optimization
method to the analytical model has been demonstrated to increase the theoretical range efficiency of a
trebuchet beyond the previously asserted value of 83% to 92%. In addition, the inclusion of component
dimensions and stresses encountered has been shown to be of limited impact to the theoretical efficiency. If
more time was spent on the ANSYS model the efficiency could no doubt be further increased possibly
approaching the 92% provided by the Matlab simulation.
Although the improvement in range efficiency is a positive result, it seems the time savings reaped from the
technique is the most significant. In this instance, the application of modern computational tools replaced
countless design iteration by a few weeks of simulation. The progress produced by these evolving tools
should be remarkable to witness, assuming they don’t produce robots wielding optimized trebuchets.
REFERENCES| SEVEN
[1] D. Siano, “Trebuchet Mechanics,” Accessedonline: http://www.aemma.org/training/trebuchet/trebmath35.pdf. 2001.
[2] E. Mahieu, “Optimizingthe Counterweight Trebuchet,”Accessedonline: http://demonstrations.wolfram.com/OptimizingTheCounterweightTrebuchet/.
2012
[3] M. Senese, “Tuninga Trebuchet for Maximum Distance,”Accessedonline: http://www.mikesenese.com/DOIT/2010/12/tuning-a-trebuchet/2012.
2010.
APPENDIX| EIGHT
Equations of Motion: State Space .m File
function thetadot=TrebODEfcn(t,theta,L1,L2,L3,L4,m1,m2,g); %% Function outputs
state variable values
%% Variables to achieve Gaussian elimination
a=[(m2*g*L4-m1*g*L1)*sin(theta(1))-m1*L1*L2*theta(4)^2*sin(theta(1)-
theta(3))+m2*L3*L4*theta(6)^2*sin(theta(1)-theta(5))];
b=g*sin(theta(3))+L1*sin(theta(1)-theta(3))*theta(2)^2;
c=g*sin(theta(5))-L4*sin(theta(1)-theta(5))*theta(2)^2;
4 A video of the motion may be viewed online at: https://youtu.be/cinPR2tznsU
ME 644 Final Project – Ben Johnson
Page 10
d=(m1*L1^2+m2*L4^2)-L1*cos(theta(1)-theta(3))*m1*L1*cos(theta(1)-theta(3))-
L4*cos(theta(1)-theta(5))*m2*L4*cos(theta(1)-theta(5));
e=[a+b*m1*L1*cos(theta(1)-theta(3))-c*m2*L4*cos(theta(1)-theta(5))]/d;
thetadot(1,1)=theta(2);
thetadot(2,1)=-1*e;
thetadot(3,1)=theta(4);
thetadot(4,1)=-1*[b+e*L1*cos(theta(1)-theta(3))]/L2;
thetadot(5,1)=theta(6);
thetadot(6,1)=-1*[c-e*L4*cos(theta(1)-theta(5))]/L3;
end
Function to Apply Runge-Kutta to EOM’s and Report Range Efficiency
function [mineR,t,theta,eR,v0sqr]=runTrebODEfcn(x); %% Function called by
optimization routine fmincon which tries to minimize –1*(max efficiency ratio)
%% Establish parameter values passed to function by x()
l2=x(1);
l3=x(2);
l4=x(3);
M1=x(4);
L1=1; %% these two parameters held constant at 1
m2=1;
g=9.81;
L2=l2;
L3=l3;
L4=l4;
m1=M1;
opts=odeset('Events',@events); %% Set ode45 options (Stops integration when
rotation of sling reaches 180 deg)
[t,theta]=ode45(@(t,theta)TrebODEfcn(t,theta,L1,L2,L3,L4,m1,m2,g),[0.01:1e-
4:2],[pi/4,0,0,0,0,0],opts); %% Runs ode45
v0sqr=L4^2*(theta(:,2).^2)+L3^2*(theta(:,6).^2)+2*L4*L3*theta(:,2).*theta(:,6).*cos
(theta(:,1)-theta(:,5)); %% Calculates velocity squared vs time for efficiency
calc
h=L1*sin(pi/4)+L1; %% calculate distance counterweight falls
xvel=L4*theta(:,2).*cos(pi-theta(:,1))+L3*theta(:,6).*cos(pi-theta(:,5)); %%y
velocity of projectile
ME 644 Final Project – Ben Johnson
Page 11
yvel=-1*L1*theta(:,2).*sin(pi-theta(:,1))-1*L3*theta(:,6).*cos(pi-theta(:,5)); %%
x velocity of projectile
alpha=atan(yvel./xvel); %% angle of projectile velocity
eR=(m2/m1)*v0sqr.*sin(alpha).*cos(alpha)/9.81/h; %% Calculate efficiency ratio
[mineR]=min(eR); %% Find minimum of efficiency ratio
end
Function to Stop ODE45 Integration When Sling Rotation is 180 °
function[value,isterminal,direction]=events(t,theta)
value=theta(5)-pi; %detect theta3 = 180 deg
isterminal=1; %stop integration
direction=1; %positive rotation
end

More Related Content

Viewers also liked

ME 647 Project Exacta betting optimization model
ME 647 Project Exacta betting optimization modelME 647 Project Exacta betting optimization model
ME 647 Project Exacta betting optimization modelBenjamin Johnson
 
Dia de la juventud
Dia de la juventudDia de la juventud
Dia de la juventud
Fernando Motoche
 
Pawert point nticx autobiografia
Pawert point nticx autobiografiaPawert point nticx autobiografia
Pawert point nticx autobiografia
Nicolás Colman
 
Hoàng Đức Liên 0946554558 - www.hanoi68.com
Hoàng Đức Liên 0946554558 - www.hanoi68.comHoàng Đức Liên 0946554558 - www.hanoi68.com
Hoàng Đức Liên 0946554558 - www.hanoi68.com
Hdlien Hdlien
 
LIUDMILA PRE-SPRING '17 LOOK BOOK 2
LIUDMILA PRE-SPRING '17 LOOK BOOK 2LIUDMILA PRE-SPRING '17 LOOK BOOK 2
LIUDMILA PRE-SPRING '17 LOOK BOOK 2Najeeba Hayat
 
Trabajo de metodologia de la investigacion
Trabajo de metodologia de la investigacionTrabajo de metodologia de la investigacion
Trabajo de metodologia de la investigacion
jonathan uriana
 
Walter Gropius | والتر جربيوس
Walter Gropius | والتر جربيوسWalter Gropius | والتر جربيوس
Walter Gropius | والتر جربيوس
ZohaTrabelsi
 
Tony Norton Jim Hassberger
Tony Norton Jim HassbergerTony Norton Jim Hassberger
Tony Norton Jim Hassberger
Mediabistro
 
YEOT Spring 2015 Webinar 5: Catapults and Trebuchets
YEOT Spring 2015 Webinar 5: Catapults and TrebuchetsYEOT Spring 2015 Webinar 5: Catapults and Trebuchets
YEOT Spring 2015 Webinar 5: Catapults and Trebuchets
Aaron Maurer
 
Reengineering of Topology Optimization Results - Inspire and PolyNURBS
Reengineering of Topology Optimization Results - Inspire and PolyNURBSReengineering of Topology Optimization Results - Inspire and PolyNURBS
Reengineering of Topology Optimization Results - Inspire and PolyNURBS
Altair
 
Lesson 1 parametric design 2 final
Lesson 1   parametric design 2 finalLesson 1   parametric design 2 final
Lesson 1 parametric design 2 final
Itai Cohen
 
Cad cam cae
Cad cam caeCad cam cae
Cad cam cae
Fab Lab LIMA
 

Viewers also liked (14)

ME 647 Project Exacta betting optimization model
ME 647 Project Exacta betting optimization modelME 647 Project Exacta betting optimization model
ME 647 Project Exacta betting optimization model
 
Dia de la juventud
Dia de la juventudDia de la juventud
Dia de la juventud
 
Pawert point nticx autobiografia
Pawert point nticx autobiografiaPawert point nticx autobiografia
Pawert point nticx autobiografia
 
Hoàng Đức Liên 0946554558 - www.hanoi68.com
Hoàng Đức Liên 0946554558 - www.hanoi68.comHoàng Đức Liên 0946554558 - www.hanoi68.com
Hoàng Đức Liên 0946554558 - www.hanoi68.com
 
LIUDMILA PRE-SPRING '17 LOOK BOOK 2
LIUDMILA PRE-SPRING '17 LOOK BOOK 2LIUDMILA PRE-SPRING '17 LOOK BOOK 2
LIUDMILA PRE-SPRING '17 LOOK BOOK 2
 
Final Presentation
Final PresentationFinal Presentation
Final Presentation
 
Trabajo de metodologia de la investigacion
Trabajo de metodologia de la investigacionTrabajo de metodologia de la investigacion
Trabajo de metodologia de la investigacion
 
Walter Gropius | والتر جربيوس
Walter Gropius | والتر جربيوسWalter Gropius | والتر جربيوس
Walter Gropius | والتر جربيوس
 
Trebuchet Physics
Trebuchet PhysicsTrebuchet Physics
Trebuchet Physics
 
Tony Norton Jim Hassberger
Tony Norton Jim HassbergerTony Norton Jim Hassberger
Tony Norton Jim Hassberger
 
YEOT Spring 2015 Webinar 5: Catapults and Trebuchets
YEOT Spring 2015 Webinar 5: Catapults and TrebuchetsYEOT Spring 2015 Webinar 5: Catapults and Trebuchets
YEOT Spring 2015 Webinar 5: Catapults and Trebuchets
 
Reengineering of Topology Optimization Results - Inspire and PolyNURBS
Reengineering of Topology Optimization Results - Inspire and PolyNURBSReengineering of Topology Optimization Results - Inspire and PolyNURBS
Reengineering of Topology Optimization Results - Inspire and PolyNURBS
 
Lesson 1 parametric design 2 final
Lesson 1   parametric design 2 finalLesson 1   parametric design 2 final
Lesson 1 parametric design 2 final
 
Cad cam cae
Cad cam caeCad cam cae
Cad cam cae
 

Similar to ME 644 Trebuchet Parametric Design Optimization

VKI_RVAD_2005_Application_of_a_Lattice_Boltzmann_Code
VKI_RVAD_2005_Application_of_a_Lattice_Boltzmann_CodeVKI_RVAD_2005_Application_of_a_Lattice_Boltzmann_Code
VKI_RVAD_2005_Application_of_a_Lattice_Boltzmann_CodeNorbert Gruen
 
FEA Analysis & Re-Design of a Bicycle Crank Arm
FEA Analysis & Re-Design of a Bicycle Crank ArmFEA Analysis & Re-Design of a Bicycle Crank Arm
FEA Analysis & Re-Design of a Bicycle Crank Arm
Austen Leversage
 
Iaetsd estimation of damping torque for small-signal
Iaetsd estimation of damping torque for small-signalIaetsd estimation of damping torque for small-signal
Iaetsd estimation of damping torque for small-signal
Iaetsd Iaetsd
 
Transient three dimensional cfd modelling of ceilng fan
Transient three dimensional cfd modelling of ceilng fanTransient three dimensional cfd modelling of ceilng fan
Transient three dimensional cfd modelling of ceilng fan
Lahiru Dilshan
 
Iaetsd design of a robust fuzzy logic controller for a single-link flexible m...
Iaetsd design of a robust fuzzy logic controller for a single-link flexible m...Iaetsd design of a robust fuzzy logic controller for a single-link flexible m...
Iaetsd design of a robust fuzzy logic controller for a single-link flexible m...
Iaetsd Iaetsd
 
Oscillatory Stability Prediction Using PSO Based Synchronizing and Damping To...
Oscillatory Stability Prediction Using PSO Based Synchronizing and Damping To...Oscillatory Stability Prediction Using PSO Based Synchronizing and Damping To...
Oscillatory Stability Prediction Using PSO Based Synchronizing and Damping To...
journalBEEI
 
Analysis_methods_to_support_design_for_damping.pdf
Analysis_methods_to_support_design_for_damping.pdfAnalysis_methods_to_support_design_for_damping.pdf
Analysis_methods_to_support_design_for_damping.pdf
Shoaib Iqbal
 
The SpaceDrive Project - First Results on EMDrive and Mach-Effect Thrusters
The SpaceDrive Project - First Results on EMDrive and Mach-Effect ThrustersThe SpaceDrive Project - First Results on EMDrive and Mach-Effect Thrusters
The SpaceDrive Project - First Results on EMDrive and Mach-Effect Thrusters
Sérgio Sacani
 
9 Control Strategies for Variable-speed Fixed-pitch Win.docx
9 Control Strategies for Variable-speed  Fixed-pitch Win.docx9 Control Strategies for Variable-speed  Fixed-pitch Win.docx
9 Control Strategies for Variable-speed Fixed-pitch Win.docx
evonnehoggarth79783
 
VKI-RVAD-2005-BMW-Presentation
VKI-RVAD-2005-BMW-PresentationVKI-RVAD-2005-BMW-Presentation
VKI-RVAD-2005-BMW-PresentationNorbert Gruen
 
OPTIMAL TRAJECTORY OF ROBOT MANIPULATOR FOR ENERGY MINIMIZATION WITH QUARTIC ...
OPTIMAL TRAJECTORY OF ROBOT MANIPULATOR FOR ENERGY MINIMIZATION WITH QUARTIC ...OPTIMAL TRAJECTORY OF ROBOT MANIPULATOR FOR ENERGY MINIMIZATION WITH QUARTIC ...
OPTIMAL TRAJECTORY OF ROBOT MANIPULATOR FOR ENERGY MINIMIZATION WITH QUARTIC ...
cscpconf
 
Evaluation of Vibrational Behavior for A System With TwoDegree-of-Freedom Und...
Evaluation of Vibrational Behavior for A System With TwoDegree-of-Freedom Und...Evaluation of Vibrational Behavior for A System With TwoDegree-of-Freedom Und...
Evaluation of Vibrational Behavior for A System With TwoDegree-of-Freedom Und...
IJERA Editor
 
Modelling design and control of an electromechanical mass lifting system usin...
Modelling design and control of an electromechanical mass lifting system usin...Modelling design and control of an electromechanical mass lifting system usin...
Modelling design and control of an electromechanical mass lifting system usin...
Mustefa Jibril
 
International Refereed Journal of Engineering and Science (IRJES)
International Refereed Journal of Engineering and Science (IRJES)International Refereed Journal of Engineering and Science (IRJES)
International Refereed Journal of Engineering and Science (IRJES)
irjes
 
International Refereed Journal of Engineering and Science (IRJES)
International Refereed Journal of Engineering and Science (IRJES)International Refereed Journal of Engineering and Science (IRJES)
International Refereed Journal of Engineering and Science (IRJES)
irjes
 
Optimum designing of a transformer considering lay out constraints by penalty...
Optimum designing of a transformer considering lay out constraints by penalty...Optimum designing of a transformer considering lay out constraints by penalty...
Optimum designing of a transformer considering lay out constraints by penalty...
INFOGAIN PUBLICATION
 
Research Poster (48 x 32)
Research Poster (48 x 32)Research Poster (48 x 32)
Research Poster (48 x 32)Aakash Bajpai
 
Kane’s Method for Robotic Arm Dynamics: a Novel Approach
Kane’s Method for Robotic Arm Dynamics: a Novel ApproachKane’s Method for Robotic Arm Dynamics: a Novel Approach
Kane’s Method for Robotic Arm Dynamics: a Novel Approach
IOSR Journals
 
Kunyang_Li_AAS2016
Kunyang_Li_AAS2016Kunyang_Li_AAS2016
Kunyang_Li_AAS2016KunYang Li
 

Similar to ME 644 Trebuchet Parametric Design Optimization (20)

VKI_RVAD_2005_Application_of_a_Lattice_Boltzmann_Code
VKI_RVAD_2005_Application_of_a_Lattice_Boltzmann_CodeVKI_RVAD_2005_Application_of_a_Lattice_Boltzmann_Code
VKI_RVAD_2005_Application_of_a_Lattice_Boltzmann_Code
 
FEA Analysis & Re-Design of a Bicycle Crank Arm
FEA Analysis & Re-Design of a Bicycle Crank ArmFEA Analysis & Re-Design of a Bicycle Crank Arm
FEA Analysis & Re-Design of a Bicycle Crank Arm
 
Iaetsd estimation of damping torque for small-signal
Iaetsd estimation of damping torque for small-signalIaetsd estimation of damping torque for small-signal
Iaetsd estimation of damping torque for small-signal
 
Transient three dimensional cfd modelling of ceilng fan
Transient three dimensional cfd modelling of ceilng fanTransient three dimensional cfd modelling of ceilng fan
Transient three dimensional cfd modelling of ceilng fan
 
Iaetsd design of a robust fuzzy logic controller for a single-link flexible m...
Iaetsd design of a robust fuzzy logic controller for a single-link flexible m...Iaetsd design of a robust fuzzy logic controller for a single-link flexible m...
Iaetsd design of a robust fuzzy logic controller for a single-link flexible m...
 
Oscillatory Stability Prediction Using PSO Based Synchronizing and Damping To...
Oscillatory Stability Prediction Using PSO Based Synchronizing and Damping To...Oscillatory Stability Prediction Using PSO Based Synchronizing and Damping To...
Oscillatory Stability Prediction Using PSO Based Synchronizing and Damping To...
 
Analysis_methods_to_support_design_for_damping.pdf
Analysis_methods_to_support_design_for_damping.pdfAnalysis_methods_to_support_design_for_damping.pdf
Analysis_methods_to_support_design_for_damping.pdf
 
The SpaceDrive Project - First Results on EMDrive and Mach-Effect Thrusters
The SpaceDrive Project - First Results on EMDrive and Mach-Effect ThrustersThe SpaceDrive Project - First Results on EMDrive and Mach-Effect Thrusters
The SpaceDrive Project - First Results on EMDrive and Mach-Effect Thrusters
 
9 Control Strategies for Variable-speed Fixed-pitch Win.docx
9 Control Strategies for Variable-speed  Fixed-pitch Win.docx9 Control Strategies for Variable-speed  Fixed-pitch Win.docx
9 Control Strategies for Variable-speed Fixed-pitch Win.docx
 
VKI-RVAD-2005-BMW-Presentation
VKI-RVAD-2005-BMW-PresentationVKI-RVAD-2005-BMW-Presentation
VKI-RVAD-2005-BMW-Presentation
 
OPTIMAL TRAJECTORY OF ROBOT MANIPULATOR FOR ENERGY MINIMIZATION WITH QUARTIC ...
OPTIMAL TRAJECTORY OF ROBOT MANIPULATOR FOR ENERGY MINIMIZATION WITH QUARTIC ...OPTIMAL TRAJECTORY OF ROBOT MANIPULATOR FOR ENERGY MINIMIZATION WITH QUARTIC ...
OPTIMAL TRAJECTORY OF ROBOT MANIPULATOR FOR ENERGY MINIMIZATION WITH QUARTIC ...
 
Evaluation of Vibrational Behavior for A System With TwoDegree-of-Freedom Und...
Evaluation of Vibrational Behavior for A System With TwoDegree-of-Freedom Und...Evaluation of Vibrational Behavior for A System With TwoDegree-of-Freedom Und...
Evaluation of Vibrational Behavior for A System With TwoDegree-of-Freedom Und...
 
Vortex Modeling
Vortex ModelingVortex Modeling
Vortex Modeling
 
Modelling design and control of an electromechanical mass lifting system usin...
Modelling design and control of an electromechanical mass lifting system usin...Modelling design and control of an electromechanical mass lifting system usin...
Modelling design and control of an electromechanical mass lifting system usin...
 
International Refereed Journal of Engineering and Science (IRJES)
International Refereed Journal of Engineering and Science (IRJES)International Refereed Journal of Engineering and Science (IRJES)
International Refereed Journal of Engineering and Science (IRJES)
 
International Refereed Journal of Engineering and Science (IRJES)
International Refereed Journal of Engineering and Science (IRJES)International Refereed Journal of Engineering and Science (IRJES)
International Refereed Journal of Engineering and Science (IRJES)
 
Optimum designing of a transformer considering lay out constraints by penalty...
Optimum designing of a transformer considering lay out constraints by penalty...Optimum designing of a transformer considering lay out constraints by penalty...
Optimum designing of a transformer considering lay out constraints by penalty...
 
Research Poster (48 x 32)
Research Poster (48 x 32)Research Poster (48 x 32)
Research Poster (48 x 32)
 
Kane’s Method for Robotic Arm Dynamics: a Novel Approach
Kane’s Method for Robotic Arm Dynamics: a Novel ApproachKane’s Method for Robotic Arm Dynamics: a Novel Approach
Kane’s Method for Robotic Arm Dynamics: a Novel Approach
 
Kunyang_Li_AAS2016
Kunyang_Li_AAS2016Kunyang_Li_AAS2016
Kunyang_Li_AAS2016
 

ME 644 Trebuchet Parametric Design Optimization

  • 1. TREBUCHET PARAMETRIC DESIGN OPTIMIZATION Image taken from: http://joemonster.org/art/28956 Ben Johnson 4/20/2016 ME 644 Final Project: Trebuchet Parametric Design Optimization Comparative trebuchet design optimizations conducted with Matlab® (3 degree of freedom model) as well as ANSYS® (full 3D finite element model). PA R A M ETR I C D ES I G N O PTI M I ZA TI O N FO R R A N G E EFFI C I EN C Y
  • 2. ME 644 Final Project – Ben Johnson Page 1 INTRODUCTION | ONE Once upon a time, the trebuchet was a mighty medieval weapon used to hurl projectiles at the walls of a castle during the terror of a siege. Although today they may be more commonly associated with launching pumpkins for reality TV, the motion exhibited by a trebuchet is of academic interest to someone studying nonlinear dynamics. A trebuchet operates by converting the potential energy of a large raised mass to the kinetic energy of a projectile at the end of a sling. From an engineering standpoint we may quantify the effectiveness of a particular trebuchet design by the efficiency in which it completes this conversion. PROJECT OBJECTIVE | TWO The overall objective of this project is to apply parametric design optimization techniques in an attempt to arrive at an optimal solution for trebuchet design. Utilizing an online article “Trebuchet Mechanics” by Donald Siano [1] as a primary basis this project will also attempt to verify a couple assertions made in the article regarding optimum trebuchet design. The first assertion to be tested is that the maximum range efficiency1 of an idealized analytical model of a trebuchet is 83%. The second assertion to be tested is that including component mass in the model necessarily reduces the system efficiency below 83%. Although the 2D model provides both a revealing analytical tool and a promising starting point for a real design, it is a mathematical abstraction whose assumptions do not hold up in reality. Addressing the reduction in range efficiency upon the inclusion of component mass will involve applying an ANSYS response surface optimization to a parametric trebuchet design and comparing efficiency results achieved by the 2D and 3D models. The ANSYS model overcomes the limitations of the analytical model providing for the inclusion of realistic considerations such as part dimensions, material properties, and factors of safety. BACKGROUND | THREE Geometry of the Trebuchet Centuries of design iterations have produced several popular trebuchet designs available for present day analysis. The type of trebuchet to be considered for this project may be described by its two main characteristics, a hinged counterweight and projectile sling. 1 Range efficiency defined in section three (Background).
  • 3. ME 644 Final Project – Ben Johnson Page 2 Figure 1.1 Trebuchet Diagram with Dimension Definitions The variable parameters available to the designer include the illustrated lengths L1-L4 as well as the masses of the counterweight and projectile m1 and m2 respectively. Trebuchet Operation A trebuchet is loaded by rotating the main beam to elevate the counterweight thus imparting to the weight some potential energy. A firing mechanism fixes the beam rotation maintaining the weight in the elevated position until ready to fire. A projectile is loaded to the sling whose attachment to the main beam provides for releasing the projectile at some predetermined angle. When ready to launch, the firing mechanism is unlocked and the weight of m1 imparts an angular acceleration to the beam. The beam motion is transferred to the projectile through the sling whose rotation accelerates through an arc until reaching the predetermined firing angle at which point the sling partially disengages from the beam thus releasing the projectile. Figure 3.2 Illustration of Trebuchet Operation2 2 Image obtained from online resource at http://www.tasigh.org/ingenium/physics.html
  • 4. ME 644 Final Project – Ben Johnson Page 3 Trebuchet Efficiency Although the efficiency of a trebuchet may be described in multiple ways, the means chosen for this analysis is what Siano has designated “range efficiency” in “Trebuchet Mechanics.” The range efficiency in this context is the ratio of a given trebuchet’s range to the range of an idealized trebuchet where the total potential energy of the counterweight is converted to the kinetic energy of the projectile and the projectile is released at the optimum angle of 45 degrees. The formula for range efficiency is straightforward to obtain and is verified in multiple online resources to be: 𝑅𝑎𝑛𝑔𝑒 𝐸𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑐𝑦 = 𝑚2 𝑣0 2(𝑠𝑖𝑛𝛼)(𝑐𝑜𝑠𝛼) 𝑚1 𝑔 ℎ Eq 3.1 Where v0 is the projectile release velocity, α is the angle of v0 measured with respect to the horizontal ground, g is the acceleration due to gravity, and h is the vertical travel of the counterweight. As was previously mentioned, “Trebuchet Mechanics” asserts the maximum range efficiency for the hinged counterweight/projectile sling type of trebuchet to be 83%. A major goal of this paper is to verify this maximum because although other sources [2] [3] make reference to this optimum basis independent verifications of the theoretical maximum have not been forthcoming. TWO DIMENSIONAL MODEL (MATLAB®) | FOUR Assumptions of the 2D model The two dimensional model assumes that the only system components to exhibit mass are the counterweight and the projectile. All components are assumed to be rigid and all connections are assumed to be frictionless. All aerodynamics forces are neglected as was done in “Trebuchet Mechanics” and all simulations use a starting angle for the beam of 45 degrees from vertical i.e. the beam rotates through 135 degrees to the point of minimum potential energy upon firing. Defining the Lagrangian The Lagrangian of the system may be defined with respect to the potential and kinetic energies of the system components. It is similar to that of a double pendulum but with an additional pendulum segment (the counterweight and pivot) which points upwards contributing similar but opposite sign terms to the equation. 𝑇 (𝑖. 𝑒. 𝐾𝑖𝑛𝑒𝑡𝑖𝑐 𝐸𝑛𝑒𝑟𝑔𝑦) = 1 2 𝜃̇1 2 (𝑚1 𝐿1 2 + 𝑚2 𝐿4 2 + 𝜃̇1 [2𝐿3 𝐿4 𝑚2 𝜃̇3 cos( 𝜃1 − 𝜃3 ) − 2𝐿1 𝐿2 𝑚1 𝜃̇2 cos( 𝜃1 − 𝜃2 )] + 𝐿2 2 𝑚1 𝜃̇2 2 + 𝐿3 2 𝑚2 𝜃̇3 2 ) Eq 4.1 𝑉 (𝑖. 𝑒. 𝑃𝑜𝑡𝑒𝑛𝑡𝑖𝑎𝑙 𝐸𝑛𝑒𝑟𝑔𝑦) = 𝑔𝑐𝑜𝑠( 𝜃1)(𝐿4 𝑚2 − 𝐿1 𝑚1 ) + 𝑔𝐿2 𝑚1cos(𝜃2 ) + 𝑔𝐿3 𝑚2cos(𝜃3 ) Eq 4.2 The Lagrangian is:
  • 5. ME 644 Final Project – Ben Johnson Page 4 𝐿 = 𝑇 − 𝑉 Eq 4.3 And the equations of motion are produced for each coordinate, qj, according to: 𝑑 𝑑𝑡 ( 𝜕𝐿 𝜕𝑞̇ 𝑗 ) − ( 𝜕𝐿 𝜕𝑞 𝑗 ) = 0 Eq 4.4 Evaluating Eq. 4.4 for each qj, (θ1, θ2, θ3) provides the following 3 equations of motion for the system: 𝑚1 𝐿1 2 𝜃̈1 + 𝑚2 𝐿4 2 𝜃̈1 − 𝐿1 𝐿2 𝑚1 𝜃̇2 2 sin( 𝜃1 − 𝜃2) − 𝐿1 𝐿2 𝑚1 𝜃̈2cos( 𝜃1 − 𝜃2 ) + 𝐿3 𝐿4 𝑚2 𝜃̇3 2 sin( 𝜃1 − 𝜃3) + 𝐿3 𝐿4 𝑚2 𝜃̈3cos( 𝜃1 − 𝜃3) − 𝑔𝐿1 𝑚1 sin( 𝜃1 ) + 𝑔𝐿4 𝑚2sin( 𝜃1) = 0 Eq 4.5 𝐿2 𝜃̈2 + 𝐿1 𝜃̇1 2 sin( 𝜃1 − 𝜃2) − 𝐿1 𝜃̈1cos( 𝜃1 − 𝜃2) + 𝑔 sin( 𝜃2) = 0 Eq 4.6 𝐿3 𝜃̈3 − 𝐿4 𝜃̇1 2 sin( 𝜃1 − 𝜃3) + 𝐿4 𝜃̈1cos( 𝜃1 − 𝜃2) + 𝑔 sin( 𝜃3) = 0 Eq 4.7 Formatting the Equations of Motion for Runge-Kutta In order to simulate the system motion equations 4.5-4.7 must be formatted in a manner suitable for a Runge- Kutta solver. By representing the equations in matrix form and utilizing Gaussian elimination, the equations3 may be rearranged so that each includes only a single acceleration term. The equations may then be transposed to a state space representation providing six first order expressions for the state variable derivatives which are ready to be solved with Matlab. Optimizing System Design Parameters Utilizing the Matlab function “fmincon” the system may be optimized for range efficiency. The output of the optimization is provided in figure 4.1. The syntax required to pass extra arguments (L2-L4 and M2 in this case) to the Matlab built in ODE45 function may be found in the appendix. Another special provision found in the appendix is the events function which stops ODE45 execution once a given value of sling rotation is achieved. Adding events was necessary to bound the objective function output since changing the system parameters significantly impacts the operational period of the trebuchet. 3 See appendix for Matlab® .m file code.
  • 6. ME 644 Final Project – Ben Johnson Page 5 Figure 4.1 Optimization Results As can be seen in the figure, after 20 iterations a new optimum basis which provides the underlined value of 92.6% range efficiency has been produced. The “final point” values of 4.846, 1.737, 4.12, and 130.024 correspond to parameters L2, L3, L4, and M1 respectively. Length L1 is given a value of 1m and projectile mass is given a value of 1kg. A plot of the motion is displayed in figure 4.2 below.
  • 7. ME 644 Final Project – Ben Johnson Page 6 Figure 4.2 System Motion for Optimum Basis The lower datatip displays the max range efficiency of 92.6% occurring at t=0.693 seconds and the upper datatip shows the sling rotation of 2.418 radians (for t=0.693 seconds) which corresponds to an angle of 38 degrees with the ground (this is not the same as projectile velocity relative to horizontal). The physical meaning of the chart is admittedly difficult to appreciate without a graphical rendering of the motion. At this point it is sufficient to convey that the motion of the beam is arrested very near the optimum point of release. This indicates that the rotational energy of the beam has been efficiently converted to sling rotation and that the timing of this conversion is near optimal. Justification for New Optimum Basis The optimization presented herein differs from that of “Trebuchet Mechanics” in a couple aspects. First of all, in “Trebuchet Mechanics” the optimization was performed on individual parameters as a ratio to a single other parameter. In effect, only one parameter was optimized at a time. The fmincon function presented here approaches the optimum basis by varying all parameters at once. In this way interacting terms in the objective function can be optimized as well as the first order terms. The second difference between optimization methods was that for “Trebuchet Mechanics” a “Monte Carlo” method of optimization was used. Monte Carlo in this context amounts to testing the objective function for a series of random parameter values. The method applied by the fmincon function uses knowledge of the objective function gradients relative to decision variables to direct its iterative progression toward an optimum basis. The combination of these two differences provides justification for the improved performance of the new trebuchet design.
  • 8. ME 644 Final Project – Ben Johnson Page 7 THREE DIMENSIONAL MODEL (ANSYS)| SIX Additional Considerations of the 3D Model For the finite element model the dimensions and material of each component are included. Material considerations include but are not limited to density, Young’s modulus, Poisson’s ratio, tensile and compressive yield strength. All of the prior system length and mass parameters (L1-L4 and M1-M2) are still included in the optimization with the addition of various component dimensions critical to system function and stresses encountered during operation. Optimizing Part and Assembly Geometry The ANSYS response surface optimization feature was utilized to tune the range efficiency of the 3D model. While the geometry of the counterweight arm and the projectile sling were optimized for stresses, the impact of their cross section on range efficiency was of insufficient significance to justify investigating any sort of tapered designs. The beam, on the other hand, is a different story. The inclusion of several geometric parameters was necessary to achieve maximum range efficiency. The most important aspect of the beam is the tapered portion which becomes narrower approaching the sling connection. This design aspect reduces the moment of inertia of the beam but must be optimized against bending stresses encountered during operation. The geometry was created by defining a spline from the corners near the pivot to the corners near the sling, the length of which is defined by dimensions L21+L46. The construction points that are set a width of L22 apart control the rapidity of the taper. Length L21 sets the distance of the taper point from the start of the spline. Length L44 at the bottom right sets the final tapered beam width. The length of the beam extending prismatically beyond the spline is set by L26, the dimension which corresponds to L4 in the 2D model. The second most important aspect of the geometry is the widened portion to the left of the pivot (located at the origin) which moves the center of mass in that direction.
  • 9. ME 644 Final Project – Ben Johnson Page 8 Figure 6.1 Beam Geometry and Dimensioning Scheme Optimal Solution After several design iterations, a maximum range efficiency of 83% was achieved by the ANSYS model with a minimum beam factor of safety around 2. Factors of safety for all other parts are >10. All parts are specified as steel except the sling which is polyethylene. Beam dimensions for the final design may be found in figure 6.2. Figure 6.2 Beam Final Dimensions, Range Efficiency, and Minimum Factor of Safety Behavior of Optimized Trebuchet
  • 10. ME 644 Final Project – Ben Johnson Page 9 Results of the ANSYS optimization model indicate that the inclusion of component mass and flexibility need not lead to a dramatic reduction in trebuchet efficiency. It becomes clear upon watching the simulation4 that for an efficiently designed trebuchet almost all rotational motion imparted to the beam by the counterweight is passed on to the projectile sling at as close to the optimum release angle as is feasible. CONCLUSIONS|SIX The models presented herein have achieved their intended purpose. Applying an improved optimization method to the analytical model has been demonstrated to increase the theoretical range efficiency of a trebuchet beyond the previously asserted value of 83% to 92%. In addition, the inclusion of component dimensions and stresses encountered has been shown to be of limited impact to the theoretical efficiency. If more time was spent on the ANSYS model the efficiency could no doubt be further increased possibly approaching the 92% provided by the Matlab simulation. Although the improvement in range efficiency is a positive result, it seems the time savings reaped from the technique is the most significant. In this instance, the application of modern computational tools replaced countless design iteration by a few weeks of simulation. The progress produced by these evolving tools should be remarkable to witness, assuming they don’t produce robots wielding optimized trebuchets. REFERENCES| SEVEN [1] D. Siano, “Trebuchet Mechanics,” Accessedonline: http://www.aemma.org/training/trebuchet/trebmath35.pdf. 2001. [2] E. Mahieu, “Optimizingthe Counterweight Trebuchet,”Accessedonline: http://demonstrations.wolfram.com/OptimizingTheCounterweightTrebuchet/. 2012 [3] M. Senese, “Tuninga Trebuchet for Maximum Distance,”Accessedonline: http://www.mikesenese.com/DOIT/2010/12/tuning-a-trebuchet/2012. 2010. APPENDIX| EIGHT Equations of Motion: State Space .m File function thetadot=TrebODEfcn(t,theta,L1,L2,L3,L4,m1,m2,g); %% Function outputs state variable values %% Variables to achieve Gaussian elimination a=[(m2*g*L4-m1*g*L1)*sin(theta(1))-m1*L1*L2*theta(4)^2*sin(theta(1)- theta(3))+m2*L3*L4*theta(6)^2*sin(theta(1)-theta(5))]; b=g*sin(theta(3))+L1*sin(theta(1)-theta(3))*theta(2)^2; c=g*sin(theta(5))-L4*sin(theta(1)-theta(5))*theta(2)^2; 4 A video of the motion may be viewed online at: https://youtu.be/cinPR2tznsU
  • 11. ME 644 Final Project – Ben Johnson Page 10 d=(m1*L1^2+m2*L4^2)-L1*cos(theta(1)-theta(3))*m1*L1*cos(theta(1)-theta(3))- L4*cos(theta(1)-theta(5))*m2*L4*cos(theta(1)-theta(5)); e=[a+b*m1*L1*cos(theta(1)-theta(3))-c*m2*L4*cos(theta(1)-theta(5))]/d; thetadot(1,1)=theta(2); thetadot(2,1)=-1*e; thetadot(3,1)=theta(4); thetadot(4,1)=-1*[b+e*L1*cos(theta(1)-theta(3))]/L2; thetadot(5,1)=theta(6); thetadot(6,1)=-1*[c-e*L4*cos(theta(1)-theta(5))]/L3; end Function to Apply Runge-Kutta to EOM’s and Report Range Efficiency function [mineR,t,theta,eR,v0sqr]=runTrebODEfcn(x); %% Function called by optimization routine fmincon which tries to minimize –1*(max efficiency ratio) %% Establish parameter values passed to function by x() l2=x(1); l3=x(2); l4=x(3); M1=x(4); L1=1; %% these two parameters held constant at 1 m2=1; g=9.81; L2=l2; L3=l3; L4=l4; m1=M1; opts=odeset('Events',@events); %% Set ode45 options (Stops integration when rotation of sling reaches 180 deg) [t,theta]=ode45(@(t,theta)TrebODEfcn(t,theta,L1,L2,L3,L4,m1,m2,g),[0.01:1e- 4:2],[pi/4,0,0,0,0,0],opts); %% Runs ode45 v0sqr=L4^2*(theta(:,2).^2)+L3^2*(theta(:,6).^2)+2*L4*L3*theta(:,2).*theta(:,6).*cos (theta(:,1)-theta(:,5)); %% Calculates velocity squared vs time for efficiency calc h=L1*sin(pi/4)+L1; %% calculate distance counterweight falls xvel=L4*theta(:,2).*cos(pi-theta(:,1))+L3*theta(:,6).*cos(pi-theta(:,5)); %%y velocity of projectile
  • 12. ME 644 Final Project – Ben Johnson Page 11 yvel=-1*L1*theta(:,2).*sin(pi-theta(:,1))-1*L3*theta(:,6).*cos(pi-theta(:,5)); %% x velocity of projectile alpha=atan(yvel./xvel); %% angle of projectile velocity eR=(m2/m1)*v0sqr.*sin(alpha).*cos(alpha)/9.81/h; %% Calculate efficiency ratio [mineR]=min(eR); %% Find minimum of efficiency ratio end Function to Stop ODE45 Integration When Sling Rotation is 180 ° function[value,isterminal,direction]=events(t,theta) value=theta(5)-pi; %detect theta3 = 180 deg isterminal=1; %stop integration direction=1; %positive rotation end