Euler's method approximates the solution to a differential equation as
where
. The challenge is to write a code that can take some arbitrary function, f(t,x), and use Euler's method to integrate over N equally-spaced points (
equal intervals) between times
and
. You must implement the boundary condition
.
Solution Stats
Problem Comments
5 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers20
Suggested Problems
-
Maximum running product for a string of numbers
2253 Solvers
-
Back to basics 13 - Input variables
382 Solvers
-
531 Solvers
-
Matrix of almost all zeros, except for main diagonal
191 Solvers
-
Orthogonalize 3 column vectors using the Gram-Schmidt process
13 Solvers
More from this Author3
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
If there are N points, isn't the time interval (tf-t0)/(N-1)?
Well-spotted.
Good catch! Fixed. Thanks for your comment!
Are you sure you fixed it on this problem as well and not just on 59676?
To ensure correctness, it's better to define h as t(2)-t(1) (it's not yet corrected).