1
$\begingroup$

I have a system of two first-order ODEs with two parameters, a and b and I'm trying to plot the solution curve in the X-Y plane at a given initial condition for various parameter values. Can someone give me a simple way of doing this? I've been experimenting with ParametricNDSolve but I'm new to Mathematica and I think I'm using it incorrectly. Any resources or information would be appreciated.

$\endgroup$
  • $\begingroup$ use Manipulate, make sliders for the parameters, and do DSolve inside Manipulate and plot the solution(s). $\endgroup$ – Nasser Nov 24 '14 at 2:24
  • $\begingroup$ There are examples in the documentation for ParametricNDSolve and ParametricNDSolveValue. If you showed how you're using it, someone might be able to point out any mistakes. $\endgroup$ – Michael E2 Nov 24 '14 at 3:10
2
$\begingroup$
eq = {  x'[t] Sin[y[ t]] + x[t] y'[t] a == 1, y'[t] Cos[x[t]] - y[t] x'[t] b == 1}
sol = ParametricNDSolve[{eq, x[0] == 1, y[0] == 1}, {x, y}, {t, 0,  1}, {a, b}]

Manipulate[ ParametricPlot[{x[a, b][t], y[a, b][t]} /. sol, {t, 0, 1},  AspectRatio -> 1], 
           {a, 0.5, 1}, {b, 0.5, 1}]

Mathematica graphics

$\endgroup$

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.