Question

Matlab Project Recall that we can approximate the time derivative of a function y(t) at time tn as dt ΔΙ This follows from th
Use your results from parts 1-3 to answer the following questions in a short (less than a page) How can you measure the errorPlease help me with this short, matlab/diffy q project.. teacher said it’s supposed to be a short code
Matlab Project Recall that we can approximate the time derivative of a function y(t) at time tn as dt ΔΙ This follows from the limit definition of the derivative and gives the approximate 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, then the approximate solution to the equation f(t,) is given by Euler's Method as -/(tn,th), where t,-ηΔt. We can rearrange this formula to approximate the value of the solution yn+i at time t+1 given that we already know the value of yn at time tn: Starting with our initial condition y(to) = yo, we iterate this method to find the approximate solution at ti, then t2, and so on until we reach the desired final time, ty. Use these ideas and your programming knowledge of Matlab (or another programming language) to study the behavior of the equation u' = 2y-e-t-1, y(0)-1 then complete parts 1-3 and answer the questions below. 1 by hand using Euler's 1. Compute the approximate solution of equation (1) from to 2. Compute the approximate solution of equation (1) from to = 0 to t/a 1 numerically (ie. 3. Compute the exact solution of equation (1) analytically (i.e. using pencil and paper with the 0 to t Method with a timestep of At 0.25. Show your work. programming the solution on the computer) using Euler's Method with timesteps of At-0.1, 0.01, and 0.001 appropriate solution method from class). Show your work.
Use your results from parts 1-3 to answer the following questions in a short (less than a page) How can you measure the error of your method? Where is the error the worst? Does it . Graph the error as a function of time for each value of Δ. How does the error depend on write-up. increase or decrease with time? At? Explain. Additionally, comment on the correlation of the error and the timester compare the factor that the error decreases and the factor that the timestep decreases). To determine the exact relationship between Δt and the error, it might be helpful to investigate the behavior of the error as the timestep is decreased by different factors, like by I/2 instead of 1/10 (e.g. At 0.02, 0.01, and 0.005) For y(0)o 1, how does the solution behave as t 00? 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, you don't need to go all the way to too with your code (not that you could anyways). In fact, it should be sufficient to check the result at 5 or so to get a sense of the behavior. Present your work in a neat and organized manner. Also, please print and attach the program, not the output data) at the end of your writeup. your code (just
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Given below is the implementation of second problem in matlab which is the only programming assignment.

y_0 = 1;
y_n = y_0;
for interval = [0.1,0.01,0.001]
y_n=y_0;
for t = 0.0: interval: 1.0
y_n=y_n+(((2*y_n)-exp(-1.0*t)-1)*interval);
end
sprintf('approximate value of y(t) at t=1.0 taking time gap = %f is %f ',interval,y_n)
end

Add a comment
Know the answer?
Add Answer to:
Please help me with this short, matlab/diffy q project.. teacher said it’s supposed to be a short code Matlab Project Recall that we can approximate the time derivative of a function y(t) at time...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT