You are on page 1of 2

EULER METHOD

Table of Contents
INPUT .............................................................................................................................. 1
PROGRAM & RESULT ...................................................................................................... 1
SOLVER ........................................................................................................................... 1

Name: Shubham Chapparghare Roll no.: 351013

INPUT
SC_ELU(@(x,y)x+y,0,1,2,0.5)

PROGRAM & RESULT


function[]=SC_ELU(fun,x0,y0,xn,h)

while x0<xn
y0=y0+h*feval(fun,x0,y0);
x0=x0+h;
end
fprintf('the ans is %f\n',y0)

the ans is 7.125000

SOLVER
[x,y]=ode23(@(x,y)x+y,[0:0.5:2],1)

x =

0
0.5000
1.0000
1.5000
2.0000

y =

1.0000
1.7971
3.4351
6.4598
11.7704

1
EULER METHOD

Published with MATLAB® R2017a

You might also like