secant method in nonlinear ode

by

 

this will find the solution of U''=k*U*U' by using taylor series 3rd order and secant method

math1.m
function[phi]=math1(u,p)
h=1/4;
for i=1:4
    for j=1
    u(i+1,j)=u(i,j)+h*p(i,j)+h^2/2*(2*u(i,j)*p(i,j))+h^3/3*(p(i,j)^2+2*u(i,j)^2*p(i,j))
    p(i+1,j)=p(i,j)+2*h*u(i,j)*p(i,j)+h^2*(p(i,j)^2+2*u(i,j)^2*p(i,j))
    end
end
phi=u(5,1)-1;

Contact us