Home Toolbox functions Sample projects Tutorials Downloads |
|
Reference: Chapter 6 in Multibody Mechanics and Visualization by Harry Dankowicz, published by Springer Verlag UK, 2004.
To illustrate a complete Mambo project using rotations.
This Mambo project contains a non-stationary tetrahedral arrangement of blocks and a stationary plane.
l: length of the edges of the tetrahedron.
There are no state variables in this project. The animated variables q1 and q2 represent rotations of the tetrahedron about an axis perpendicular to the plane and about one of the edges of the tetrahedron.
Introduce additional configuration coordinates into the Mambo project corresponding to angles of rotation about each of the three edges emenating from the stationary corner of the tetrahedron and use these to generate a flopping motion without the need for a separate rotation about the axis perpendicular to the plane.
floppingtetrahedron.zip (zip file, 5 kb, December 30, 2012) >Restart(): >DeclareObservers(W,A): >DeclarePoints(W,A,seq(cat(E,i),i=1..6),seq(cat(C,i),i=1..3)): >DeclareTriads(w,a,seq(cat(e,i),i=1..6)): >DefineObservers([W,W,w],[A,A,a]): >DefinePoints([W,A,NullVector()],[A,C1,a,l,0,0],[A,C2,a,1/2*l,sqrt(3)/2*l,0],[A,C3,a,1/2*l,sqrt(3)/6*l,sqrt(6)/3*l]): >DefinePoints([A,E1,(1/2) &** FindTranslation(A,C1)],[A,E2,(1/2) &** FindTranslation(A,C2)],[A,E3,(1/2) &** FindTranslation(A,C3)],[A,E4,(1/2) &** (FindTranslation(A,C1) &++ FindTranslation(A,C2))],[A,E5,(1/2) &** (FindTranslation(A,C1) &++ FindTranslation(A,C3))],[A,E6,(1/2) &** (FindTranslation(A,C2) &++ FindTranslation(A,C3))]): >DefineTriads(w,a,[q1,3],[q2,1/2,sqrt(3)/2,0]): >b1:=(1/l) &** FindTranslation(A,C1): >b2:=(1/VectorLength(b1 &xx MakeTranslations(a,3))) &** (b1 &xx MakeTranslations(a,3)): >b3:=b1 &xx b2: >DefineTriads(a,e1,Matrix(3,3,(i,j)->MakeTranslations(a,i) &oo cat(b,j))): >b1:=(1/l) &** FindTranslation(A,C2): >b2:=(1/VectorLength(b1 &xx MakeTranslations(a,3))) &** (b1 &xx MakeTranslations(a,3)): >b3:=b1 &xx b2: >DefineTriads(a,e2,Matrix(3,3,(i,j)->MakeTranslations(a,i) &oo cat(b,j))): >b1:=(1/l) &** FindTranslation(A,C3): >b2:=(1/VectorLength(b1 &xx MakeTranslations(a,3))) &** (b1 &xx MakeTranslations(a,3)): >b3:=b1 &xx b2: >DefineTriads(a,e3,Matrix(3,3,(i,j)->MakeTranslations(a,i) &oo cat(b,j))): >b1:=(1/l) &** FindTranslation(C1,C2): >b2:=(1/VectorLength(b1 &xx MakeTranslations(a,3))) &** (b1 &xx MakeTranslations(a,3)): >b3:=b1 &xx b2: >DefineTriads(a,e4,Matrix(3,3,(i,j)->MakeTranslations(a,i) &oo cat(b,j))): >b1:=(1/l) &** FindTranslation(C1,C3): >b2:=(1/VectorLength(b1 &xx MakeTranslations(a,3))) &** (b1 &xx MakeTranslations(a,3)): >b3:=b1 &xx b2: >DefineTriads(a,e5,Matrix(3,3,(i,j)->MakeTranslations(a,i) &oo cat(b,j))): >b1:=(1/l) &** FindTranslation(C2,C3): >b2:=(1/VectorLength(b1 &xx MakeTranslations(a,3))) &** (b1 &xx MakeTranslations(a,3)): >b3:=b1 &xx b2: >DefineTriads(a,e6,Matrix(3,3,(i,j)->MakeTranslations(a,i) &oo cat(b,j))): >DefineNeighbors([W,A]): >DefineObjects( seq([A,'Block',point=cat(E,i),orient=cat(e,i),xlength=l,ylength=l/10,zlength=l/10,color=green],i=1..6), [W,'Block',xlength=5*l,ylength=5*l,zlength=l/100,color=white]): >GeometryOutput(main=W,anims=[q1=Pi/3*floor(t),q2=(acos(1/3)-Pi)*(t-floor(t))],parameters=[l=1],checktree,checkargs,filename="floppingtetrahedron.geo"); >MotionOutput(ode={},anims=[q1=Pi/3*floor(t),q2=(acos(1/3)-Pi)*(t-floor(t))],parameters=[l=1],filename="floppingtetrahedron.dyn"); |
©2004-2017 Harry Dankowicz Mechanical Science and Engineering University of Illinois at Urbana-Champaign | Home Toolbox functions Sample projects Tutorials Downloads |