subject
Engineering, 18.02.2021 20:40 stdias

-Y PC 1:24) Ci Yk+1 2. Runge-Kutta Radioactivity Most of us are familiar with carbon-14, the naturally occurring, radioactive isotope of carbon used in radiocarbon dating, but few know of its less-useful cousin, carbon- 15. In contrast to the relatively long-lasting carbon-14, which has a half-life of 5,730 years, carbon-15 has a half-life of only 2.45 seconds. The amount of carbon-15 over time is given by the following decay equation dy In (2) (2) dt t1/2 where y is the remaining amount of carbon-15 and t1/2 is the half-life in seconds. At time t = 0, the initial amount of carbon-15, yo, is 1. The exact solution to this differential equation is In (2) y(t) = yo exp (3) We will use the exact solution to evaluate and compare the accuracy of the three different numerical methods to capture this rapid decay process. RK1 Atf(tkyk) = yk +1 - Atf(tk, yk)
RK2 = Atf (tx + At, yk + c) = yk + 2 - Atf(tkyk) - Atf (tx + At, yk + })
RK4 - Atf (tk + At, Yk + }) - Atf (tx + At, yx + ) Jk+1 = k + c + c2 + 3^3 + 3c4
As discussed in class, we will compare and contrast first order (RK1, aka explicit Euler), second-order (RK2), and fourth order (RK4) Runge-Kutta methods, which generally rely on braking a single time-step down into multiple, incremental calcula- tions in order to reduce overall error.
(a) Write a single function containing all three methods to advance the discretized solution by one time-step. The function must use exactly the function header shown below, where the function name and number and order of inputs and outputs must be followed exactly. function [y] = advanceRK( y, dt, method) C1 C2 Yk+1 Ci C2 C3 C4 where at is the time-step size and method is either 1, 2, or 4 to choose whether to calculate the value at yk+1 using the first, second, or fourth order approxima- tion, respectively. The current amount of carbon-15, y, is used to calculate the dt RKI RK4 value at the next time-step, y = y + ..., and the update value is returned as the single output Note: Although all three methods are included in a single function, only the result generated by the method option will be calculated with a single function call. t1/2 is a constant in this problem, not to be confused with the time-step size At, or time t. Establish a clear variable naming convention and use it consistently.
(b) Write a program that repeatedly calls your advanceRk function to solve Equa- tion 2 up to t final = 15 seconds using each of three different numerical meth- ods (you will need to call your function 3 times, specifying a different method each time) using three different time-step values, At = [1, 0.1, 0.01). Gener- ate 3 plots, one for each value of At, containing four curves each, 3 numerical method solutions and one exact solution. Additionally, print the average error associated with each method using exactly the format shown below (values shown are for illustration purposes only): RK2 1.00: 3.14e-02 3.682-03 1.64e-05 0.10: 3.24e-033.262-05 1.44e-09 0.01: 3.24e-04 3.21e-07 1.42e-13 The values in the table are the mean values of the absolute errors between the numerical approximation and the exact solution given by Equation 2. For ex- ample, to calculate the average RK4 error for a given At, calculate the vector of differences, RK4 - exact, ignore negative signs, and calculate their average. Note: You can open a new plotting window with the keyword figure to ensure that plots 1, 2, and 3 do not simply overwrite one another.
(c) Using your most accurate numerical method, what percentage of the original amount of carbon-15 remains after just 15 seconds? Just by examining the scaling of the average errors, explain how you can verify that the three different methods incur error that scales like (dt), (dt), and (dt); that is, first, second, and fourth-order, respectively? What happens to all three solutions (particularly RK1 / Euler) when we take a very large time-step, i. e. At = 5s? Why does this occur?

ansver
Answers: 3

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Which of the following components of a pid controlled accumulates the error over time and responds to system error after the error has been accumulated? a)- proportional b)- derivative c)- integral d)- on/off.
Answers: 2
question
Engineering, 04.07.2019 18:10
Ifa component is made of two or more materials with different modulus of elasticity (e), it is called a composite member and we calculate the factor·n". mention the formula for calculating n". also, ifn> 1, explain what will happen to the 1. transformed.gi) ifn 1, what will happen to the material when transformed material when
Answers: 1
question
Engineering, 04.07.2019 18:10
Compute the pressure drop of 30°c air flowing with a mean velocity of 8 m/s in a circular sheet-metal duct 300 mm in diameter and 15 m long. use a friction factor, f 0.02, and pair = 1.1644 kg/m a. 37.26 pa b. 25.27 pa n c. 29.34 pa d. 30.52 pa
Answers: 1
question
Engineering, 04.07.2019 18:20
Ahe-xe mixture containing a 0.75 mole fraction of helium is used for cooling electronics in an avionics application. at a temperature of 300 k and atmospheric pressure, calculate the mass fraction of helium and the mass density, molar concentration and molecular weight of the mixture. if the cooling capacity is 10 l, what is the mass of the coolant?
Answers: 3
You know the right answer?
-Y PC 1:24) Ci Yk+1 2. Runge-Kutta Radioactivity Most of us are familiar with carbon-14, the natural...
Questions
question
Mathematics, 28.11.2020 14:40
question
World Languages, 28.11.2020 14:40
question
Mathematics, 28.11.2020 14:50
question
Physics, 28.11.2020 14:50
question
Chemistry, 28.11.2020 14:50
Questions on the website: 13722363