Mtodo:
Se elige una sucesin {hk} tal que hk 0 y se calcula el lmite de la
sucesin
Dk = (f(x + hk ) f(x))/hk;
para k = 1, 2......
DIFERENCIACION NUMERICA
2 1 () () () ()
= = = =
2 1
( + 1) () () ( + 1) ( + 1) ( 1)
= ; = ; =
2
() = sin( + ) ; = 2 ( ) ; = ()
Programacin
clc; clear all; close all
Fs=50;
t=(1/Fs):(1/Fs):1;
y=sin(2*pi*t);
h=(1/Fs);
plot(t,y)
hold on
%aproximacion central
for i=1:Fs-1
d3(i)=(y(i+1)-y(i-1))/2*h;
end Grafica der. Delante, atrs y central
plot(t(2:end),d)
Segunda Derivada
SOLUCION
a) calcule el valor exacto de la primera y segunda derivada en x=pi
% a delante
d1=(f(xi+h)-f(xi))/h
e1=abs(v1-d1)
d2=(f(xi+2*h)-2*f(xi+h)+f(xi))/h^2
e2=abs(v2-d2)
PRIMERA DERIVADA:
SEGUNDA DERIVADA: