Home /
Expert Answers /
Other Math /
using-matlab-code-solve-initial-value-problem-by-the-backward-euler-method-we-use-previous-step-39-s-pa651
(Solved): Using matlab code. solve initial value problem by the backward
Euler method. we use previous step's ...
Using matlab code. solve initial value problem by the backward
Euler method. we use previous step's value for solving implicit
equation by newton's method.
Please fill in the blank. (3 blank)
f = @ (t,y) -y^3 - 1/2*y; y_init = 1; a = 0; b = 3; n =60; h = [blank 1]; t = a; y = y_init; fv = zeros (1, n+1); fv(1) = y_init; i = 1; fprintf("t=0.00x6fla", y_init); while i <= n t = t+h; y = [blank 2 ]; fprintf("t=.6f\n", t,y); i=i+1; fv(i) = y; end function sol = newtonsolve(y,h) a = y; b = [blank 3 -1 ]; while abs(b-a) > 0.00001 a = b; b = [blank 3-2 ]; end sol = b; end