eulers method and relative error
14 views (last 30 days)
Show older comments
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 Comments
Jim Riggs
on 11 Dec 2020
Edited: Jim Riggs
on 11 Dec 2020
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)
Answers (0)
See Also
Categories
Find more on Linear Algebra in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!