1
$\begingroup$

I try to find the analytical solution to the ordinary differential equations as fellow:

$$\frac{d^2 \theta}{d t^2} = \dfrac{-M\cos\theta\sin\theta(\frac{d\theta}{dt})^2 - \frac{g}{l}\sin\theta}{1-M\cos^2\theta}$$ $$\frac{d^2 x}{d t^2} = \dfrac{Mg\cos\theta\sin\theta - Ml\sin\theta(\frac{d\theta}{dt})^2}{1-M\cos^2\theta}$$

And my code is

eqn1 = D[y[t], {t,2}] - (-M Cos[y[t]] Sin[y[t]] (y'[t])^2 - g/l Sin[y[t]])/(1 -M (Cos[y[t]])^2);
eqn2 = D[x[t], {t, 2}] - (M g Sin[y[t]] Cos[y[t]] + M l Sin[y[t]] (y'[t])^2) /(1 - M (Cos[y[t]])^2);
eqnSet = {eqn1 == 0, eqn2 == 0};
DSolve[eqnSet, {y[t], x[t]}, t]

DSolve does not give a solution, instead it writes:

DSolve[{-((-((g Sin[y[t]])/l) - 
  M Cos[y[t]] Sin[y[t]] Derivative[1][y][t]^2)/(
 1 - M Cos[y[t]]^2)) + (y^\[Prime]\[Prime])[t] == 0, -((g M Cos[y[t]] Sin[y[t]] + 
  l M Sin[y[t]] Derivative[1][y][t]^2)/(1 - M Cos[y[t]]^2)) + (
 x^\[Prime]\[Prime])[t] == 0}, {y[t], x[t]}, t]

could anyone point out my problem?

$\endgroup$
3
$\begingroup$

This is a non linear equation which does not seem to have a closed form solution.

Try instead something like this:

eqn1 = D[y[t], {t, 
     2}] - (-M Cos[y[t]] Sin[y[t]] (y'[t])^2 - g/l Sin[y[t]])/(1 -   M (Cos[y[t]])^2);
eqn2 = D[x[t], {t, 
     2}] - (M g Sin[y[t]] Cos[y[t]] + M l Sin[y[t]] (y'[t])^2)/(1 -  M (Cos[y[t]])^2);
eqnSet = {eqn1 == 0, eqn2 == 0, y[0] == 1, x[0] == 2, y'[0] == 1, 
   x'[0] == 1};
sol=NDSolve[eqnSet /. {M -> 1 , g -> 1, l -> 1}, {y[t], x[t]}, {t, 0, 1}]

Then for instance

ParametricPlot[{x[t], y[t]} /. sol[[1]], {t, 0, 1},AspectRatio -> 1]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.