MAMBO logo MAMBO & the MAMBO Toolbox MAMBO logo

Sample project - Bead on Sphere

To illustrate the use of sequences of pure rotations to effect changes in position.

This Mambo project contains a non-stationary bead, a non-stationary block and one stationary sphere. The non-stationary bead is fixed with respect to the non-stationary block. The non-stationary block may be reoriented relative to the world observer in two independent steps, namely
  1. Impose a rotation about the 3-direction of the world reference triad.
  2. Impose a subsequent rotation about the 1-direction of the world reference triad.

l1, l2, and l3: lengths of the sides of the block.
R: distance of the bead from the center of the block.
marker: radius of the bead.

theta: angle of rotation of the block about the 3-direction of the world reference triad.
phi: angle of the subsequent rotation of the block about the 1-direction of the world reference triad.

Animate the predefined motion and make use of the wiremesh view.

bead.zip (zip file, 7 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,B,A):
>DeclarePoints(W,seq(seq(cat(E,i,j),i=1..3),j=1..4)):
>DeclareTriads(w,b,a):
>DefineObservers([W,W,w],[B,W,b],[A,W,a]):
>DefinePoints([W,E11,a,0,l2/2,l3/2],[W,E12,a,0,l2/2,-l3/2],[W,E13,a,0,-l2/2,-l3/2],[W,E14,a,0,-l2/2,l3/2],[W,E21,a,l1/2,0,l3/2],[W,E22,a,l1/2,0,-l3/2],[W,E23,a,-l1/2,0,-l3/2],[W,E24,a,-l1/2,0,l3/2],[W,E31,a,l1/2,l2/2,0],[W,E32,a,l1/2,-l2/2,0],[W,E33,a,-l1/2,-l2/2,0],[W,E34,a,-l1/2,l2/2,0]):
>DefineTriads(w,b,theta,3):
>DefineTriads(b,a,phi,seq(MakeTranslations(w,1) &oo MakeTranslations(b,i),i=1..3)):
>DefineNeighbors([W,B],[B,A]):

Click here to expand/contract!
>DefineObjects([W,'Sphere',radius=R*(1-exp(-(t-2))),color=yellow]):
>DefineObjects(
seq([A,'Block',point=cat(E,1,j),xlength=l1,ylength=(l1+l2+l3)/30,zlength=(l1+l2+l3)/30],j=1..4),
seq([A,'Block',point=cat(E,2,j),xlength=(l1+l2+l3)/30,ylength=l2,zlength=(l1+l2+l3)/30],j=1..4),
seq([A,'Block',point=cat(E,3,j),xlength=(l1+l2+l3)/30,ylength=(l1+l2+l3)/30,zlength=l3],j=1..4)):
>DefineObjects([A,'Sphere',point=MakeTranslations(a,R,0,0),radius=marker,color=red]):

Click here to expand/contract!
>GeometryOutput(main=W,states=[theta,phi],parameters=[R,l1,l2,l3,marker],checktree,checkargs,filename="bead.geo");
>MotionOutput(ode={thetat=u1,phit=u2},states=[theta,phi],parameters=[R=1,l1=1,l2=.5,l3=.25,marker=.2],insignals=[u1=(t&>=0)*(t&<1)+cos(sin(t))*(t&>=5),u2=(t&>=1)+sin(cos(t))*(t&>=5)],checkargs,checksings,filename="bead.dyn");

Sample projects