i have a set of eight equations given by the function,
function dx=agestructure(t,x)
dx=zeros(8,1);
dx(1)=912-0.0000905*x(1)*x(8)-0.00004*x(1)-0.00000986*x(1)+0.0027*x(3);
dx(2) = 608+0.00000905*x(1)*x(8)-0.00004*x(2)-0.0014*x(2);
dx(3)= 0.0014*x(2)-0.00004*x(3)-0.00000986*x(3)-0.0027*x(3);
dx(4)= 505.49+0.00000986*x(1)-0.00000905*x(4)*x(8)-0.00004*x(4)+0.0027*x(6);
dx(5)= .506+0.00000905*x(4)*x(8)-0.00004*x(5)-0.0035*x(5);
dx(6) = 0.0035*x(5)-0.00004*x(6)+0.00000986*x(3)-0.0027*x(6);
dx(7)= 500-0.000041665*x(7)*(x(2)+x(5))-0.05*x(7);
dx(8)=0.000041665*x(7)*(x(2)+x(5))-0.05*x(8);
end
I am able to draw the phase portrait using the following commands:
options=odeset('OutputFcn',@odephas2);
[t,xa]=ode45(@(t,x)g(t,x),[0 300],[3500,0,0,6500,0,0,1000,550],options);
Is it possible for me to show the vector field and path of the trjectory using 'quiver'?

댓글 수: 1

Avinash
Avinash 2022년 8월 16일
can u please send a working code like what values you have defined to x(1) and others

댓글을 달려면 로그인하십시오.

답변 (1개)

KSSV
KSSV 2022년 8월 16일
편집: KSSV 2022년 8월 16일

0 개 추천

plot(t,xa(:,1))
In the baove use your required index for the column and plot. You can use quiver, if you have vectors. Assuming your fixt column is displacement, you can plot phase potrait using:
s = xa(:,1) ;
plot(s,gradient(s))

카테고리

도움말 센터File Exchange에서 Vector Fields에 대해 자세히 알아보기

태그

질문:

2019년 5월 29일

편집:

2022년 8월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by