# Eulers Method

In mathematics and computational science, Euler method is a first-order numerical procedure for solving ordinary differential equations (ODEs) with a given initial value. The most basic explicit method for numerical integration of ordinary differential equations and is the simplest Runge–Kutta method. Euler method is named after Leonhard Euler, whom treated it in his book Institutionum calculi integralis (published 1768–70).

The Euler method is a first-order method, means that the local error (error per step) is proportional to the square of the step size; the global error (error at a given time) is proportional to the step size. Euler method often serves as the basis to construct more complicated methods.

Consider the problem of calculating the shape of an unknown curve which starts at a given point and satisfies a given differential equation. Differential equation can be thought of as a formula by which the slope of the tangent line to the curve can be computed at any point on the curve, the position of that point has been calculated.

The Euler Method:

The straight forward approach is to replace y? i by its forward difference approximation.

This gives:

(yi+1– yi)/h= f (ti, yi).

Rearranging it gives us a method to obtain yi+1 from yiknown as Euler’s method:

yi+1 = yi+ hf (ti, yi).

With this formula you are able to start from (t0, y0) and compute all the subsequent approximations (ti, yi).

To utilization this program we need a function such as the vector function for the pendulum

> f = inline(’[y(2);-.1*y(2)-sin(y(1)) + sin(t)]’,’t’,’y’)

Then type:

> [T Y] = myeuler(f,[0 20],[1;-1.5],5);

Here [0 20] is the time span you desire to consider, [1;-1.5] is the first value of the vector y and 5 is the number of steps. The output T contains times as well as Y contains values of the vector as the times. Try

>size(T)
>size(Y)

Since initial coordinate of the vector is the angle we merely plot its values

>theta = Y(:,1);
>plot(T,theta)

In this plot it is clear that n = 5 isn’t adequate to represent the function. The type

> hold on

Afterwards redo the above with 5 replaced by 10. Next try 20, 40, 80, and 200. As you are able to see the graph becomes increasingly better as n increases. We are able to compare these calculations with Mat lab’s

built-in function with the commands

> [T Y]= ode45(f,[0 20],[1;-1.5]);
>theta = Y(:,1);
>plot(T,theta,’r’)

Assignmenthelptutors.com is dedicated to outstanding service with:

• They always available representatives live online support (chat and email) 24/7;
• discounts for repeat customers;
• secure payment methods and 100% confidentiality;
• Euler Methods and Differential Equations helps for students all over the world.
• No Plagiarism

When you need the best Euler Methods and Differential Equations online assistance, our team is here for you. We provide you 24/7 support teams dedicated to your success, Assignmenthelptutors.com experts having experience and degrees in their fields Euler Methods and Differential Equations programming work and degrees, and even easy safe methods for reaching our experts when you need them. Assignmenthelptutors.com Euler Methods and Differential Equations homework assignments do not have to be the worst experience of your school career, Assignmenthelptutors.com is here to provide you with the highest quality Euler Methods and Differential Equations assistance every time.