I am trying to solve a system of differential equations and plot solution curves. The differential equations have parameters. I would like to write a loop for these parameters and have the solution curves plot.(adsbygoogle = window.adsbygoogle || []).push({});

Here is my code for the solving / plotting. The parameters I want to change are are currently 7 and 4.

sol = NDSolve[{x'[t] == -7*x[t] y[t] + 4 y[t],

y'[t] == 7*x[t] y[t] - 4 y[t], x[0] == 50, y[0] == 10}, {x,

y}, {t, 0, 10}]

Plot[Evaluate[x[t] /. sol], {t, 0, 1}, PlotRange -> All]

Plot[Evaluate[y[t] /. sol], {t, 0, 1}, PlotRange -> All]

ParametricPlot[Evaluate[{x[t], y[t]} /. sol], {t, 0, 10},

PlotRange -> All]

{x[10], y[10]} /. sol

I don't know how to create a loop (or even which type of loop to use) that will output a plot for each new parameter value.

Any advice that you have to offer would be much appreciated.

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Plotting in a loop in mathematica

Loading...

Similar Threads - Plotting loop mathematica | Date |
---|---|

Plotting results from for loop | Apr 26, 2014 |

Use DO loop in Plot order at mathematica 8 | Oct 19, 2013 |

Plot in a loop in matlab | May 19, 2012 |

MATLAB-saving data after loops for surf plot | Apr 14, 2012 |

Plotting 3D graphs for a script involving big loop | Apr 2, 2012 |

**Physics Forums - The Fusion of Science and Community**