Assignment 6 - Initial Value Problems - Attempt Review - Econcordia
Assignment 6 - Initial Value Problems - Attempt Review - Econcordia
Question 1
Complete
Not graded
https://moodle.econcordia.com/mod/quiz/review.php?attempt=416412&cmid=81035 1/17
8/13/24, 10:08 AM Assignment 6 - Initial value problems: Attempt review | eConcordia
Question 2
Correct
Mark 1.00 out of 1.00
The fact that an initial value solver is stable or not stable depends on
Select one or more:
a. Nothing in particular
b. The choice of the step size
c. The final value 𝑡𝑓 one wants to calculate the approximation for
d. The differential equation to be solved
e. The initial conditions
https://moodle.econcordia.com/mod/quiz/review.php?attempt=416412&cmid=81035 2/17
8/13/24, 10:08 AM Assignment 6 - Initial value problems: Attempt review | eConcordia
Question 3
Correct
Mark 1.00 out of 1.00
Apply the Trapezoid (RK2) method to the following initial value problem:
⎧ 𝑦′1 = 𝑦1 + 𝑦2
⎪ 𝑦′ = −𝑦 + 𝑦
⎨ 2 1 2
⎪ 𝑦1 (0) = 1
⎩ 𝑦2 (0) = 0
𝑤 2 (1) = -2.288998496915356
https://moodle.econcordia.com/mod/quiz/review.php?attempt=416412&cmid=81035 3/17
8/13/24, 10:08 AM Assignment 6 - Initial value problems: Attempt review | eConcordia
Question 4
Correct
Mark 1.00 out of 1.00
Consider a numerical initial value problem solver in order 𝑂(ℎ7 ) in the local truncation error.
The order of the global truncation error will be
Answer: 6
The global truncation error is always one less than the local one according the Lipschitz theorems.
Reference: Lecture on local and global truncation errors of topic 8
The correct answer is: 6
https://moodle.econcordia.com/mod/quiz/review.php?attempt=416412&cmid=81035 4/17
8/13/24, 10:08 AM Assignment 6 - Initial value problems: Attempt review | eConcordia
Question 5
Correct
Mark 2.00 out of 2.00
Apply the standard RK4 method to the following initial value problem:
⎧ 𝑑2𝑦 − 2 𝑑𝑦 + 2𝑦 = 𝑒2𝑡 sin 𝑡
⎪ 𝑑𝑡2
⎨ 𝑦(0) = −0.4
𝑑𝑡
⎪ ′
⎩ 𝑦 (0) = −0.6
{ 𝑦2 = 𝑑𝑦
𝑦1 = 𝑦
𝑑𝑡
𝑤 2 (1) = 2.579254393280338
⎪ 1
⎩ 𝑦2 (0) = −0.6
https://moodle.econcordia.com/mod/quiz/review.php?attempt=416412&cmid=81035 5/17
8/13/24, 10:08 AM Assignment 6 - Initial value problems: Attempt review | eConcordia
Question 6
Correct
Mark 1.00 out of 1.00
Two different RK4 methods will produce approximations of a given initial value problem with similar accuracy
Select one:
True
False
Any RK4 method will be in 𝑂(ℎ4 ) for the global truncation error. That means they all will produce approximations with very similar
accuracy.
Reference: Lecture on Runge Kutta methods of topic 8
The correct answer is 'True'.
Question 7
Correct
Mark 1.00 out of 1.00
A RK2 method will in general require how many function evaluations (in each step) when solving an initial value problem?
Answer: 2
https://moodle.econcordia.com/mod/quiz/review.php?attempt=416412&cmid=81035 6/17
8/13/24, 10:08 AM Assignment 6 - Initial value problems: Attempt review | eConcordia
Question 8
Correct
Mark 1.00 out of 1.00
with 𝑦(0) = 1.
Apply Euler's method with a step size ℎ = 0.25.
How much is the approximation of 𝑦(1) ?
Use 16 significant figures in your calculations and give your answer with at least 5 significant figures
Answer: 1.133386191966365
https://moodle.econcordia.com/mod/quiz/review.php?attempt=416412&cmid=81035 7/17
8/13/24, 10:08 AM Assignment 6 - Initial value problems: Attempt review | eConcordia
Question 9
Correct
Mark 1.00 out of 1.00
Question 10
Correct
Mark 1.00 out of 1.00
https://moodle.econcordia.com/mod/quiz/review.php?attempt=416412&cmid=81035 8/17
8/13/24, 10:08 AM Assignment 6 - Initial value problems: Attempt review | eConcordia
Question 11
Correct
Mark 1.00 out of 1.00
⎪ ′
⎩ 𝑦 (0) = 1
Start by transforming this second order initial value problem into a system of first order initial value problems with the variables
{ 𝑦2 = 𝑑𝑦
𝑦1 = 𝑦
𝑑𝑡
We want to produce an approximation of the solutions 𝑦1 (𝑡 = 4) and 𝑦2 (𝑡 = 4) using the classical RK4 method
For which step sizes ℎ do we get approximations of 𝑦1 (𝑡 = 4) and 𝑦2 (𝑡 = 4) with an absolute error below 10−8 ?
Select one or more:
a. 10−3
b. 10−2
c. 10−1
d. 100
⎪
⎩ 𝑦2 (0) = 1
1
We then solve this system of ODEs for different step sizes ℎ using the RK4 method in the interval [0, 4].
We estimate the errors of the approximations of 𝑦1 (𝑡 = 4) and 𝑦2 (𝑡 = 4) with the Richardson formula.
The plot below gives this error estimations in function of various step sizes
https://moodle.econcordia.com/mod/quiz/review.php?attempt=416412&cmid=81035 9/17
8/13/24, 10:08 AM Assignment 6 - Initial value problems: Attempt review | eConcordia
The plot below gives an example of a solution produced by the RK4 method for a step size of ℎ = 0.01
https://moodle.econcordia.com/mod/quiz/review.php?attempt=416412&cmid=81035 10/17
8/13/24, 10:08 AM Assignment 6 - Initial value problems: Attempt review | eConcordia
https://moodle.econcordia.com/mod/quiz/review.php?attempt=416412&cmid=81035 11/17
8/13/24, 10:08 AM Assignment 6 - Initial value problems: Attempt review | eConcordia
Question 12
Correct
Mark 1.00 out of 1.00
Compute an approximation of 𝑦(4), the solution in 𝑡 = 4 of the following ordinary differential equation
𝑑𝑦 𝑡3
𝑑𝑡
= 𝑦2
Answer: 5.77933463
https://moodle.econcordia.com/mod/quiz/review.php?attempt=416412&cmid=81035 12/17
8/13/24, 10:08 AM Assignment 6 - Initial value problems: Attempt review | eConcordia
Question 13
Incorrect
Mark 0.00 out of 1.00
https://moodle.econcordia.com/mod/quiz/review.php?attempt=416412&cmid=81035 13/17
8/13/24, 10:08 AM Assignment 6 - Initial value problems: Attempt review | eConcordia
From this plot we can conclude that, for example, a step size of ℎ = 10−3 will guarantee us to give an answer with an absolute error
below 10−8 .
Solving the IVP with this step size with the classical RK4 method yields to 𝑦(2) ≃ 2.660913870544215
The plot below shows the approximation of 𝑦(𝑡) over the interval [−1, 2]
https://moodle.econcordia.com/mod/quiz/review.php?attempt=416412&cmid=81035 14/17
8/13/24, 10:08 AM Assignment 6 - Initial value problems: Attempt review | eConcordia
Question 14
Correct
Mark 1.00 out of 1.00
Compute the approximation of 𝑦(7), the solution in 𝑡 = 7 of the following ordinary differential equation
𝑑𝑦
𝑑𝑡
= 1 + (𝑡 − 𝑦)2
https://moodle.econcordia.com/mod/quiz/review.php?attempt=416412&cmid=81035 15/17
8/13/24, 10:08 AM Assignment 6 - Initial value problems: Attempt review | eConcordia
Question 15
Correct
Mark 1.00 out of 1.00
{ 𝑦(0) = 1/3
= (cos 𝑡 + 2𝑡3 ) 𝑦3 − 𝑡𝑦
𝑑𝑦
𝑑𝑡
We want to study the produced approximations of the solution 𝑦(𝑡) using the midpoint (RK2) method over the interval [0, 3].
For this compute the approximations 𝑤𝑖 and 𝑤̃𝑖 for the step sizes ℎ1 = 0.1 and ℎ2 = 0.05 in the interval [0, 3].
Based on these calculations, for which tolerances 𝑇 𝑂𝐿 can we say |𝑤̃𝑖 − 𝑦(𝑡𝑖 )| ≤ 𝑇 𝑂𝐿 over the full interval [0, 3] ?
Select one or more:
a. 10−6
b. 10−5
c. 10−4
d. 10−3
e. 10−2
As 𝑤̃𝑖 contains twice more entries than 𝑤𝑖 you can do this with the command (if w1 and w2 are the vectors containing the appoxiamtions
computed by the IVP solver using ℎ1 and ℎ2 )
Err=abs(w1-w2(1:2:end))/(2^2-1)
The plot below gives this error estimations over the solution interval as well as the approximation 𝑤̃𝑖 .
https://moodle.econcordia.com/mod/quiz/review.php?attempt=416412&cmid=81035 16/17
8/13/24, 10:08 AM Assignment 6 - Initial value problems: Attempt review | eConcordia
https://moodle.econcordia.com/mod/quiz/review.php?attempt=416412&cmid=81035 17/17