How to check order of accuracy of Euler forward
1 次查看(过去 30 天)
显示 更早的评论
Is there a general code for how to check the accuracy order of Euler forward?
I have the odes:
odes = @(t,y) [0.272 - 0.00136*y(1) - 0.00027*y(1)*y(4);
2.7e-5*y(1)*y(4) - 0.00136*y(2) - 3.6e-2*y(2);
2.43e-4*y(1)*y(4) + 3.6e-2*y(2) - 0.33*y(3);
100*y(3) - 2*y(4)];
for i=1:n
y0(:,i+1)= y0(:,i)+dt*(odes(t(i),y0(:,i)));
i=i+1
end
with
n=200;
dt=120/n;
t=0:dt:120;
y0 = [200; 0; 0; 4e-7];
How can I determine the order of accuracy?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Assembly 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!