Create a vector field
이전 댓글 표시
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:

채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!