Euler Method - Exercise 2 Solution
Numerical Methods for Solving Differential Equations
Euler's Method
Using the Method with Mathematica
(continued from last page...)
Solution to Exercise 2
Solution Name |
Differential Equation |
Initial Condition |
Solve up to |
Number of Steps |
---|---|---|---|---|
eulerex2 | y′ = x - y | y(0) = 0.5 | x = 1 | 20 |
Your solution, in tabular form, and abbreviated to save space, should have looked something like this:
0 0.5
0.05 0.475
0.1 0.45375
. .
. .
. .
0.95 0.51603
1. 0.537729
And your plot of this solution should have looked something like this (though your points may not have been this size, or in color):
If your solution doesn't match what you see here, then go back to Mathematica and carefully check the parameters that you passed to the euler program. If necessary, change them, and reevaluate the commands.
Now, back to the exercises...