Delta Banner

Mathematics & Science Learning Center
Computer Laboratory

 

Numerical Methods for Solving Differential Equations

Euler's Method

Using the Method with Mathematica

(continued from last page...)

The result should have been:

MatrixForm[prelimsol1]

Matrix Output

If you compare this with the solution that we got by hand in the introduction, you'll see that the results are identical.

You'll probably recall, however, that these results are extremely inaccurate. The exact solution to the problem, at the same set of points, was:

Let's focus for now on the last point in this exact solution—(1.00, 1.097264), which is quite different from its numerical solution counterpart of (1.00, 0.515625). Can we get the numerical solution to come out closer to the correct value?

We said earlier that the probable reason for this inaccuracy was that we used such a small number of steps, a mere 4, in finding the solution. However, we're now in a position to become much more ambitious with the number of steps, since the computer will be doing all of the work. To recalculate the solution using 20 steps, issue the command:

prelimsol2=euler[x+2y,{x,0,1},{y,0},20]

followed immediately by:

MatrixForm[prelimsol2]

Let's go look at what you should have gotten...


Compass If you're lost, impatient, want an overview of this laboratory assignment, or maybe even all three, you can click on the compass button on the left to go to the table of contents for this laboratory assignment.
 
 

ODE Laboratories: A Sabbatical Project by Christopher A. Barker

©2017 San Joaquin Delta College, 5151 Pacific Ave., Stockton, CA 95207, USA
e-mail:
cbarker@deltacollege.edu