Question: this is mathlab problem Recall that we can approximate the time derivative of a function y(t) at time tras dyy(tn + At) y(tn)_ Yn+1 -

 this is mathlab problem Recall that we can approximate the time
derivative of a function y(t) at time tras dyy(tn + At) y(tn)_
this is mathlab problem

Recall that we can approximate the time derivative of a function y(t) at time tras dyy(tn + At) y(tn)_ Yn+1 - Yn dt At At This follows from the limit definition of the derivative and gives the approx- imate slope of the function y(t) at time tn. If we think about 'stepping through time from some initial time to a later time in steps of size At (where the index n can be thought of as giving the total number of steps taken to get to tn, i.e. to is the initial time with no steps taken, t, is the time after one step has been taken, etc.), then the approximate solution to the equation y = f(t, y) is given by Euler's Method as Yn +1 Yn = f(tn, yn), where tn = nAt. At We can rearrange this formula to approximate the value of the solution Yn+1 at time trt1 given that we already know the value of yn at time to: Yn+1 = yn + f(tn, yn)At. Starting with our initial condition y(to) = yo, we iterate this method to find the approximate solution at t, then t2, and so on until we reach the desired final time, ts. Use these ideas and your programming knowledge of Matlab to study the behavior of the equation y = 2y-e-1, y(0) = 1 then complete parts 1 and 2 and answer the questions below. (1) 1. Compute the approximate solution of equation (1) from to 0 to ty = 1 numerically (i.e. programming the solution on the computer) using Euler's Method with timesteps of At = 0.1, 0.01, and 0.001. 2. Compute the exact solution of equation (1) analytically i.e. using pencil and paper with the appropriate solution method from class). Show your work Use your results from parts 1 and 2 to answer the following questions: How can you measure the error of your method? Where is the error the worst? Does it increase or decrease with time? Graph the error as a function of time for each value of At. How does the error depend on At? Explain. Additionally, comment on the cor- relation of the error and the timestep (Hint: compare the factor that the error decreases and the factor that the timestep decreases). To determine the exact relationship between At and the error, it might be helpful to investigate the behavior of the error as the timestep is de- creases by different factors, like by 1/2 instead of 1/10 (e.g. At = 0.02, 0.01, and 0.005). For y(0) = yo = 1, how does the solution behave as too? How does this change if yo=0? At approximately what value of yo to the nearest 0.1) does the large t behavior change from one to the other? To answer these questions, it should be sufficient to check the answer to ty = 5 or so. Present your work in a neat and organized manner. Also, please print and attach your code (just the program, not the output data) at the end of your writeup

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!