1
$\begingroup$

Using the following code I am able to plot x(t) and z(t) values with respect to time. But how to do a plot with x(t) values as x-axis and z(t) values as y-axis. Any suggestions please.

sol = NDSolve[{Derivative[1][x][t] == -x[t] + y[t], Derivative[1][y][t] == -x[t] - 0.01 y[t] - y[t] z[t], Derivative[1][z][t] == -0.5 z[t] + x[t]^2 - 77, x[0] == 0.1, y[0] == 0.1, z[0] == 0.1}, {x, y, z}, {t, 0, 200}, MaxSteps -> 1000000] Plot[Evaluate[{x[t], z[t]} /. sol], {t, 0, 200}, Frame -> True, Axes -> None] T1 = Table[{x[i], z[i]} /. sol, {i, 0, 200, 0.01}] 

Thank you

$\endgroup$
2
  • $\begingroup$ Try ParametricPlot $\endgroup$ Commented Nov 10, 2020 at 17:14
  • $\begingroup$ 3D also work. sol = NDSolve[{Derivative[1][x][t] == -x[t] + y[t], Derivative[1][y][t] == -x[t] - 0.01 y[t] - y[t] z[t], Derivative[1][z][t] == -0.5 z[t] + x[t]^2 - 77, x[0] == 0.1, y[0] == 1, z[0] == 0.1}, {x, y, z}, {t, 0, 200}]; ParametricPlot3D[Evaluate[{x[t], y[t], z[t]} /. sol], {t, 0, 200}, Axes -> None, BoxRatios -> 1] $\endgroup$ Commented Nov 10, 2020 at 23:43

1 Answer 1

4
$\begingroup$

Try ParametricPlot

ParametricPlot[Evaluate[{x[t], z[t]} /. sol], {t, 0, 200},Frame -> True, Axes -> None, AspectRatio -> 1] 

enter image description here

$\endgroup$
5
  • $\begingroup$ yes its working. $\endgroup$ Commented Nov 10, 2020 at 17:39
  • 1
    $\begingroup$ In Parametricplot is there any option to set PlotRange for the axes? $\endgroup$ Commented Nov 10, 2020 at 17:47
  • $\begingroup$ Same options as in Plot&Co $\endgroup$ Commented Nov 10, 2020 at 17:56
  • $\begingroup$ In the system when 77 is replaced by 200 or higher values, x(t) values are around (-100,100) whereas z(t) values are around (-1000, 5000) so in such cases how to apply LogPlot in ParametricPlot? $\endgroup$ Commented Nov 11, 2020 at 4:49
  • $\begingroup$ @vicky Try the option ScalingFunctions -> {None, "Log"} inside ParametricPlot. It is displayed "red" but it works. $\endgroup$ Commented Nov 11, 2020 at 7:16

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.