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!