MAMBO logo MAMBO & the MAMBO Toolbox MAMBO logo

Sample project - Flopping tetrahedron

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)
This zip archive contains MAMBO and the MAMBO toolbox source files to visualize the MAMBO project and regenerate visualization files using maple 16, mupad 5.6.0 (matlab R2011a), and mathematica 8.0 versions of the code found below.


Click here to expand/contract!
>Restart():

Click here to expand/contract!
>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]):

Click here to expand/contract!
>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]):

Click here to expand/contract!
>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");

Sample projects