Create a vector field
Afficher commentaires plus anciens
I am trying to create a vector field of a equation system, but I think that I have the slope wrong:
this is the system:
dx/dt = P-ay
dy/d t= Q-bx
And this my code:
x1=0;
x2=5;
y1=0;
y2=5;
N = 20;
x = linspace(x1,x2,N);
y = linspace(y1,y2,N);
[X,Y]= meshgrid(x,y);
U = -P+a.*y;
V = -Q+b.*x;
[U,V]=meshgrid(U,V);
quiver (app.Axes2,X,Y,U,V);
This is the field I have get it, which from my point of view it doesn't have too many sense:

Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Ordinary Differential Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!