Question: Answer the following seven questions about the program listed below that solves a system of two ODEs for the unknowns y 1 and y 2
Answer the following seven questions about the program listed below that solves a system of two ODEs for the unknowns y1 and y2.
(a) What numerical method is implemented to solve these ordinary differential equations?
(b) What system of ordinary differential equations is this program solving?
(c) Are these linear or nonlinear ODEs?
(d) What is the initial condition for the problem?
(e) What order continuation method is used for the Newton–Raphson part of the program?
(f) What is the entry that should replace the ? in the out(2,1) entry of the subfunction jacobian(ynew,h)?
1 function problem4_29 2 yold 3 h = 0.01; nsteps = 10; 4 5 ynew = yold; 6 7 8 10 11 12 13 14 15 16 17 [2; -1]; for i=1:nsteps end R = residual (ynew, yold, h); while norm (R) > 10^-8 J = jacobian (ynew, h); delt-J\R; ynewynew + delt; R = residual (ynew, yold, h); end yold = ynew; function out = residual (ynew, yold, h) 18 out (1,1)= ynew(1)-yold (1) -h* (ynew (1)^2+ynew (1) *ynew (2)); 19 out (2, 1) = ynew (2) -yold (2) -h* (ynew (1) *ynew (2)); 20 21 function out = jacobian (ynew, h) 22 out (1,1) = 1 - h* (2*ynew (1) +ynew (2)); 23 out (1, 2) = -h*ynew (1); 24 out (2, 1) = ? 25 out (2,2) 1-h*ynew (1);
Step by Step Solution
3.33 Rating (159 Votes )
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
