MAMBO logo MAMBO & the MAMBO Toolbox MAMBO logo

Sample project - Bead on Block

To illustrate a complete Mambo project using only translations.

This Mambo project contains a non-stationary bead and a stationary wireframe representation of a block. The non-stationary block may be positioned relative to the world observer by imposing an arbitrary translation.

l1, l2, and l3: lengths of the sides of the block.

q1, q2, and q3: Cartesian coordinates of the center of the bead relative to a coordinate system based at the center of the block with coordinate axes parallel to the edges of the block.

Modify the Mambo project so that the bead visits every corner of the block and briefly flashes red when a corner is reached.

beadonblock.zip (zip file, 6 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(seq(cat(E,i,j),i=1..3),j=1..4)):
>DeclareTriads(w):
>DefineObservers([W,W,w],[A,A,w]):
>DefinePoints([W,A,w,q1,q2,q3],[W,E11,w,0,l2/2,l3/2],[W,E12,w,0,l2/2,-l3/2],[W,E13,w,0,-l2/2,-l3/2],[W,E14,w,0,-l2/2,l3/2],[W,E21,w,l1/2,0,l3/2],[W,E22,w,l1/2,0,-l3/2],[W,E23,w,-l1/2,0,-l3/2],[W,E24,w,-l1/2,0,l3/2],[W,E31,w,l1/2,l2/2,0],[W,E32,w,l1/2,-l2/2,0],[W,E33,w,-l1/2,-l2/2,0],[W,E34,w,-l1/2,l2/2,0]):
>DefineNeighbors([W,A]):

Click here to expand/contract!
>DefineObjects(
   seq([W,'Block',point=cat(E,1,j),xlength=l1,ylength=(l1+l2+l3)/30,zlength=(l1+l2+l3)/30],j=1..4),
   seq([W,'Block',point=cat(E,2,j),xlength=(l1+l2+l3)/30,ylength=l2,zlength=(l1+l2+l3)/30],j=1..4),
   seq([W,'Block',point=cat(E,3,j),xlength=(l1+l2+l3)/30,ylength=(l1+l2+l3)/30,zlength=l3],j=1..4)):
>DefineObjects([A,'Sphere',radius=(l1+l2+l3)/20,color=red]):

Click here to expand/contract!
>GeometryOutput(main=W,parameters=[l1,l2,l3],states=[q1,q2,q3],checktree,checkargs,filename="beadonblock.geo"):
>MotionOutput(ode={q1t=u1,q2t=u2,q3t=u3},states=[q1=-.5,q2=-.25,q3=-.125],parameters=[l1=1,l2=.5,l3=.25],insignals=[u1=l1*((t&>=0)*(t&<1)-(t&>=4)*(t&<5)),u2=l2*((t&>=1)*(t&<2)-(t&>=3)*(t&<4)),u3=l3*((t&>=2)*(t&<3)-(t&>=5)*(t&<6))],checksings,checkargs,filename="beadonblock.dyn"):

Sample projects