Message Boards Message Boards

0
|
2174 Views
|
3 Replies
|
1 Total Likes
View groups...
Share
Share this post:

How can I find the equation for a graph?

Hi, I use NDSolve to get this numeric solution and then plot the solution. But I also need the equation for θ(t).
How can I get the θ(t) equation?

thanks in advance.

3 Replies

You are right, it has branch cut discontinuities. But you can correct for them:

solN = Block[{g = 9.8, L = 1}, 
   NDSolveValue[{\[Theta]''[t] + g/L*Sin[\[Theta][t]] == 
      0, \[Theta][0] == Pi/2, \[Theta]'[0] == 0}, \[Theta], {t, 0, 
     10}]];
sol = DSolveValue[{\[Theta]''[t] + g/L*Sin[\[Theta][t]] == 
     0, \[Theta][0] == Pi/2, \[Theta]'[0] == 0}, \[Theta], t];
solDiscontinuities = 
  FunctionDiscontinuities[
   JacobiAmplitude[
    1/2 (-((Sqrt[2] Sqrt[g] t)/Sqrt[L]) + 2 EllipticF[\[Pi]/4, 2]), 
    2], t, Reals];
{discnt2, discnt1} = 
  t /. Solve[solDiscontinuities, t, Reals] /. {C[1] -> 0, g -> 9.8, 
    L -> 1};
solCorrected[t_] := sol[Mod[t, discnt2 - discnt1, discnt1]]
Block[{g = 9.8, L = 1}, {Plot[solCorrected[t], {t, 0, 10}],
  Plot[solN[t], {t, 0, 10}]}]
POSTED BY: Gianluca Gorni

Look up DSolve:

Clear[g];
DSolve[{\[Theta]''[t] + g/L*Sin[\[Theta][t]] == 0,
  \[Theta][0] == Pi/2, \[Theta]'[0] == 0},
 \[Theta][t], t]
POSTED BY: Gianluca Gorni

But the analytical solution for this nonlinear ODE is not good.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract