specific solution in a vector field of a equation system
조회 수: 1 (최근 30일)
이전 댓글 표시
I create a vector field of a equation system, also I want to represent the spefic solution of the system in that field but I think that I do it wrong.
this is the system:
dx/dt=P-ay
dy/dt=Q-bx
the code:
x1=-1;
x2=5;
y1=-1;
y2=5;
N = 20;
x = linspace(x1,x2,N);
y = linspace(y1,y2,N);
[X,Y]= meshgrid(x,y);
U1 = P - a.*Y;
V1 = Q - b.*X;
quiver (app.Axes2,X,Y,U1,V1);
xlim(app.Axes2,[0 5])
ylim(app.Axes2,[0 5])
hold (app.Axes2,'on')
yh = (P/a)./100;
xh1 = -10;
xh2 = 40;
plot (app.Axes2,[xh1,xh2],[yh,yh]);
hold (app.Axes2,'on')
yv1 = -10;
yv2 = 40;
xv = (Q/b)./100;
plot (app.Axes2,[xv,xv],[yv1,yv2])
hold (app.Axes2, 'on')
s = Q.*x-(b.*x.^2)/2-P.*y+(a.*y.^2)/2;
plot (app.Axes2,x,s,'r')
hold (app.Axes2,'off')
and the axes:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/537726/image.png)
I think that the code is correct but it doesn't have any sense the axes for me, someone could help me?
댓글 수: 0
답변 (1개)
Nagasai Bharat
2021년 3월 11일
Hi,
From my understanding you are manually trying to solve the equation. The following documentation should help you solve the system of differential equations in an efficient way.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!