Question: 1. Write a pseudocode (pen and paper) algorithm that solves the ODE y0 = f(t,y) using Eulers method. 2. Convert this algorithm into MATLAB syntax,
1. Write a pseudocode (pen and paper) algorithm that solves the ODE y0 = f(t,y) using Eulers method.
2. Convert this algorithm into MATLAB syntax, as the function euler method . (a) Your inputs should be the start time t0, the end time tend, the function f, an initial condition y0 and an initial step size h. (b) If hf(t,y) at any point exceeds 1, your function should halve the step size h. (c) Equally, if hf(t,y) at any point drops below 0.01, your function should double the step size h. (d)You should also make sure that the nal solution step doesnt overshoot tend. (i.e. change h during the nal step to exactly reach tend). (e)Also include a discussion of when the code could break, or give incorrect outputs (you DO NOT need to design your code to avoid these).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
