ODE system phase plane

93 visualizaciones (últimos 30 días)
Martin Moreno
Martin Moreno el 19 de Abr. de 2020
Editada: Brian Hong el 26 de En. de 2022
Hi guys, I have never plotted phase planes in Matlab and would like to include some graphics on a due coursework.
My ODE systems are:
dx/dt=x(r-ay)
dy/dt=c+y(bx-d)
where r,a,c,b,d are all positive constants.
I would like for the plot to include trajectories and a direction field.
Any ideas on how I could do this?
  1 comentario
darova
darova el 20 de Abr. de 2020
Did you solve your equations already?

Iniciar sesión para comentar.

Respuestas (3)

Ameer Hamza
Ameer Hamza el 20 de Abr. de 2020
  2 comentarios
Martin Moreno
Martin Moreno el 20 de Abr. de 2020
This is the error I get after trying your method:
Undefined function or variable 'odeFun'.
Error in @(x,y){odeFun([],[x,y])}
Ameer Hamza
Ameer Hamza el 21 de Abr. de 2020
Martin, can you show the code which cause this error?

Iniciar sesión para comentar.


Steven Lord
Steven Lord el 20 de Abr. de 2020
Create an options structure using odeset. In your odeset call specify the OutputFcn option to be @odephas2, a function included with MATLAB for creating a 2-dimensional phase plane plot. Pass the options structure returned by odeset into the ODE solver as the appropriate input argument.
The orbitode example uses odephas2 in its execution.

Brian Hong
Brian Hong el 26 de En. de 2022
Editada: Brian Hong el 26 de En. de 2022
You could also use an app. I used pplane in undergrad. We also made a new app for analyzing ODE systems in the phase plane.

Categorías

Más información sobre Programming en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by