Download as:
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Language:CA
Pages: 2
Words: 336

End lott ing the solutionplot using shooting method xlabel ylabel hold onplot

yl(i+l)=double(yl(i)+(l/6)*(k0+2•k l+2•k2+k3)); y2(i+l)=double(y2(i)+(l/6)*(10+2*11+2*12+13));

%p lott ing the solution

legend('Nume rical solution ','Exact solution' )

-<l.2

-<l.6

,.6 lJ 1.8 1.9 2

Pllblished with M ATL4B@ R2018a

\Program for RK4 for question 8.

f•@(x,yl ,y2)y2; \function (i) g-@(x,yl,y2) 8•y1 .•2; \function (ii)

x i,n•x ( l ) ; linitial x

x_max•2; \Fi nal x

k0•h f(x (i),yl(i),y2 (i));

l0•h•g (x (i),yl(i),y2(l));

l3•h•g (x (i)+h,yl(i)+k2,y2(i)+l2);

x(i+l)•x in+i•h;

\solution using value of p

x(l)•l;yl(l)•l/3;y2(1)-p; \initial conditions h•0.001; \step length

for i• l :n

k0•h*f (x (i),yl(i),y2(i));

Copyright © 2009-2023 UrgentHomework.com, All right reserved.