eulers method and relative error
显示 更早的评论
hi im new to matlab and have this question ,
Use Euler’s method to evaluate the solution to the system of differential equations over the first 20 hours. Use a step size of h = 15 minutes and examine the relative error between the numerical and analytical calculations.
these are the equations
1) R + k*x2(t) - k*x1(t)
2) k*x1(t) - (alpha + k) * x2(t)
values of aplha = 10
k = 50
and R = 100
can anyone help ?
3 个评论
Jim Riggs
2020-12-10
What you need to do is write a program that implements Euler's method to solve both of these equations, and compare the result to the analytical (i.e. exact) answer. This will give you an measure of the amount of numerical error in the Euler's method.
courteney fishwick
2020-12-10
Well, I don't use the symbolic processing toolbox, so I don't have any advice regarding that.
But the reference to X1(0) and X2(0) may be the problem. If the numbers in the parenteses are subscripts, they must be positive, that would be what the error is indicating. A value of zero is not positive. Needs to be 1 or greater (integer or logical type)
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!