hi guys,

i must di this exercise:

Solve with shooting method this boundary value problem:

[V-(1-m)*(y/2)]*(dU/dy)+m*U^2-d/dy(dU/dy)=0

-[(1-m)*(y/2)]*(dU/dy)+m*U+dV/dy=0

for U(y) and V(y) with y[0..20]

boundary value: U(0)=0, V(0)=0 and U(20)=1

with

1 - Euler method

2 - Rounge Kutta 4 order

function [u v w y]=shooting_Eulero_Esp(dy)

global u v w y L N h uL m

h=0.01;

L=20;

N=(L/h)+1;

y=zeros(N,1);

for i=1:length(y)

y(i)=h*(i-1);

end

u=zeros(N,1);

v=zeros(N,1);

w=zeros(N,1);

m=0;

toll=10^-12;

u(1)=0;

v(1)=0;

uL=1;

eta1=1;

eta2=2;

[check1 err1]=shoot_EE(eta1);

[check2 err2]=shoot_EE(eta2);

uN=u(L)

numiter=0;

err=1;

while(abs(err)>=toll)

numiter=numiter+1;

etat=eta2-err2*(eta1-eta2)/(err1-err2);

[check err]=shoot_EE(etat);

if(abs(err)<abs(err2))

eta1=eta2;

err1=err2;

eta2=etat;

err2=err;

else

eta1=etat;

err1=err;

end

end

numiter

uN=u(length(u))

w0=w(1)

plot(y,u,y,w)

axis([0 20 0 1.2])

function [uN err]=shoot_EE(eta)

global y u v w h uL m

w(1)=eta;

for i=2:length(u)

u(i)=u(i-1)+h*w(i-1);

v(i)=v(i-1)+h*(((1-m)*y(i-1)*w(i-1)/2)-m*u(i-1));

w(i)=w(i-1)+h*(v(i-1)*w(i-1)-((1-m)*u(i-1)*w(i-1)*y(i-1)/2)+m*(u(i-1)^2)+m);

end

uN=u(length(u));

err=uL-uN;

abs(err)

return

CAN SOMEONE HELP ME WITH RUNGE KUTTA 4 ORDER?