Not getting expected graph. Only straight lines are coming but there should be curve .

1 次查看(过去 30 天)
clc
tspan = (0:0.25:100);
y0 = [1376000000,10,0];
[t,y] = ode45(@(t,y)[-3.6*10^-9*y(1)*y(2)+0*y(3);-3.6*10^-9*y(1)*y(2)-0.5*y(2);0.5*y(2)-0*y(3)],tspan,y0);
plot(t,y(:,1),'b',t,y(:,2),'r',t,y(:,3),'g')

采纳的回答

Steven Lord
Steven Lord 2020-7-14
The values of the first component of the solution are so much larger in magnitude than the others that even if they did vary (which they do at first before settling down into what looks to be a steady state after about t = 2 or t = 3) it would be like trying to see one Lego block on the ground from the window of an airplane cruising at 30,000 feet.
If you plot the three components separately you can see the variation at the start.
figure
subplot(3, 1, 1);
plot(t, y(:, 1), 'b');
subplot(3, 1, 2);
plot(t, y(:, 2), 'r');
subplot(3, 1, 3);
plot(t, y(:, 3), 'g')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by