Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Matlab Script file answering such questions below using the methods explained. Euler's Method The Euler Method is the simplest of the numerical methods

Write a Matlab Script file answering such questions below using the methods explained.

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Euler's Method The Euler Method is the simplest of the numerical methods we cover, and as we saw in class is closely related to a Left Riemann Sum. The algorithm (in pseudo code) for Euler's Method is as follows: define f(ty) input initial values to and yo input step size h and number of stepsn output to and yo for, from 1 ton k1=f(t,y) y = y + h*k1 t = tuh end output t and y. 1. Write a script that applies Euler's Method to the initial value problem y'=1-t + 4y, with y(O)=1 on the interval[0, 2] using a step size of h=0.01. Compare your answer to the values 2. Write a script that applies the Improved Euler Method to the same function as in problem 1. Finally, we have another method that uses a weighted average of slopes at four different points to estimate the integrals, which is precisely equal to Simpson's rule iff does not depend on y. Again, only the for-loop gets changed in the algorithm. K1 = f(t, y) K2 = f(t +0.5*h, y +0.5*h*k1) K3 = f(t +0.5*h, y +0.5*h*k2) K4 = f(t + h, y + h*k3) Y = y + (h/6)*(k1 + 2*k2 + 2*k3+k4) T=t+h 3. Finally apply this method to the same problem in 1 and 2. This time use a step size of h = 0.1 and compare your results to those given in the table on p. 470. 4. Solve the initial value problem (1.5)=0.5 dty tell a. Use ode45() to find the approximate values of the solution at t = 0.1.1.8.2.1 and also plot the solution. b. Now plot the numerical solution of several large intervals and make a guess about the nature of the solution as t 00. 5. Consider the initial value problem e" + (te sin y) y = D. H(2)=1.5 a. Use ode45() to find approximate values of the solution at x =1.1.5. and 3. Then plot the solution on the interval [0.5.4]. b. Plot the solution for several large intervals and guess at the behavior of the solution as C. Plot the solution for several intervals of the form [e. 2], where is a small number. What do you think is happening as t 0*

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions