Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Wheel on the plane

Construction of the Euler equations


In[5]:=  moments of inertia of the wheel with respect to contact point 
J J
J1   M R 2 ; J2  ; J3  J  M R 2 ;
2 2

 torque components with respect to contact point 


K1   R Fg Cos  R Fx Sin Sin;
K2  0;
K3   R Fx Cos;

  in the body frame 



1   ;

2   Sin;
 
3   Cos  ;

 Rules for substitution of variables 



anglest    tt,   t t,   t t,   tt,

 
  t t,   t t,   tt,   t t,   t t;
 

anglestinv  tt  , t t  , t t  , tt  ,

 
t t  , t t  , tt  , t t  , t t  ;
 

EuEq1  J1 t 1 . anglest  J2  J3  2 3  J2 2   K1 . anglest ;


EuEq2  J2 t 2 . anglest  J3  J1  3 1  J1 1   K2 . anglest ;


EuEq3  J3 t 3 . anglest  J1  J2  1 2  K3 . anglest ;

EuEq1 . anglestinv
EuEq2 . anglestinv
EuEq3 . anglestinv

J 
Out[17]=  M R2  
2

J   Sin    M R2  Cos    Sin  Fx R Sin Sin


1  J   
 Fg R Cos 
2 2
 
J Cos     Sin   M R2    J  Cos   
1 J  1   
Out[18]=

 
2 2 2

J  M R2  Cos       Sin   Fx R Cos  M R2   Sin


  
Out[19]=
2 Wheel_on_a_plane.nb

Parameters, initial conditions, and solution of the Euler equations


In[20]:= 0    2; 0    2; 0  0   4;
  
0  0.01; 0  1; 0   0.01;
tMax  20;
MM  1; RR  1; II  MM RR2 ; FFg  10; FFx   0.03;

Eqs  EuEq1 , EuEq2 , EuEq3  . M  MM, R  RR, J  II, Fg  FFg, Fx  FFx;


IniConds 
t0  0 , t 0  0 , t0  0 , t 0  0 , t0  0 , t 0  0 ;
  

Solution 
NDSolveJoinEqs, IniConds, t, t, t, t, 0, tMax, MaxSteps  3 000 000
ttt_ : tt . Solution1
ttt_ : tt . Solution1
ttt_ : tt . Solution1
Plotttt  , t, 0, tMax, PlotRange  0, 1, PlotPoints  200
Plotttt  2 , t, 0, tMax, PlotRange   1, 3, PlotPoints  200
Plotttt, t, 0, tMax, PlotRange   10, 10, PlotPoints  200
Out[26]= t  InterpolatingFunction0., 20., ,
t  InterpolatingFunction0., 20., ,
t  InterpolatingFunction0., 20., 
1.0

0.8

0.6

Out[30]=

0.4

0.2

0 5 10 15 20

Out[31]= 1

5 10 15 20

-1
Wheel_on_a_plane.nb 3

10

Out[32]=
5 10 15 20

-5

-10
4 Wheel_on_a_plane.nb

Linear motion of the wheel


Vxtt_ : R 1 Sin Sin  R 3 Cos . anglest . R  RR . Solution1
Vytt_ :  R 1 Sin Cos  R 3 Sin . anglest . R  RR . Solution1
In[33]:=

Vztt_ : R 1 Cos . anglest . R  RR . Solution1

PlotVxtt,t,0,tMax,PlotPoints200

PlotVztt,t,0,tMax,PlotPoints200
PlotVytt,t,0,tMax,PlotPoints200

 Linear displacements of the geometrical center 


Solx 
NDSolveXt 't  Vxtt, Xt0  0, Xt, t, 0, tMax, MaxSteps  1 000 000
Soly  NDSolveYt 't  Vytt, Yt0  0,
Yt, t, 0, tMax, MaxSteps  1 000 000

Xttt_ : Xtt . Solx1;


Yttt_ : Ytt . Soly1;
Zttt_ : R Sin . anglest . R  RR . Solution1

OffSet  2.1;
XMax  XtttMax;
XIni  IfXMax  0,  OffSet, OffSet;
XFin  IfXMax  0, XMax  OffSet, XMax  OffSet;

YMax  YtttMax;
YIni  IfYMax  0,  OffSet, OffSet;
YFin  IfYMax  0, YMax  OffSet, YMax  OffSet;

 coordinates of the contact point 


xt_ : Xttt  R Cos Sin . anglest . R  RR . Solution1
yt_ : Yttt  R Cos Cos . anglest . R  RR . Solution1

PlotZttt, t, 0, tMax, PlotPoints  300,


