METODO DE NEWTON-COTES

 



clc
clear all
disp('METODO DE NEWTON-COTES')
syms x
f=inline(input('ingrese la funcion:','s'));
a=input('ingrese intervalo inferior:');
b=input('ingrese intervalo superior:');
n=1
h=(b-a)/3
x0=a
x1=x0+h
x2=x1+h
x3=x2+h
x4=x3+h
f0=feval(f,x0)
f1=feval(f,x1)
f2=feval(f,x2)
f3=feval(f,x3)
f4=feval(f,x4)
I1=(h/2)*(f0+f1)
error=(-1/12)*(h^5)*((f2-(2*f1)+f0)/(h^2))
I1=I1+error

n=2
I2=(h/3)*(f0+4*f1+f2)
error=(-1/90)*(h^5)*((f4-(4*f3)+(6*f2)-(4*f1)+f0)/(h^4))
I2=I2+error

n=3
I3=((3*h)/8)*(f0+(3*f1)+(3*f2)+f3)
error=(-3/80)*(h^5)*((f4-(4*f3)+(6*f2)-(4*f1)+f0)/(h^4))
I3=I3+error

Hoy habia 14 visitantes (16 clics a subpáginas) ¡Aqui en esta página!
Este sitio web fue creado de forma gratuita con PaginaWebGratis.es. ¿Quieres también tu sitio web propio?
Registrarse gratis