Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

%% Lab 3 – Your Name – MAT 275 Lab% Introduction to Numerical Methods for Solving ODEs%% Exercise 1% Part (a)% NOTE: We often define the right-hand side of an ODE as some function, say% f, in terms of the input and output variables in the ODE. For example,% dy/dt = f(t,y) = 3y.

%% Lab 3 – Your Name – MAT 275 Lab% Introduction to Numerical Methods for Solving ODEs%% Exercise 1% Part (a)% NOTE: We often define the right-hand side of an ODE as some function, say% f, in terms of the input and output variables in the ODE. For example,% dy/dt = f(t,y) = 3y. Although the ODE does not explicitly depend on t, it does% so implicitly since y is a function of t. Therefore, t is an input% variable of f.% Define ODE function f for ODE dy/dt = f(t,y) = 3y.% Define vector t of time-values over the interval [0,0.5] to compute% analytical solution vector.% Create vector of analytical solution values at corresponding t values.% NOTE: For the following steps, please use notation consistent with the% protocol–e.g., use t5 to represent the time vector produced from Euler’s% method using 5 timesteps and use y500 to represent the numerical solution% vector produced from Euler’s method using 500 timesteps. In the following% comments, I refer to “Euler’s method” as “forward Euler’s method,” which% is more precise since there is also a backward Euler’s method. I use IVP% as an abbreviation for initial-value problem, which for our purposes here% means an ODE with associated initial condition.% Solve IVP numerically using forward Euler’s method with 5 timesteps.% Solve IVP numerically using forward Euler’s method with 50 timesteps.% Solve IVP numerically using forward Euler’s method with 500 timesteps.% Solve IVP numerically using forward Euler’s method with 5000 timesteps.% In the following steps, we define error as analytical (solution value% – numerical solution value).% Compute numerical solution error at t=0.5 for forward Euler with 5% timesteps.% Compute numerical solution error at t=0.5 for forward Euler with 50% timesteps.% Compute numerical solution error at t=0.5 for forward Euler with 500% timesteps.% Compute numerical solution error at t=0.5 for forward Euler with 5000% timesteps.% Compute ratio of errors between N=5 and N=50.% Compute ratio of errors between N=50 and N=500.% Compute ratio of errors between N=500 and N=5000.% NOTE: To complete the following table, simply run this section after% you’ve finished the steps above and copy and paste your errors and ratios% into the follwing display commands. Make sure you re-align each column% after entering in values so that it looks pretty.% Display table of errors (and ratios of consecutive errors) for the% numerical solution at t=0.5 (the last element in the solution vector)

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"