difficulties to add the arrowheads on phase portrait

2 次查看(过去 30 天)
I still have some difficulties to add the arrowheads nicely on the curved trajectories. With dynamics on the script is now fixed, you may post a new question on the arrowhead plotting issue
to = 0;
tf = 30;
tspan = to:0.1:tf;
iv1 = [ 12.3 0.1 0 0.1 0.1 ] ;
[t y] = ode45(@(t, y) lnear(t, y), tspan, iv1);
plot(y(:,1), y(:,5)), hold on
iv2 = [ 12.3 0 0 0 0 ] ;
[t x] = ode45(@(t, x) lnear(t, x), tspan, iv2);
plot(x(:,1), x(:,5)),
iv3 = [ 12.65 0 0 0.1 0.1 ] ;
[t z] = ode45(@(t, z) lnear(t, z), tspan, iv3);
plot(z(:,1), z(:,5)),
iv4 = [ 12.65 0.1 0.1 0 0 ] ;
[t n] = ode45(@(t, n) lnear(t, n), tspan, iv4);
plot(n(:,1), n(:,5)),
iv5 = [ 12.485594 0 0 0 0.12 ] ;
[t w] = ode45(@(t, w) lnear(t, w), tspan, iv5);
plot(w(:,1), w(:,5)),
iv6 = [ 12.3 0.1 0 0.1 0 ] ;
[t v] = ode45(@(t, v) lnear(t, v), tspan, iv6);
plot(v(:,1), v(:,5)),
iv7 = [ 12.4 0.05 0 0.05 0 ] ;
[t s] = ode45(@(t, s) lnear(t, s), tspan, iv7);
plot(s(:,1), s(:,5)),
iv8 = [ 12.65 0.05 0 0.05 0.05 ] ;
[t p] = ode45(@(t, p) lnear(t, p), tspan, iv8);
plot(p(:,1), p(:,5)),
iv9 = [ 12.6 0.05 0 0.05 0 ] ;
[t c] = ode45(@(t, c) lnear(t, c), tspan, iv9);
plot(c(:,1), c(:,5)), grid on
xlabel('y_1'), ylabel('y_5')
function dydt = lnear(t,y)
dydt = zeros(5, 1);
e1 = 13;
g = 0.0125;
h = 0.284253;
f = 0.05;
q1 = 0;
k1 = 10;
d1 = 0.0412;
e2 = 0.0188;
j = 0.0082;
q2 = 0;
k2 = 10;
d2 = 0.0288;
b = 2;
d4 = 0.1152;
e3 = 0.166667;
a = 1.7;
q3 = 0;
k3 = 10;
d3 = 0.1152;
r = 0.5;
m = 1.02;
q4 = 0;
k4 = 10;
dydt(1) = e1 + (g*y(3)*y(1)/(h + y(3))) + (f*y(3)*y(1)) - (y(1)*(1 + ((q1/k1)*y(1)))) - (d1*y(1));
dydt(2) = e2*y(2) + (f*y(1)*y(3)) - (j*y(2)) - (y(2)*(1 + ((q2/k2)*y(2)))) - (d2*y(2));
dydt(3) = (b*e2*y(2)) - (d4*y(3));
dydt(4) = e3*y(4) + (j*y(2)) - (a*y(4)) - (y(4)*(1 + ((q3/k3)*y(4)))) - (d3*y(4));
dydt(5) = (r*y(5)*(1 - (m*y(5)))) + (a*y(4)) - y(5)*(1 + ((q4/k4)*y(5)));
end
  2 个评论
Sargondjani
Sargondjani 2023-2-7
Please be more specific where you run into problems. What did you try? What does not work? What is even wrong with your arrow heads? You post a lot of questions, which seem to be of the type "please do my (home)work for me"
Latifah
Latifah 2023-2-7
when I run my script (attach), I only have plot without arrow, it is not same like picture I sent before, can you help me change the script , I didn't know how to do it

请先登录,再进行评论。

采纳的回答

Joel Van Sickel
Joel Van Sickel 2023-2-16

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by