# Matlab : Euler Formula and Runga-Kutta Fourth Order

I am posting formula called Runge Kutta Fourth Order. This formula need to be written in a matlab program.

I attached sample program how to generate euler formula in mathlab. Based on this program, can any one send matlab program for Runga Kutta Fourth Order?

See attached files for full problem description.

© BrainMass Inc. brainmass.com October 9, 2019, 7:28 pm ad1c9bdddfhttps://brainmass.com/math/analytic-geometry/matlab-euler-formula-and-runga-kutta-fourth-order-119333

#### Solution Preview

I am assuming that the fun.m.txt is the function you wanted to implement. Any other function

which finds (dy/dt) = y' = f(t,y) could be substituted . For example if you change f(t,y) as follows to get a solution for y' = y - t^2 + 1 (as in the problem in the book)

function z =f(t,y)

z = y - t^2 + 1

The function is given below. This is a as is implementation of the algorithm in the book

To use it save it as runga.m , open and type runga(a,b, N , ...

#### Solution Summary

The Euler Formula is formulated as a Runga-Kutta Fourth Order problem in Matlab.