logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

You  will solve this   by two second-order Runge-Kutta methods. The first method is a second-order Runge-Kutta with the parameter from class

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

1. (10 points) Consider solving the initial value problem given by

y˙    = f (t, y  . 1

  1. t) + cos(y + t)[arctan(y) − 1cos(y)]

over  t [0, 5] with initial condition y(0)  =  1.   You  will solve this   by two second-order Runge-Kutta methods. The first method is a second-order Runge-Kutta with the parameter from class being γ = 0.5 (equivalently, c2 = 0.5 in the textbook, page 361). The second method is a second-order Runge-Kutta with the parameter from class being  γ = 100 (equivalently, c2 = 100 in the textbook, page 361). Apply both methods with n = 10, 102, 103 and 104 steps. For each method, plot all the approximate solutions (for various n) on a single graph (for two plot windows in total – one per method). Treating the solution with γ = 0.5, n = 105 as the true solution, plot the log10 of the errors (i.e.,  yn   y¯(tn) ) versus the log10(n) for each method, all on one graph, but in different colors. Using matlab, indicate which color corresponds to which method on your graph. Comment on the slopes.

  1. (5 points) Do the same thing as in the previous problem, but now include the fourth-order Runge-Kutta method (that you have written yourself) as well. In this problem, treat the fourth-order Runge-Kutta solution with n = 105 as the true solution. Also, in addition to plotting

the log10 of the errors (i.e., |yn−y¯(tn)|) versus the log10(n), plot the log10

of the errors versus the log10 of the number of function evaluationsthe number of times that you evaluated f (t, y)) for each method. Has this changed the slopes compared with the plot where the horizontal axis was the number of steps (log10(n))?

  1. (3 points) Do the same thing as in the previous problem, but now include Euler’s method. From the log-log plot, estimate the error in Euler’s method with n = 1000 steps.

  2. (12 points) Now modify the initial value problem to

 

y˙ = f (t, y)+ σB 

t)+ cos(y + t)[arctan(y) − 1 cos(y)]+ σB˙ ,  (1)

where σ = 0.1 and B(t) denotes a Brownian motion (and the deriva- tive notation is only formal, but fine for our needs). Approximate the solution of this IVP by combining the Euler method with an addition of Gaussian noise (a normal random variable) at each step. That is, modify your Euler one-step update to be

y     = y + hf (t , y ) + σ√h ν ,

where νk has mean zero and variance one, and where the νk are all independent from each other. (You may use the matlab command “nu=randn;” to create each of these νk values.) Let the number of steps in each simulation be n = 1000. Save the terminal values, yn, for each run, and run this code NR times. Note that you have generated NR values of yn. Make a histogram with 20 bars, of these values. Do this two times, each time with NR = 1000, creating two histograms. Are these identical? If not, roughly explain why. Now, do this one more time, but with NR = 4000. By examining the data from the output of

your code in the case NR = 4000, roughly estimate the probability that the solution of (1) will be within ±0.2 of the nominal solution (i.e., the one with no noise). How about within ±0.4?

  • (10 points) Adapt (if necessary) your  fourth-order Runge-Kutta  code to handle systems of ODEs. Apply your code to the ODE system given by

only values for the number of steps of the form n = 2k, find the smallest value of n such that the error in the terminal value is less than 10−8. (Here, by error with n steps, we mean the euclidean norm of the vector

error, i.e., en  .  √(yn − y¯1(6))2 + (yn − y¯2(6))2, where (y¯1(6), y¯2(6)) is

the true solution at t = 6.  As usual, given that we do not know the

true solution, you may substitute the next size of n, nˆ = 2k+1, in place of the true value.)

  • (10 points) Consider the previous problem. Suppose you can vary µ, and that you  would  like to  find  the  value  of  µ such  that  y¯1(6) = − Apply a secant method, starting from µ0 = 4 and µ1 = 3 to search for this value of µ. You may exit the secant method when y1(6) ( 5) < 10−6. Note that the secant method will call your Runge-Kutta code to

evaluate the function. You should use the value of n that you obtained in the previous problem as the number of steps in the Runge-Kutta code.

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

791 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

625 Answers

Hire Me
expert
Husnain SaeedComputer science

534 Answers

Hire Me
expert
Atharva PatilComputer science

871 Answers

Hire Me
June
January
February
March
April
May
June
July
August
September
October
November
December
2025
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
00:00
00:30
01:00
01:30
02:00
02:30
03:00
03:30
04:00
04:30
05:00
05:30
06:00
06:30
07:00
07:30
08:00
08:30
09:00
09:30
10:00
10:30
11:00
11:30
12:00
12:30
13:00
13:30
14:00
14:30
15:00
15:30
16:00
16:30
17:00
17:30
18:00
18:30
19:00
19:30
20:00
20:30
21:00
21:30
22:00
22:30
23:00
23:30