80 likes | 199 Views
Elastic Collisions & Sierpinski Carpet. Anakaren Santana. Elastic Collisions. Momentum is Conserved : Kinetic Energy is Conserved : Where U’s are velocities before the collision and V’s are velocities after the collision .
E N D
ElasticCollisions &SierpinskiCarpet Anakaren Santana
ElasticCollisions • Momentum isConserved: • KineticEnergyisConserved: • WhereU’s are velocitiesbeforethecollision and V’s are velocitiesafterthecollision. • Usingtheseequationsyou can solvefor and calculatethe position of eachmass at a given time ( x = V*t)
Method • Set up initialconditions (makesurebothmasseswillactuallycollide). • Forloopchanges positions of themassesaccordingtotheirrespectivevelocities. • Anifstatementchecksifthemassescollide. Whentheycollidethe new velocities are calculated and initial positions reset. • A secondforloopchangesthe positions of themassesaccordingtothese new velocities and initialcoordinates.
1D: m1=2 m2=2, U1=2 U2=0, x01=0 x02=20RunCodeWith: elasticCollision.m
2D: m1=2 m2=4, Ux1=4 Uy2=4, Ux2=-1 Uy2=-1, x01=-90 y01=-90, x02=90 y02=90RunCodeWith: elasticCollision2D.m
TheSierpinskiCarpetis a fractal of fractal dimension 1.8929. • Itbeginswith a squarethatyou divide into 9 sub-squares and removethe center square. Repeattheprocesswitheachsubsquare. • Method: • Nestedforloopswithin a whileloop. • Thewhileloopensuresthatwe can keepdividingby 3. • Thenestedforloops “remove” theappropriatesquares in eachiteration.