In Class
1. Solve the following initial value ODE between t = 0 and t = 1s with y(0) = 1 with step size of 0.25s:
a) Analytically
) Using Eulers method.
c) Huens method
d) RK Order 4.
e) Compute the true e
or at t = 1s with each method.
2. Using the RK-Hehlbeg routine below, a step size of 0.25s, compute y at t=0.25s (i.e., you need only compute 1 step),
a) compute the 4th and 5th order RK results),
) use the results to obtain the approximate e
or at 0.25s,
c) use the true value to compute the true e
or at 0.25s.
3. Develop a flow chart and pseudo code for computing the RK-Fehlberg solution with integral calculation of the approximate e
or at each time step.
Take home:
4. Develop a matlab code based on Q3 and verify it for a dt=0.25s against your solution to Q2. Include the tic toc command to calculate the execution time of your code.
5. Plot the approximate e
or as a function of step size dt on plot of log(e
or) vs. step size. On the same plot include the log(e
or_true) as a function of step size.
6. Using the matlab solver ode45, compute the solution to the problem at t = 1s. What is the approximate and true e
ors at t=1s. Compare the results in terms of accuracy and computational time to the results in Q5 and discuss the differences.