4.12 Answer the following questions about this program:
1
function problem4_12
2 y = 1;
3
t = 0;
4
dt = 1e-4;
5
for i = 1:8e3
6
t = t + dt;
7
a = y;
8
b= getb(y,a,t,dt);
9
k = 1;
10
while abs (b) > 1e-4
11
c = getc(y,t,dt);
12
y = y - b/c;
13
b = getb(y,a,t,dt);
14
k = k + 1;
15
if k > 20
16 break
17
end
18
end
19
end
20
21
function b = getb(y,a,t,dt)
22 b = y - a - dt*(y^2 + cos(y*t));
23
24
function c = getc(y,t,dt)
25 c = 1 - dt*(2*y*t - t*sin(y*t));
(a) What differential equation is solved by this program?
(b) What is the initial condition?
(c) What does the variable a represent?
(d) What does the variable b represent?
(e) What does the variable c represent?
(f) What numerical method is implemented by the for loop in lines 5-19?
(g) What numerical method is implemented by the while loop in lines 10-18?
(h) What is the purpose of the if block in lines 15–17?
(i) What is the value of t at the end of the program?
(j) What type of continuation method is used?