I found equations of motion for my generalized coordinates which are “Phi” and “l” , but I can not get numeric solutions and plots for them.Could you help me please?
The rules explain how to format your code properly. If you do not format code, it may become corrupted and useless to other members. Please EDIT your post and make sure code blocks start on a new paragraph and look framed and colored like this.
int = Integrate[1/(x^3 - 1), x];
Map[Framed, int, Infinity]
We need to find equations of motion for a disc with spring pendulum.
The disc is massless , but it rotates with “w” constant angular speed.Spring
pendulum is attached to the disc and spring pendulum move with the disc.Spring
pendulum has a “m” mass ,and spring pendulum is free to springing.
The discs move is dependent to time , so we have rheonomic constraint.The discs radius is “R” and , we describe its motion with Theta = wt ,but Theta is not degree
of freedom.
In this case , we have two degrees of freedom for this system , and these are
Phi (Spring pendulums rotation angle.) , l (Springs extension quantity.)
z1 = (-R*W*Sin[\[Theta]] + l'[t]*Sin[\[Phi][t]] +
l[t]*\[Phi]'[t]*Cos[\[Phi][t]] - R*W*Cos[\[Theta]] +
l'[t]*Cos[\[Phi][t]] - l[t]*\[Phi]'[t]*Sin[\[Phi][t]]) /. l -> L;
z1^2 // Expand // TrigReduce;
V = -m*g*(-R*Sin[\[Theta]] + l[t]*Cos[\[Phi][t]]) +
1/2*k*(l[t] - l0)^2 /. l -> L;
T = 1/2*m*z1^2 // Expand // TrigReduce;
Lagrange = T - V
Needs["VariationalMethods`"]
eqs = EulerEquations[Lagrange, {L[t], \[Phi][t]}, t]
In[171]:= werte = {k -> .2, l0 -> 2, m -> .6, g -> 9.81};
eqsnum = eqs /. werte;
lsg = NDSolve[({eqs, \[Phi][0] == 0, \[Phi]'[0] == .9, L[0] == l0,
L'[0] == .2} /. werte), {\[Phi], L}, {t, 0, 10}]
During evaluation of In[171]:= NDSolve::ntdvdae: Cannot solve to find an explicit formula for the derivatives. NDSolve will try solving the system as differential-algebraic equations. >>
During evaluation of In[171]:= NDSolve::icfail: Unable to find initial conditions that satisfy the residual function within specified tolerances. Try giving initial conditions for both values and derivatives of the functions. >>
Out[173]= {}
Thanks for reply.I found this code from here[Thanks @Hans Dolhaine ]1 for animate , but I can see just pendulum without spring and disc.How can add the disc and spring in this code?