X-Git-Url: http://gitweb.michael.orlitzky.com/?p=octave.git;a=blobdiff_plain;f=forward_euler1.m;h=2c1fb22b85d174a512749908e8c1a0e45e4fcd2a;hp=3e1061d48340b1b3db9c4c4c45c1ced56528b82e;hb=b12c6c2a4bf4cef29b2e08b743c92889505c7ed9;hpb=e1b71b4ca7cfa08ac76744a17a3778d4ccfaa7e2 diff --git a/forward_euler1.m b/forward_euler1.m index 3e1061d..2c1fb22 100644 --- a/forward_euler1.m +++ b/forward_euler1.m @@ -1,20 +1,20 @@ function y = forward_euler1(x0, y0, f, h) - ## Compute one iteration of the forward Euler method. - ## - ## INPUT: - ## - ## * ``x0`` - The initial x-coordinate. - ## - ## * ``y0`` - The initial value y(x0). - ## - ## * ``f`` - The function y' = f(x,y) of two variables. - ## - ## * ``h`` - The step size. - ## - ## OUTPUT: - ## - ## The approximate value of y(x) at x = x0+h. - ## + % Compute one iteration of the forward Euler method. + % + % INPUT: + % + % * ``x0`` - The initial x-coordinate. + % + % * ``y0`` - The initial value y(x0). + % + % * ``f`` - The function y' = f(x,y) of two variables. + % + % * ``h`` - The step size. + % + % OUTPUT: + % + % The approximate value of y(x) at x = x0+h. + % y_prime = f(x0,y0); y = y0 + h * y_prime; end