MAMBO logo MAMBO & the MAMBO Toolbox MAMBO logo

Sample project - Block

To illustrate
  • the changes in configuration of a rigid body relative to the reference configuration that occur as a result of pure translations, pure rotations, and combinations thereof;
  • the nonuniqueness of the decomposition of an arbitrary configuration into a combination of a pure translation and a pure rotation;
  • the association between position and orientation on the one hand and the unique pure translation and pure rotation that result from a specific choice of point kept fixed by the pure rotation;
  • the use of independent coordinates to specify the position and orientation of a rigid body.

This Mambo project contains two non-stationary blocks and one stationary block (representing the reference configuration). The non-stationary blocks may be repositioned and reoriented relative to the reference configuration. For each non-stationary block, this is achieved in five independent steps, namely
  1. Select a point A on the block to be kept fixed by any pure rotation applied to the block.
  2. Apply a pure translation to the block so that A coincides with the corresponding point in the desired final configuration.
  3. Select a point B on the block that does not coincide with A.
  4. Apply a pure rotation to the block so that B coincides with the corresponding point in the desired final configuration.
  5. Apply a pure rotation to the block about the axis through A and B so that the block achieves its final configuration.

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

a1x, a1y, a1z, b1x, b1y, and b1z: coordinates of the points A and B on the first block relative to a coordinate system with origin at the center of the block and axes parallel to the edges of the block.

a2x, a2y, a2z, b2x, b2y, and b2z: coordinates of the points A and B on the second block relative to a coordinate system with origin at the center of the block and axes parallel to the edges of the block.

marker: radius of six spheres placed at the points A and B on the stationary block and the two non-stationary blocks.

x1, y1, and z1: coordinates of the point A on the first block in the final configuration relative to a coordinate system with origin at the point A in the reference configuration and axes parallel to the edges of the block. These correspond to the pure translation applied to the first block.

x2, y2, and z2: coordinates of the point A on the first block in the final configuration relative to a coordinate system with origin at the point A in the reference configuration and axes parallel to the edges of the block. These correspond to the pure translation applied to the second block.

theta11 and theta12: angles that describe the pure rotation that aligns the point B on the first block with its location in the final configuration.

theta13: angle that describes the subsequent pure rotation about the axis through A and B on the first block.

theta21 and theta22: angles that describe the pure rotation that aligns the point B on the second block with its location in the final configuration.

theta23: angle that describes the subsequent pure rotation about the axis through A and B on the second block.

  • Use the default locations for the points A and B on the two non-stationary blocks and experiment with different values for the state variables to achieve different final configurations of the blocks.
  • Use the default locations for the points A and B on the two non-stationary blocks and find values for the state variables that result in the same final configurations of the blocks.
  • Choose the points A and B on the two non-stationary blocks so that the axes through the corresponding pairs are parallel when the blocks are in the reference configuration. Choose identical values for the angle state variables for the two blocks. Show that the two final configurations of the blocks are related by a pure translation and find the values for the remaining state variables that make the blocks coincide.
  • Change the assignments in the block.dyn file of the insignals to simulate a tumbling motion of the first block that returns to the same configuration every three seconds.

