# How can I solve and plot a solution of a nonlinear differential system [closed]

Please consider the following nonlinear differential system,

D[x1[t], t] ==
1/3 (-22 + 12 (x1[t])^3 + (x1[t])^2 (43 - 6 z1[t]) + 28 z1[t] -8 (z1[t])^2 + x1[t] (-13 + 28 z1[t] - 6 (z1[t])^2)),
D[z1[t], t] ==
1/3 (35 - 71 z1[t] + 40 (z1[t])^2 - 6 (z1[t])^3 + (x1[t])^2 (-35 + 12 z1[t]) + x1[t] (-85 + 58 z1[t] - 6 (z1[t])^2)),


with initial conditions

x1[0] == 0;
z1[0] == -1.341215;


I want to find x1[t] and z1[t], so I can draw them in the xz-plane for t = 3. Can somone help me?

• There are many examples in the documentation for NDSolve and DSolve, as well as this Q&A -- have you tried any of those methods? Commented Apr 2, 2019 at 12:58
• You can format inline code and code blocks by selecting the code and clicking the {} button above the edit window. The edit window help button ? is useful for learning how to format your questions and answers. You may also find this meta Q&A helpful Commented Apr 2, 2019 at 13:01
• Yes sir I try but I think I did it badly Commented Apr 2, 2019 at 13:30

eqns = {
D[x1[t], t] ==
1/3 (-22 + 12 (x1[t])^3 + (x1[t])^2 (43 - 6 z1[t]) + 28 z1[t] -
8 (z1[t])^2 + x1[t] (-13 + 28 z1[t] - 6 (z1[t])^2)),
D[z1[t], t] ==
1/3 (35 - 71 z1[t] + 40 (z1[t])^2 -
6 (z1[t])^3 + (x1[t])^2 (-35 + 12 z1[t]) +
x1[t] (-85 + 58 z1[t] - 6 (z1[t])^2)),
x1[0] == 0, z1[0] == -1.3412147481212933};

sol = NDSolve[eqns, {x1, z1}, {t, 0, 5}][[1]];

Plot[Evaluate[{z1[t], x1[t]} /. sol], {t, 0, 5},
AxesLabel -> {Style["t", 12, Bold], None},
PlotLegends -> Placed[{"z1", "x1"}, {.85, .65}],
Epilog -> ({Dashed, Gray, Line[{{3, -2}, {3, 2}}],
Red, AbsolutePointSize[4],
Tooltip[Point[{3, x1[3]}], x1[3]],
Tooltip[Point[{3, z1[3]}], z1[3]]} /. sol)]


ParametricPlot[{x1[t], z1[t]} /. sol, {t, 0, 5},
Frame -> True,
Axes -> False,
PlotRange -> All,
FrameLabel ->
(Style[#, 12, Bold] & /@ {x1[t], z1[t]}),
Epilog -> {Red, AbsolutePointSize[4],
Tooltip[Point[{x1[3], z1[3]}],
{x1[3], z1[3]}] /. sol},
AspectRatio -> 1]
`

• Oh my god thank you sir, thank you so much. Its what I need. Commented Apr 2, 2019 at 13:28