Euler:
A basic ODE solver
MATH1902: Numerical Solution of Differential Equations
http://people.sc.fsu.edu/∼jburkardt/classes/math1902 2020/euler/euler.pdf
The Euler method steps off in the right direction, and gradually drifts away.
Euler
Writing a simple, general Euler code to solve a differential equation will give you an idea of the kind
of mathematical problems we are interested in, and the computational methods we use to solve them.
1 Introduction
This is an introduction for all of us. You would like to know what we are working on. We would like to
know how well prepared you are for the computational efforts in this directed study class.
We ask you to read this introductory material, which outlines a method for approximating the solution
of an ordinary differential equation (ODE). This method can be expressed in the MATLAB programming
language, and so we ask you to try to write euler.m, a file of MATLAB commands that carry out the
procedure for a general ODE. Then we consider a specific ODE, which describes the shape of a curve by
giving a starting value and the direction of motion at all subsequent times, and we write a MATLAB file
humps deriv.m which expresses the direction information. Now we are ready to solve the problem, but we
need one more file euler humps.m, which specifies the initial value, tells the euler method which problem to
solve, and makes a plot of the results.
We encourage you to try to follow the directions below that guide you in writing these programs and using
them. Please let us know if you can’t figure out to form a particular MATLAB expression, or can’t understand
an error message.
We hope that you will be able to write the three programs, run them together, and get a nice plot of the
results. You will be asked to submit your plot file as evidence of your work.
1