block.zip (zip file, 10 kb, January 19, 2013)
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(world,stationary_block,reference_configuration1,reference_configuration2,auxiliary_observer_A1,auxiliary_observer_A2,auxiliary_observer_B1,auxiliary_observer_B2,actual_configuration1,actual_configuration2,moving_block1,moving_block2):
>DeclarePoints(W,SB,RC1,RC2,A1,A2,B1,B2,AC1,AC2,MB1,MB2):
>DeclareTriads(w,sb,rc1,rc2,a1,a2,b1,b2,ac1,ac2,mb1,mb2):
>DefineObservers([world,W,w],[stationary_block,SB,sb],[reference_configuration1,RC1,rc1],[reference_configuration2,RC2,rc2],[auxiliary_observer_A1,A1,a1],[auxiliary_observer_A2,A2,a2],[auxiliary_observer_B1,B1,b1],[auxiliary_observer_B2,B2,b2],[actual_configuration1,AC1,ac1],[actual_configuration2,AC2,ac2],[moving_block1,MB1,mb1],[moving_block2,MB2,mb2]):
>DefinePoints([W,SB,NullVector()],[W,RC1,w,a1x,a1y,a1z],[W,RC2,w,a2x,a2y,a2z],[RC1,A1,rc1,x1,y1,z1],[RC2,A2,rc2,x2,y2,z2],[A1,B1,NullVector()],[A2,B2,NullVector()],[B1,AC1,NullVector()],[B2,AC2,NullVector()],[AC1,MB1,ac1,-a1x,-a1y,-a1z],[AC2,MB2,ac2,-a2x,-a2y,-a2z]):
>DefineTriads([w,sb,0,1],[w,rc1,0,1],[w,rc2,0,1],[rc1,a1,0,1],[rc2,a2,0,1],[a1,b1,Matrix([[c11*c12,-s11,c11*s12],[s11*c12,c11,s11*s12],[-s12,0,c12]])],[a2,b2,Matrix([[c21*c22,-s21,c21*s22],[s21*c22,c21,s21*s22],[-s22,0,c22]])],[b1,ac1,Matrix([[rot111,rot112,rot113],[rot121,rot122,rot123],[rot131,rot132,rot133]])],[b2,ac2,Matrix([[rot211,rot212,rot213],[rot221,rot222,rot223],[rot231,rot232,rot233]])],[ac1,mb1,0,1],[ac2,mb2,0,1]):
>DefineNeighbors([world,stationary_block],[world,reference_configuration1],[world,reference_configuration2],[reference_configuration1,auxiliary_observer_A1],[reference_configuration2,auxiliary_observer_A2],[auxiliary_observer_A1,auxiliary_observer_B1],[auxiliary_observer_A2,auxiliary_observer_B2],[auxiliary_observer_B1,actual_configuration1],[auxiliary_observer_B2,actual_configuration2],[actual_configuration1,moving_block1],[actual_configuration2,moving_block2]):

Click here to expand/contract!
>DefineObjects(
   [stationary_block,'Block',point=MakeTranslations(sb,0,l2/2,l3/2),xlength=l1,ylength=(l1+l2+l3)/30,zlength=(l1+l2+l3)/30,color=yellow],
   [stationary_block,'Block',point=MakeTranslations(sb,0,l2/2,-l3/2),xlength=l1,ylength=(l1+l2+l3)/30,zlength=(l1+l2+l3)/30,color=yellow],
   [stationary_block,'Block',point=MakeTranslations(sb,0,-l2/2,-l3/2),xlength=l1,ylength=(l1+l2+l3)/30,zlength=(l1+l2+l3)/30,color=yellow],
   [stationary_block,'Block',point=MakeTranslations(sb,0,-l2/2,l3/2),xlength=l1,ylength=(l1+l2+l3)/30,zlength=(l1+l2+l3)/30,color=yellow],
   [stationary_block,'Block',point=MakeTranslations(sb,l1/2,0,l3/2),xlength=(l1+l2+l3)/30,ylength=l2,zlength=(l1+l2+l3)/30,color=yellow],
   [stationary_block,'Block',point=MakeTranslations(sb,l1/2,0,-l3/2),xlength=(l1+l2+l3)/30,ylength=l2,zlength=(l1+l2+l3)/30,color=yellow],
   [stationary_block,'Block',point=MakeTranslations(sb,-l1/2,0,-l3/2),xlength=(l1+l2+l3)/30,ylength=l2,zlength=(l1+l2+l3)/30,color=yellow],
   [stationary_block,'Block',point=MakeTranslations(sb,-l1/2,0,l3/2),xlength=(l1+l2+l3)/30,ylength=l2,zlength=(l1+l2+l3)/30,color=yellow],
   [stationary_block,'Block',point=MakeTranslations(sb,l1/2,l2/2,0),xlength=(l1+l2+l3)/30,ylength=(l1+l2+l3)/30,zlength=l3,color=yellow],
   [stationary_block,'Block',point=MakeTranslations(sb,l1/2,-l2/2,0),xlength=(l1+l2+l3)/30,ylength=(l1+l2+l3)/30,zlength=l3,color=yellow],
   [stationary_block,'Block',point=MakeTranslations(sb,-l1/2,-l2/2,0),xlength=(l1+l2+l3)/30,ylength=(l1+l2+l3)/30,zlength=l3,color=yellow],
   [stationary_block,'Block',point=MakeTranslations(sb,-l1/2,l2/2,0),xlength=(l1+l2+l3)/30,ylength=(l1+l2+l3)/30,zlength=l3,color=yellow]):
