MATH1052 Semester 1 2001

Computer Project 2


 








For each question you are required to submit working for all calculations done by hand and a list of commands used for all calculations performed by Matlab.

Assignment

1. Calculate, by hand, the solution to the first-order differential equation

,           y(1/2) = 3/8 Now use a for loop construction to code the Euler’s method solution of this equation over the interval 0.5 < x < 3 using intervals of size Dx = 0.5. (Remember, if you break any interval of x into N pieces, then your arrays storing the answers for plotting will have N+1 elements because you have to include a beginning and ending set of points.) Repeat the calculation using Dx = 0.25. Submit: one graph over the domian 0.5 < x < 3 which shows the exact solution you obtained and the two approximations found through Euler's method.
  1. Euler’s method can also be used for second order differential equations of the form
.

To achieve this, introduce a new variable  such that  and .

We may now write

,

.
 

Euler’s formula for this case reads

,

.

Apply Euler’s formula to find an approximate solution for

,

over the interval  with  and plot this solution. Calculate the

exact solution by hand and plot this also on the same graph.