- 2 3
| x' = t + x
| x(0) = 0
-
-
| x' = f(t,x(t))
| x(a) = s
-
using n steps of size h=(b-a)/n. You may assume the
existence of an external Matlab function func.m which is
invoked via func(t,x) to evaluate the function
f(t,x(t)) in the IVP.
function [e] = euler(n,a,b,s)
h = (b-a)/n;
|
- 3 y
| x' = x + e + t
| 2
| y' = log x - cos y + t x
|
| x(0) = 1, y(0) = 2
-
-
| x''' = 2 x'' + cos(tx) - x'/t
| x(1) = 1, x'(1) = 0, x''(1) = 2
-