Advertisement
Matthen

Series and Parallel

Dec 7th, 2011
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. series = Interpolation[{{0, {-1, 0}}, {1, {0,
  2. 1}}, {2, {0, -1}}, {3, {1, 0}}}, InterpolationOrder -> 3];
  3. parallel[n_] :=
  4. Interpolation[{{0, {-1, 0}}, {1.5, {0, n}}, {3, {1, 0}}},
  5. InterpolationOrder -> 2];
  6. frame[t_] := Module[{t2},
  7. t2 = t - 3;
  8. Show[Graphics[
  9. {Darker@Red, PointSize[Large],
  10. Table[Point[{0, i}], {i, -1, 1, 1/2}]}
  11. , PlotRange -> 1.5],
  12. ParametricPlot[series[\[Tau]], {\[Tau], 0, Min[t, 3]},
  13. PlotStyle -> Directive[Thick, Blue]],
  14. If[t2 > 0,
  15. Table[
  16. ParametricPlot[parallel[n][\[Tau]], {\[Tau], 0, Min[t2, 3]},
  17. PlotStyle -> Directive[Thick, Orange]]
  18. , {n, -1, 1, 1/2}
  19. ]
  20. ,
  21. Graphics[{}]
  22. ]
  23. ]];
  24. Manipulate[frame[t], {t, 0.01, 6}]
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement