Advertisement
Matthen

Natural Equation

Sep 28th, 2012
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. frame[a_] := Module[{soln},
  2. \[Phi][s_] :=
  3. Sum[a (-1)^i Sin[i s + a]/(i (i + 1)), {i, 1, 100, 2}];
  4. soln = NDSolve[{
  5. x[0] == 0, y[0] == 0,
  6. y'[s] == Sin[\[Phi][s]],
  7. x'[s] == Cos[\[Phi][s]]
  8. },
  9. {x[s], y[s]},
  10. {s, 0, 2 Pi}
  11. ];
  12. ParametricPlot[{x[s], y[s]} /. soln /. {s -> st}, {st, 0, 2 Pi},
  13. ImageSize -> {300, 300}, Axes -> None,
  14. PlotStyle -> Directive[Thick, RGBColor[0.2, 0.1, 0.3]]]
  15. ];
  16. Manipulate[frame[a], {a, 0, 5 Pi}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement