Guest User

Untitled

a guest
Jul 16th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. B = -2; A = 1;
  2. s = ParametricNDSolveValue[{Sqrt[-1]*x'[t] ==
  3. B*x[t] - R*x[t]*Abs[x[t]]^2 - A*y[t], x[0] == 1,
  4. Sqrt[-1]*y'[t] == B*y[t] - R*y[t]*Abs[y[t]]^2 - A*x[t],
  5. y[0] == 0}, {x, y}, {t, 0, 100}, {R}];
  6. coll = {};
  7. Table[pp =
  8. ParametricPlot[Re@Through[s[a][t]], {t, 0, 100},
  9. PlotRange -> {{-2, 2}, {-2, 2}}, PerformanceGoal -> "Quality",
  10. MeshFunctions -> (#2 &), Mesh -> {{0.}},
  11. MeshStyle -> {Red, PointSize[0.01]}];
  12. pts = pp[[1, 1]];
  13. AppendTo[
  14. coll, {a, #[[1]]} & /@
  15. pts[[First@Cases[pp[[1]], Point[x__] :> x, -1]]]];, {a, 0.0, 5,
  16. 0.01}];
  17. lp = ListPlot[Join @@ coll, Frame -> True, PlotStyle -> Red];
  18. Manipulate[
  19. Column[{ParametricPlot[Re@Through[s[par][t]], {t, 0, 100},
  20. PlotRange -> {{-2, 2}, {-2, 2}}, PerformanceGoal -> "Quality",
  21. MeshFunctions -> (#2 &), Mesh -> {{0.}},
  22. MeshStyle -> {Red, PointSize[0.01]}, Frame -> True,
  23. FrameLabel -> {"x[t]", "y[t]"}],
  24. Show[lp, Graphics[{Gray, Line[{{par, 0}, {par, 4}}]}]]}], {par,
  25. 0.0, 5, 0.01}]
  26.  
  27. coll = {};
  28. Table[pp =
  29. ParametricPlot[Re@Through[s[a][b][t]], {t, 0, 20},
  30. PlotRange -> {{-2, 2}, {-2, 2}}, PerformanceGoal -> "Quality",
  31. MeshFunctions -> (#2 &), Mesh -> {{0.}},
  32. MeshStyle -> {Red, PointSize[0.01]}];
  33. pts = pp[[1, 1]];
  34. AppendTo[
  35. coll, {a, b, #[[1]]} & /@
  36. pts[[First@Cases[pp[[1]], Point[x__] :> x, -1]]]];, {a, 0.0, 5,
  37. 0.01}, {b, 0.0, 5, 0.01}];
  38. lp = ListPlot[Join @@ coll, Frame -> True, PlotStyle -> Red];
  39. Manipulate[
  40. Column[{ParametricPlot[Re@Through[s[par1][par2][t]], {t, 0, 20},
  41. PlotRange -> {{-2, 2}, {-2, 2}}, PerformanceGoal -> "Quality",
  42. MeshFunctions -> (#2 &), Mesh -> {{0.}},
  43. MeshStyle -> {Red, PointSize[0.01]}, Frame -> True,
  44. FrameLabel -> {"x[t]", "y[t]"}],
  45. Show[lp,
  46. Graphics[{Gray,
  47. Line[{{par1, 0}, {par1, 4}, {par2, 0}, {par2, 4}}]}]]}], {par1,
  48. 0.0, 5, 0.01}, {par2, 0.0, 5, 0.01}]
Add Comment
Please, Sign In to add comment