You are on page 1of 1

%Romberg

Vv= 1.640533333
a=0
b=0.8
nn=2
h=(b-a)/nn
x=a
Inter=0
for(n=1:1:nn)
h=(b-a)/n;
x=a;
Inter=0;
for(s=1:1:n+1)
f(s)=0.2+(25*x)-(200*(x^2))+(675*(x^3))-(900*(x^4))+(400*(x^5));
x=x+h;
end
for(r=2:1:n);
Inter=Inter+(f(r));
end
Int(n)=h*((f(1)+f(n+1))+((2*Inter))/2);
Etrue=abs((Vv-Int)/Vv)*100;
Etrunc=Vv-Int;
end
R12=((4/3)*Int(2))-((1/3)*Int(1))
Etrue=abs((Vv-R12)/Vv)*100

You might also like