1 / 5

Solve Differential Equations Using The Euler Method.

Solve Differential Equations Using The Euler Method. Sung-Ju Kang Department of Physics Kangwon National University.

Download Presentation

Solve Differential Equations Using The Euler Method.

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Solve Differential Equations Using The Euler Method. Sung-Ju Kang Department of Physics Kangwon National University Although Euler Method is seldom used in practice, the simplicity of its derivation can be used to illustrate the techniques involved in the construction of some of the more advanced techniques. The object of the method is to obtain an approximation to the well-posed initial-value problem Approximations to y will be generated at various value, called mesh point, in the interval [a,b].

  2. Theory We will use Taylor’s theorem to derive Euler’s method. Suppose that y(t) has two continuous on [a,b], so that for each i = 0, 1, 2, …. , N. Since And, since satisfies the differential equation. Thus, Euler’s method is t2 from t1 again by the same formula. Above Equation is called the Difference Equation associated with Euler’s method.

  3. Algorism To approximate the solution of the initial-value problem. INPUT function: f(t), begin point: a, integer: N, step size: dt, initial condition: y0. OUTPUT application y to values of t. Step1 Set t = a ; y = y0 ; Step2 For i = 0, 1, 2, … , N Step3 Set y = y + dt*f(t) ; OUTPUT (t, y) Set t = t + dt ; Step4 STOP.

  4. Programming with C language #include <stdio.h> #include <math.h> #include <conio.h> #include <stdlib.h> long double y, t, dt, N, f; void EULER(); void DF(); void PRINT(); void main() { dt = 0.2; N = 10.0; t = 0.0; y = 0.5; EULER();  } void EULER() { int i; for(i=0;i<=N;++i){ DF(); y=y+dt*f; PRINT(); t=t+dt; } } void PRINT(){ printf(“t=%20.15Lf y=%20.15Lf \n", t, x); } void DF(){ f=-y+t+1 }

  5. Summary 1. The object of the Euler Method is to obtain an approximation to the initial-value problem. 2. Approximations to y will be generated at various value, called mesh point. 3. Although Euler Method is not accurate enough to warrant its used in practice, it is sufficiently elementary to analyze the error that is produced from its application.

More Related