Question: write a script in matlab for the following PROBLEM. DO NOT GIVE GENERAL SOLUTION TO ODE, must give numerical approximation. NUMERICAL ANALYSIS! Problem 1 (Numerical

write a script in matlab for the following PROBLEM. DO NOT GIVE GENERAL SOLUTION TO ODE, must give numerical approximation. NUMERICAL ANALYSIS!

write a script in matlab for the following PROBLEM. DO NOT GIVE

Problem 1 (Numerical solution of a ODE). Consider the following scalar ordinary differential equation ODE): z'(t) =-x(t), 2 For this particular equation, we know the exact solution: it corresponds to the exponential growth r(t) - e Implement codes for the following methods: the explicit Euler method, the implicit Euler method, the (implicit) trapezoidal (Crank-Nicolson) method, the (implicit) BDF-2 method. For this method, you need to bootstrap in the first time step; use the Crank-Nicolson method for this Then compute approximations to x 4) using each of four methods and with step sizes ?t 21, T, . . . . T. Compute their respective errors e = IxN-x(4)| where xN s the approximation to x(4) at the end of the last time step. For each method, create either a table or a At-vs-e graph that shows how the error decreases as the mesh size is reduced. (For the graph, you will want to consider a log-log plot.) In all cases, the error should behave as e ~ C ?ts for some C that we would like to be as small as possible, and an s that we would like to be as large as possible. Determine both C and s from your data Discuss which method yields the most accurate answer. (40 points) Problem 1 (Numerical solution of a ODE). Consider the following scalar ordinary differential equation ODE): z'(t) =-x(t), 2 For this particular equation, we know the exact solution: it corresponds to the exponential growth r(t) - e Implement codes for the following methods: the explicit Euler method, the implicit Euler method, the (implicit) trapezoidal (Crank-Nicolson) method, the (implicit) BDF-2 method. For this method, you need to bootstrap in the first time step; use the Crank-Nicolson method for this Then compute approximations to x 4) using each of four methods and with step sizes ?t 21, T, . . . . T. Compute their respective errors e = IxN-x(4)| where xN s the approximation to x(4) at the end of the last time step. For each method, create either a table or a At-vs-e graph that shows how the error decreases as the mesh size is reduced. (For the graph, you will want to consider a log-log plot.) In all cases, the error should behave as e ~ C ?ts for some C that we would like to be as small as possible, and an s that we would like to be as large as possible. Determine both C and s from your data Discuss which method yields the most accurate answer. (40 points)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!