>DefineObjects(
   [moving_block1,'Block',point=MakeTranslations(mb1,0,l2/2,l3/2),xlength=l1,ylength=(l1+l2+l3)/30,zlength=(l1+l2+l3)/30,color=red],
   [moving_block1,'Block',point=MakeTranslations(mb1,0,l2/2,-l3/2),xlength=l1,ylength=(l1+l2+l3)/30,zlength=(l1+l2+l3)/30,color=red],
   [moving_block1,'Block',point=MakeTranslations(mb1,0,-l2/2,-l3/2),xlength=l1,ylength=(l1+l2+l3)/30,zlength=(l1+l2+l3)/30,color=red],
   [moving_block1,'Block',point=MakeTranslations(mb1,0,-l2/2,l3/2),xlength=l1,ylength=(l1+l2+l3)/30,zlength=(l1+l2+l3)/30,color=red],
   [moving_block1,'Block',point=MakeTranslations(mb1,l1/2,0,l3/2),xlength=(l1+l2+l3)/30,ylength=l2,zlength=(l1+l2+l3)/30,color=red],
   [moving_block1,'Block',point=MakeTranslations(mb1,l1/2,0,-l3/2),xlength=(l1+l2+l3)/30,ylength=l2,zlength=(l1+l2+l3)/30,color=red],
   [moving_block1,'Block',point=MakeTranslations(mb1,-l1/2,0,-l3/2),xlength=(l1+l2+l3)/30,ylength=l2,zlength=(l1+l2+l3)/30,color=red],
   [moving_block1,'Block',point=MakeTranslations(mb1,-l1/2,0,l3/2),xlength=(l1+l2+l3)/30,ylength=l2,zlength=(l1+l2+l3)/30,color=red],
   [moving_block1,'Block',point=MakeTranslations(mb1,l1/2,l2/2,0),xlength=(l1+l2+l3)/30,ylength=(l1+l2+l3)/30,zlength=l3,color=red],
   [moving_block1,'Block',point=MakeTranslations(mb1,l1/2,-l2/2,0),xlength=(l1+l2+l3)/30,ylength=(l1+l2+l3)/30,zlength=l3,color=red],
   [moving_block1,'Block',point=MakeTranslations(mb1,-l1/2,-l2/2,0),xlength=(l1+l2+l3)/30,ylength=(l1+l2+l3)/30,zlength=l3,color=red],
   [moving_block1,'Block',point=MakeTranslations(mb1,-l1/2,l2/2,0),xlength=(l1+l2+l3)/30,ylength=(l1+l2+l3)/30,zlength=l3,color=red]):
>DefineObjects(
   [moving_block2,'Block',point=MakeTranslations(mb2,0,l2/2,l3/2),xlength=l1,ylength=(l1+l2+l3)/30,zlength=(l1+l2+l3)/30,color=red],
   [moving_block2,'Block',point=MakeTranslations(mb2,0,l2/2,-l3/2),xlength=l1,ylength=(l1+l2+l3)/30,zlength=(l1+l2+l3)/30,color=red],
   [moving_block2,'Block',point=MakeTranslations(mb2,0,-l2/2,-l3/2),xlength=l1,ylength=(l1+l2+l3)/30,zlength=(l1+l2+l3)/30,color=red],
   [moving_block2,'Block',point=MakeTranslations(mb2,0,-l2/2,l3/2),xlength=l1,ylength=(l1+l2+l3)/30,zlength=(l1+l2+l3)/30,color=red],
   [moving_block2,'Block',point=MakeTranslations(mb2,l1/2,0,l3/2),xlength=(l1+l2+l3)/30,ylength=l2,zlength=(l1+l2+l3)/30,color=red],
   [moving_block2,'Block',point=MakeTranslations(mb2,l1/2,0,-l3/2),xlength=(l1+l2+l3)/30,ylength=l2,zlength=(l1+l2+l3)/30,color=red],
   [moving_block2,'Block',point=MakeTranslations(mb2,-l1/2,0,-l3/2),xlength=(l1+l2+l3)/30,ylength=l2,zlength=(l1+l2+l3)/30,color=red],
   [moving_block2,'Block',point=MakeTranslations(mb2,-l1/2,0,l3/2),xlength=(l1+l2+l3)/30,ylength=l2,zlength=(l1+l2+l3)/30,color=red],
   [moving_block2,'Block',point=MakeTranslations(mb2,l1/2,l2/2,0),xlength=(l1+l2+l3)/30,ylength=(l1+l2+l3)/30,zlength=l3,color=red],
   [moving_block2,'Block',point=MakeTranslations(mb2,l1/2,-l2/2,0),xlength=(l1+l2+l3)/30,ylength=(l1+l2+l3)/30,zlength=l3,color=red],
   [moving_block2,'Block',point=MakeTranslations(mb2,-l1/2,-l2/2,0),xlength=(l1+l2+l3)/30,ylength=(l1+l2+l3)/30,zlength=l3,color=red],
   [moving_block2,'Block',point=MakeTranslations(mb2,-l1/2,l2/2,0),xlength=(l1+l2+l3)/30,ylength=(l1+l2+l3)/30,zlength=l3,color=red]):
