You are on page 1of 5

9/23/12

Symbolic Math Toolbox - Videos & Examples


UnitedStates ContactUs Store CreateAccount LogIn

Acceleratingthepaceofengineeringandscience

Products&Services Products&Services

Solutions

Academia

Support

UserCommunity

Events

Company

SymbolicMathToolbox

Videos&Examples

Symbolic Math Toolbox


ModelingtheMotionofanAutomotivePiston
ThisexampleusesSymbolicMathToolboxtomodelthemotionofasimpleautomotivepiston.
TRYORBUY

Share

ContactSales ProductTrial PricingandLicensing

Where: TDCandBDC=topdeadcenterandbottomdeadcenter B=bore(i.e.,diameterofthecylinder) Llengthoftheconnectingrod Sstrokelength acrankradius crankangle

CalculatePistonHeight
Aschematicofthecrankandconnectingrod(includingrelevantdimensions)isbelow:

www.mathworks.com/products/symbolic/examples.html?file=/products/demos/symboli

1/5

9/23/12

Symbolic Math Toolbox - Videos & Examples


WewouldliketodefinepistonheightrelativetotheBDCposition.Theheightrelativetothecrankorigincanbecalculated throughtrigonometryas .AttheBDCposition,heightrelativetothecrankoriginis

.TocalculatepistonheightrelativetoBDCposition,wesimplysubtracttheterms. pistHeight:=(L,a,`&theta`)>a*cos(`&theta`)+ sqrt(L^2a^2*sin(`&theta`)^2)(La)

Weplotpistonheightasafunctionofcrankangle()foronerevolution,assumingaconnectingrodlength(L)of150mm andcrankradius(a)of50mm. plot(pistHeight(150,50,`&theta`),`&theta`=0..2*PI, AxesTitles=["Crankangle(rad)","Height(mm)"])

Asexpected,pistonheightishighestwhencrankangleequals0and2 .Wecanalsocreateasurfaceplottovisualizehow heightchangeswithbothcrankangleandcrankradius. plot(#3D,pistHeight(150,a,`&theta`),a=30..60,`&theta`=0..2*PI, AxesTitles=["Crankradius(mm)","Crankangle(rad)","Height(mm)"])

CalculateVolumeofPistonCylinder
ThemaximumvolumeinthepistonchamberoccurswhenthepistonisattheBDCposition.Atthatpositon,volumecanbe expressedas .Ingeneral,volumecanbeexpressedas ,whereHispistonheight

www.mathworks.com/products/symbolic/examples.html?file=/products/demos/symboli

2/5

9/23/12

Symbolic Math Toolbox - Videos & Examples


relativetoBDCposition(definedabove).Wedefineanexpressionforvolume,substitutingstrokelength(S)with2a: pistVol:=(L,a,`&theta`,B)>PI*(B/2)^2*(2*apistHeight(L,a,`&theta`))

Wenowplotvolumeasafunctionofcrankangle()foronerevolution,assumingthefollowingparameters: L(lengthofconnectingrod)=150mm a(crankradius)=50mm B(bore)=85mm plot(pistVol(150,50,`&theta`,85),`&theta`=0..2*PI, AxesTitles=["Crankangle(rad)","Volume(mm^3)"])

CalculateSurfaceAreaofPistonCylinder
Surfaceareaisdefinedsimilartovolume.Thesurfaceareaofthecylinderheadandthepistonheadarebothapproximately ,whiletheareaofthewallis with2a: pistSA:=(L,a,`&theta`,B)>2*PI*(B/2)^2+PI*B*(2*apistHeight(L,a,`&theta`)) .Wedefineanexpressionforsurfacearea,againsubstituting(S)

Weplotsurfaceareaforapistonwithdimensionsdefinedintheprevioussection. plot(pistSA(150,50,`&theta`,85),`&theta`=0..2*PI,AxesTitles=["Crankangle(rad)", "Surfacearea(mm^2)"])

www.mathworks.com/products/symbolic/examples.html?file=/products/demos/symboli

3/5

9/23/12

Symbolic Math Toolbox - Videos & Examples

EvaluatePistonMotionforChangingAngularVelocities
Assumethecrankrotatesat1000rpm(105rad/sec)for1second,thensteadilyincreasesfrom1000to2000rpmfor1 second,andthenremainsat2000rpm.Wedefineapiecewisefunctiontodefineangularvelocity. angVel:=t>piecewise([t<=1,105],[t>1andt<=2,(210105)*t], [t>2,210])

Wecalculatecrankanglebyintegratingangularvelocity. angPos:=int(angVel(t),t)

Wesubstitutetheresultingcrankangleintoourexpressionforpistonheight,andplotpistonheightfromt=1tot=2,wherethe angularvelocityissteadilyincreasing.Notetheincreaseinfrequency. pistHeight(150,50,angPos)

plot(pistHeight(150,50,angPos),t=1..2,AxesTitles=["time(sec)", "Height(mm)"])

www.mathworks.com/products/symbolic/examples.html?file=/products/demos/symboli

4/5

9/23/12

Symbolic Math Toolbox - Videos & Examples

AnimatePistonMotion
Weanimatepistonmotionforonefullrevolution( = 0 t o = 2 ) forapistonwithconnectingrodlength(L)=150mm, crankradius(a)=50mm,andbore(B)=85mm.Thisanimationwascreatedinaseparatenotebookandcopiedintothis notebook.Theabilitytocopygraphicsandanimationsbetweennotebooksisusefulwhenuserswanttodocument supportinganalysiswithouthavingthecodedisplayedinthenotebook.

Thecodeusedtocreatethisanimationisavailablehere.

19942012TheMathWorks,Inc.

SiteHelp

Patents

Trademarks

PrivacyPolicy

PreventingPiracy

Jointheconversation

www.mathworks.com/products/symbolic/examples.html?file=/products/demos/symboli

5/5

You might also like