specific solution in a vector field of a equation system

2 次查看(过去 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:
I think that the code is correct but it doesn't have any sense the axes for me, someone could help me?

回答(1 个)

Nagasai Bharat
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.

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by