>DefineObjects([actual_configuration1,'Sphere',radius=marker,color=green],[actual_configuration1,'Sphere',point=MakeTranslations(ac1,b1x-a1x,b1y-a1y,b1z-a1z),radius=marker,color=blue]):
>DefineObjects([reference_configuration1,'Sphere',radius=marker,color=green],[reference_configuration1,'Sphere',point=MakeTranslations(rc1,b1x-a1x,b1y-a1y,b1z-a1z),radius=marker,color=blue]):
>DefineObjects([actual_configuration2,'Sphere',radius=marker,color=green],[actual_configuration2,'Sphere',point=MakeTranslations(ac2,b2x-a2x,b2y-a2y,b2z-a2z),radius=marker,color=blue]):
>DefineObjects([reference_configuration2,'Sphere',radius=marker,color=green],[reference_configuration2,'Sphere',point=MakeTranslations(rc2,b2x-a2x,b2y-a2y,b2z-a2z),radius=marker,color=blue]):

Click here to expand/contract!
>rotmat1:=MakeRotations(theta13,b1x-a1x,b1y-a1y,b1z-a1z):
>rotmat2:=MakeRotations(theta23,b2x-a2x,b2y-a2y,b2z-a2z):
>rot:=[seq(seq(cat(rot1,i,j)=rotmat1[i,j],i=1..3),j=1..3),seq(seq(cat(rot2,i,j)=rotmat2[i,j],i=1..3),j=1..3)]:
>GeometryOutput(main=world,states=[x1,y1,z1,x2,y2,z2,theta11,theta12,theta13,theta21,theta22,theta23],parameters=[a1x=-.5,a1y=-.75,a1z=-.25,b1x=.5,b1y=.75,b1z=-.25,a2x=0,a2y=0,a2z=0,b2x=.5,b2y=.75,b2z=-.25,l1=1,l2=1.5,l3=.5,marker=0.1],anims=[c11=cos(theta11),c12=cos(theta12),s11=sin(theta11),s12=sin(theta12),c21=cos(theta21),c22=cos(theta22),s21=sin(theta21),s22=sin(theta22),codegen:-optimize(rot)],checktree,checkargs,filename="block.geo");
>MotionOutput(ode={x1t=u1,y1t=u2,z1t=u3,x2t=-u1,y2t=-u2,z2t=-u3,theta11t=u4,theta12t=u5,theta13t=u6,theta21t=u4,theta22t=u5,theta23t=u6},states=[x1,y1,z1,x2,y2,z2,theta11,theta12,theta13,theta21,theta22,theta23],parameters=[a1x=-.5,a1y=-.75,a1z=-.25,b1x=.5,b1y=.75,b1z=-.25,a2x=0,a2y=0,a2z=0,b2x=.5,b2y=.75,b2z=-.25,l1=1,l2=1.5,l3=.5,marker=0.1],insignals=[u1=.5,u2=0,u3=.1,u4=0,u5=0,u6=.5],anims=[c11=cos(theta11),c12=cos(theta12),s11=sin(theta11),s12=sin(theta12),c21=cos(theta21),c22=cos(theta22),s21=sin(theta21),s22=sin(theta22),codegen:-optimize(rot)],checksings,checkargs,filename="block.dyn");

Sample projects