-1
$\begingroup$
gsln = NDSolve[{eqnx1[t], eqny1[t], eqnz1[t], eqnx2[t], eqny2[t], 
eqnz2[t], x1[0] == x10, y1[0] == y10, z1[0] == z10,.....
ParametricPlot[Evaluate[{(y1sln[t]/rc), (z1sln[t]/rc)}], {t, 0, end}]

Generally I am able to plot the y1 solution with the z1 solution. I would also like to overlap that plot with the y2 solution as well as the z2 solution. How would I go about writing the code to do so?

rc is used to normalize.

$\endgroup$
  • 1
    $\begingroup$ Can you maybe give an actual example that other people can evaluate? $\endgroup$ – J. M. will be back soon Sep 6 '17 at 22:41
3
$\begingroup$

To combine two graphics in one frame, we need to use Show. Here I consider two random systems of differential equations, because you haven't provided any.

sol1[x0_?NumericQ] := 
  First@NDSolve[{x'[t] == 0.2*(x[t] - x[t]*y[t]), 
     y'[t] == Sin[t - 4]*(x[t]*y[t] - y[t]), x[0] == x0, 
     y[0] == x0}, {x, y}, {t, 0, 20}];

sol2[U0_?NumericQ] := 
  First@NDSolve[{U'[t] == 0.1*(U[t] - U[t]*V[t]), 
     V'[t] == Sin[t - 3]*(U[t]*V[t] - V[t]), U[0] == U0, 
     V[0] == U0}, {U, V}, {t, 0, 20}];

p1 = ParametricPlot[
   Evaluate[{x[t], y[t]} /. sol1[#] & /@ Range[0.9, 1.8, 0.1]], {t, 0,
     20}, PlotStyle -> Red, PlotRange -> {{0, 2.3}, {0, 2.6}}, Frame -> True];

p2 = ParametricPlot[
   Evaluate[{U[t], V[t]} /. sol2[#] & /@ Range[0.9, 1.8, 0.1]], {t, 0,
     20}, PlotStyle -> Green, PlotRange -> {{0, 2.3}, {0, 2.6}}, Frame -> True];

Show[{p1, p2}]

enter image description here

$\endgroup$
  • $\begingroup$ Yes that is exactly it, thank you! $\endgroup$ – Naflive2 Sep 6 '17 at 23:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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