I want to plot

1) vector field on a circle for the nonlinear equation and

2) theta dot and theta for different values of mu for the equation

\!\(\*OverscriptBox[\(θ\), \(.\)]\) == μSin[θ] - 
  Sin[2 θ]

I'm not getting any idea, I tried with the code as below:

Clear [θ];
eqn=Overscript[θ, .]==μSin[θ]-Sin[2θ]
tTicks=Range[-24,24 30,24];
tGrid=Range[-60,24 30,6];



1 Answer 1


This is really just for fun. For simplicity $\theta$ has been changed to $u$ and $\mu$ changed to $m$ and the initial condition changed to $u(0)=1$:

{p1, p2} = {u, u'} /. 
  ParametricNDSolve[{u'[t] == m Sin[u[t]] - Sin[2 u[t]], 
    u[0] == 1}, {u, u'}, {t, 0, 4 Pi}, {m}]
   Show[ParametricPlot[{p1[m][t], p2[m][t]}, {t, 0, 4 Pi}, 
     Epilog -> {Red, PointSize[0.02], 
       Point[{p1[m][time], p2[m][time]}]}, Frame -> True, 
     PlotRange -> Table[{-3, 3}, {2}]], 
    Plot[m Sin[v] - Sin[2 v], {v, 0, 2 Pi}, PlotStyle -> Dashed], 
    ImageSize -> 300, FrameLabel -> {"\[Theta]", "\[Theta]'"}, 
    BaseStyle -> 20], 
   Plot[p1[m][t], {t, 0, 2 Pi}, 
    Epilog -> {Red, PointSize[0.02], Point[{time, p1[m][time]}]}, 
    Frame -> True, FrameLabel -> {"t", "\[Theta](t)"}, 
    ImageSize -> 300, BaseStyle -> 20]

   }], {m, -2, 2, Appearance -> "Labeled"}, {time, 0, 4 Pi, Animator}]

enter image description here

The (hopefully) instructive points:

  • need for numerical approach NDSolve and related
  • use of ParametricNDSolve to explore variation of parameter m ($\mu$)
  • superimposition of phase space relation and solution

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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