Creating Phase Plane graphs/portraits

13 views (last 30 days)
Ross Macaroni
Ross Macaroni on 12 Feb 2020
Commented: Steven Lord on 12 Feb 2020
I want to create some phase plane graphs using the equations:
dx/dt = (x^2)y-ax, dy/dt = b-(x^2)y-y
for various values of the constants a and b, with a,b>0.
I have calculated the Jacobian and know there's fixed points at (0,b),(1,a), etc... but unsure how to plot graphs showing this.

Answers (1)

Steven Lord
Steven Lord on 12 Feb 2020
Use odeset to create options to pass into one of the ODE solvers in MATLAB. In your odeset call set the 'OutputFcn' option to @odephas2. Then pass those options into one of the ODE solvers in MATLAB (like ode45.)
You can use the orbitode example as a model, as it uses odephas2 to plot the orbits of the bodies.
  2 Comments
Ross Macaroni
Ross Macaroni on 12 Feb 2020
Thank you for your reply. I am relatively new to MATLAB and am not familiar with odeset. I read the help about it but am still unsure how to code the graphs.
Steven Lord
Steven Lord on 12 Feb 2020
Run the orbitode example. See if the plot that it creates looks similar to what you want. If it does, edit the orbitode example (taking care not to modify it!) and read through it to see how it uses odeset and the ODE solver to create the plot. Use that as a model for your own function that does that same thing for your equations. [Copy and paste the appropriate pieces into a new file then modify it to solve your system of ODEs.]

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!