Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

%euler methods by athi inayah

syms x y
fx = -2.2067*10^-12*((y^4)-(8*10^8));
a = 0;
b = 480;
n = 3;
h =(b-a)/n;
N =[];
x0= 0;
y0= 1200;

for i= 1:n
y1 = y0+ subs (fx,[x,y],[x0,y0])*h;
x0= x0+h;
y0= y1
N = [N; i x0 y1];
end
%euler methods by mamluatul hasanah
syms x y
fx = -2.2067*10^-12*((y^4)-(8*10^8));
a = 0;
b = 480;
n = 3;
h =(b-a)/n;
N =[];
x0= 0;
y0= 1200;

for i= 1:n
y1 = y0+ subs (fx,[x,y],[x0,y0])*h;
x0= x0+h;
y0= y1
N = [N; i x0 y1];
end

You might also like