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

2dgraphMATLABmatlab functionodeode45plot

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')

Best Answer

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')