Wrong plot with ode15s

1 次查看(过去 30 天)
Sam
Sam 2017-12-21
回答: Star Strider 2017-12-21
I'm trying to plot the solution for the following differential equation
function y=probleemvergelijking(t,x)
y = (-100*x + 1 + 100*t);
Then i solve it with ode15s...
[y,t] = ode15s(@probleemvergelijking, [0 50], 1);
plot(y,t)
But the plot is just a straight line... What did i do wrong?

回答(1 个)

Star Strider
Star Strider 2017-12-21
You did nothing wrong, really.
Try this:
[t,y] = ode15s(@probleemvergelijking, [0 50], 1);
semilogx(t,y)
Your function stays near zero for a few values of ‘t’, then rapidly approaches 50 because the ‘100*t’ term predominates.

类别

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