# Manipulating of non linear differentials equation

I want to manipulate non linear differential equations

$\dot{x}= x + g\, xy\quad \dot{y}= 1-2x^2-g\, y^2$

where g as parameter.but I don't get any curve on display. Plz help me

• Your question is a bit short. what is the time range, and the one on g. Must the initial condition be incorporated in the manipulate Commented Jun 26, 2016 at 7:07
• – user9660
Commented Jun 26, 2016 at 7:16
• Welcome! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign!
– user9660
Commented Jun 26, 2016 at 7:16

ClearAll["Global*"]
Remove["Global*"]

{ysol, xsol} = ParametricNDSolve[{x'[t] == x[t] + g*x[t]*y[t],
y'[t] == 1 - 2*x[t]^2 - g*y[t]^2, x[1] == 1, y[1] == 1}, {y, x}, {t, 0, 10}, {g}];

ParametricPlot[Evaluate@Table[{y[g][t] /. ysol, x[g][t] /. xsol}, {g, 0, 1,
1/4}], {t, 0, 2}, PlotRange -> {{-3, 3}, {-3, 3}},
PlotLegends -> {"g=1/4", "g=2/4", "g=4/4", "g=4/4"}] // Quiet


For certain values ​​of g ParametricNDSolve gives a warning messages,because system is stiff(solution is singular).This can be a help in some cases by changing the method

 g=3.5
y[g][t] /. ysol


This may be the reason that the ParametricPlot does not shows parametric curve.

Edited:

Code for g-parameter manipulation.

{ysol, xsol} = ParametricNDSolve[{x'[t] == x[t] + g*x[t]*y[t],
y'[t] == 1 - 2*x[t]^2 - g*y[t]^2, x[1] == 1, y[1] == 1}, {y,
x}, {t, 0, 10}, {g}];

Manipulate[ParametricPlot[
Evaluate[{y[g][t] /. ysol, x[g][t] /. xsol}], {t, 0, 2},
PlotRange -> {{-5, 5}, {-5, 5}},
PlotLegends -> {"g"}], {{g, 0, "g parameter"}, -1, 1, 1/4}]