How are propagation points connected?
1 次查看(过去 30 天)
显示 更早的评论
Hello,
I am approaching the numerical propagation of ODE for the first time, so maybe my question is very stupid.
Anyways, supposing I am using a Runge Kutta 45 integrator to make my propagation in time (so, a 4th order integration scheme), I was wondering how Matlab connects the propagation point while, for example, plotting the results. Are the solutions at each integration time step connected by a simple line or some other kind of interpolation is performed among them, maybe in accordance with the order of the integration scheme itself?
Thank you!
Marco
0 个评论
回答(1 个)
Steven Lord
2022-6-29
The plot function connects the points you specify with straight lines. As the number of points you plot increase the curve looks more curved, as you can see in the examples below.
Now if you're asking about the computations performed inside ode45 that's a bit different.
for numPoints = [3:10 50 100]
x = linspace(0, 1, numPoints);
y = x.^2;
figure
plot(x, y, 'o-');
title("Approximation of x^2 with " + numPoints + " points")
end
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!