PlotRange  0, 1, PlotStyle  Thick, Black

PlotXttt, xt, t, 0, tMax, PlotPoints  300,


PlotRange  All, PlotStyle  Thick, Black, Thick, Red

PlotYttt, yt, t, 0, tMax, PlotPoints  300,


PlotRange  All, PlotStyle  Thick, Black, Thick, Red

 XY Trajectory of the geometrical center 


TrajCenter : ParametricPlotXttt, Yttt, t, 0, tMax,
PlotRange  All, PlotPoints  1000, PlotStyle  Thick, Black

 XY Trajectory of the contact point 


TrajContact : ParametricPlotxt, yt, t, 0, tMax,
PlotRange  All, PlotPoints  1000, PlotStyle  Thick, Red

ShowTrajCenter, TrajContact
Wheel_on_a_plane.nb 5

Out[36]= Xt  InterpolatingFunction0., 20., 

Out[37]= Yt  InterpolatingFunction0., 20., 

1.0

0.8

0.6

Out[50]=
0.4

0.2

0 5 10 15 20

5 10 15 20

-0.5

Out[51]=
-1.0

-1.5

-2.0

1.5

1.0

0.5
Out[52]=

5 10 15 20

-0.5

1.5

1.0

0.5
Out[55]=

-2.0 -1.5 -1.0 -0.5

-0.5
6 Wheel_on_a_plane.nb

3d plotting

t, 0, tMax, PlotRange  XIni, XFin, YIni, YFin, 0, 2,


In[56]:= TrajectoryCM : ParametricPlot3DXttt, Yttt, Zttt,

PlotStyle  Thick, ImageSize  700, 700


 Trajectory of the center of mass 

 ImageSize set here and used everyehere 


TrajectoryCP : ParametricPlot3Dxt, yt, 0, t, 0, tMax,
PlotRange  XIni, XFin, YIni, YFin, 0, 2, PlotStyle  Thick, Red,
PlotPoints  200  Trajectory of the contact point 

rx_, _, _ : Cos Cos  Cos Sin Sin


_, _ : Sin Cos  Cos Cos Sin
_, _ : Sin 1  Sin
ry_,

 Any
rz_,
point on the perifery of the wheel 

anglesTime    ttt,   ttt;


rxtt_, _ : Xttt  rx, ,  . anglesTime
rytt_, _ : Yttt  ry, ,  . anglesTime
rztt_, _ : rz, ,  . anglesTime
 The same with previously calculated time dependence of  and  

ListPointPlot3Drxtt,    2, rytt,    2, rztt,    2 . t  tt,


WheelCPtt_ :

PlotRange  XIni, XFin, YIni, YFin, 0, 2,


PlotStyle  PointSize0.015, Red  Position of the contact point 

WheelCMtt_ : ListPointPlot3DXttt, Yttt, Zttt . t  tt,


PlotRange  XIni, XFin, YIni, YFin, 0, 2,
PlotStyle  PointSize0.015, Black
 Position of the center of mass 

WheelPeriferytt_ : ParametricPlot3Drxtt, , rytt, , rztt,  . t  tt,


, 0, 2 , PlotRange  XIni, XFin, YIni, YFin, 0, 2,
PlotStyle  Thick, Blue  The wheel itself 

 Wheel with CP and CM 


Wheeltt_ : ShowWheelPeriferytt, WheelCPtt, WheelCMtt

WheelTrajectoryt_ :

 Full trajectories of CP and CM and the wheel at time t 


ShowTrajectoryCM, TrajectoryCP, WheelPeriferyt, WheelCPt, WheelCMt

WheelTrajectorytMax  4
Wheel_on_a_plane.nb 7

-2
-1
0
1

Out[70]=

-1

-2
8 Wheel_on_a_plane.nb

ManipulateWheelTrajectoryt, t, 0, tMax


In[71]:=

2.0

Out[71]= 1.5

1.0

0.5

0.0

-2

-1 -1

-2
1

Export"Wheel.avi", AnimateWheelTrajectorytt, tt, 0, tMax


 Export of animated objects does not work 
In[72]:=

Out[72]= Wheel.avi
Wheel_on_a_plane.nb 9

In[74]:= ShowTrajectoryCM, TrajectoryCP, Wheel0, Wheel2.25, Wheel2.59, Wheel3,


Wheel4, Wheel7.4, Wheel7.75, Wheel8.5, Wheel12.5, Wheel12.9

-1

-2

2.0

Out[74]=

1.5

1.0

0.5

1
0
0.0 -1
-2

You might also like