728x90
Numeriacal Differenctiation

Numeriacal Differenctiation

  • f(x)=Pn(x)+fn+1(ζ(x))(n+1)!Π(xxn)=Pn(x)+fn+1(ζ(x))(n+1)!Φ(x)f(x)=P_n(x)+\frac{f^{n+1}(\zeta(x))}{(n+1)!}\Pi(x-x_n)=P_n(x)+\frac{f^{n+1}(\zeta(x))}{(n+1)!}\Phi(x)
  • 미분 근사
    • f(x)=limh0f(x+h)f(x)hf(x+h)f(x)hf'(x)=lim_{h\rarr0}\frac{f(x+h)-f(x)}{h}\simeq\frac{f(x+h)-f(x)}{h}
    • 계산이 단순함
    • 수렴이 느림 = 근사 정확도가 낮음
    • h에 정비례로 오차도 작아짐 (1차 수렴)
  • Higher Order method : Lagrange method
    • f(x)=Σf(xk)Lk(x)+fn+1(ζ(x))(n+1)!Π(xxn)f(x)=\Sigma f(x_k)L_k(x)+\frac{f^{n+1}(\zeta(x))}{(n+1)!}\Pi(x-x_n)
    • 앞의 항은 Pn(x)P_n(x), 뒤의 항은 Error
    • 미분값 f(x)=k=0nf(xk)Lk(x)+Dx[Φ(x)]fn+1(ζ(x))+Φ(x)Dx[fn+1(ζ(x))]f'(x)=\sum^n_{k=0}f(x_k)L'_k(x)+D_x[\Phi(x)]f^{n+1}(\zeta(x))+\Phi(x)D_x[f^{n+1}(\zeta(x))]
      • j번째 미분항 f(xj)=k=0nf(xk)Lk(xj)+fn+1(ζ(xj))(n+1)!Πk=0,kjn(xjxk)f'(x_j)=\sum^n_{k=0}f(x_k)L'_k(x_j)+\frac{f^{n+1}(\zeta(x_j))}{(n+1)!}\Pi^n_{k=0, k\not ={j}}(x_j-x_k)
      • 오차를 특정하기보다는 Error Bound를 계산한다.
    • n이 중가할수록 error는 감소

Three-Point Formula

  • Lagrange Polynomial (3 basis) : 3개 점을 이용한 근사식
    • L0=(xx1)(xx2)(x0x1)(x0x2)L_0=\frac{(x-x_1)(x-x_2)}{(x_0-x_1)(x_0-x_2)}
    • L1=(xx0)(xx2)(x1x0)(x1x2)L_1=\frac{(x-x_0)(x-x_2)}{(x_1-x_0)(x_1-x_2)}
    • L2=(xx0)(xx1)(x2x0)(x2x1)L_2=\frac{(x-x_0)(x-x_1)}{(x_2-x_0)(x_2-x_1)}
  • 3-point method : 3개 점이 일정 간격이라 가정 x1=x0+h, x2=x0+2hx_1 = x_0+h,\ x_2=x_0+2h
    • Lagrange method의 분모항은 모두 2h22h^2으로 통일됨
    • shifting : 3개 점 중 하나를 0으로 치환
  • 3-point method를 적용한 미분식
    • f(x0)=1h[32f(x0)+2f(x0+h)12f(x0+2h)]+h23f(ζ0)f'(x_0)=\frac{1}{h}[-\frac{3}{2}f(x_0)+2f(x_0+h)-\frac{1}{2}f(x_0+2h)]+\frac{h^2}{3}f'''(\zeta_0)
    • f(x0+h)=1h[12f(x0)+12f(x0+2h)]+h26f(ζ1)f'(x_0+h)=\frac{1}{h}[-\frac{1}{2}f(x_0)+\frac{1}{2}f(x_0+2h)]+\frac{h^2}{6}f'''(\zeta_1)
    • f(x0+2h)=1h[12f(x0)2f(x0+h)+32f(x0+2h)]+h23f(ζ2)f'(x_0+2h)=\frac{1}{h}[\frac{1}{2}f(x_0)-2f(x_0+h)+\frac{3}{2}f(x_0+2h)]+\frac{h^2}{3}f'''(\zeta_2)
    • h가 절반 >> error항은 2차식이므로 오차는 1/4로 감소
  • 미분식 간소화
    • f(x0)3f(x0)+4f(x1)f(x2)2hf'(x_0)\simeq\frac{-3f(x_0)+4f(x_1)-f(x_2)}{2h} (back-order form)
    • f(x1)f(x0)+f(x2)2hf'(x_1)\simeq\frac{-f(x_0)+f(x_2)}{2h} (central form)
    • f(x2)f(x0)4f(x1)+3f(x2)2hf'(x_2)\simeq\frac{f(x_0)-4f(x_1)+3f(x_2)}{2h} (forward-order form)
    • 세 식이 대칭 구조를 이룸
    • 분자의 계수 합이 0이어야 함

  • x~=xx1 (x1=x+h)\tilde{x}=x-x_1\ (x_1=x+h)로 정의
    • Largrange Polynomial f(x)f(x0)L0(x)+f(x1)L1(x)+f(x2)L2(x)f(x)\simeq f(x_0)L_0(x)+f(x_1)L_1(x)+f(x_2)L_2(x)
    • f(x)f(x0)L0(x~)+f(x1)L1(x~)+f(x2)L2(x~)f(x)\simeq f(x_0)L_0(\tilde{x})+f(x_1)L_1(\tilde{x})+f(x_2)L_2(\tilde{x})로 치환
    • L0(x~)=x~(x~h)2h2L_0(\tilde{x})=\frac{\tilde{x}(\tilde{x}-h)}{2h^2}
  • five point formula
    • f(x0)=112h(f(x02h)8f(x0h)+8f(x0+h)f(x0+2h))+h430f(5)(ζ)f'(x_0)=\frac{1}{12h}(f(x_0-2h)-8f(x_0-h)+8f(x_0+h)-f(x_0+2h))+\frac{h^4}{30}f^{(5)}(\zeta)
      • midpoint formula - 가운데 점의 미분
      • ζ=[x02h,x0+2h]\zeta=[x_0-2h, x_0+2h]
    • f(x0)=112h[25f(x0)+48f(x0+h)36f(x0+2h)+16f(x0+3h)3f(x0+4h)]+h45f(5)(ζ)f'(x_0)=\frac{1}{12h}[-25f(x_0)+48f(x_0+h)-36f(x_0+2h)+16f(x_0+3h)-3f(x_0+4h)]+\frac{h^4}{5}f^{(5)}(\zeta)
      • endpoint formula - 왼쪽 끝점에서 미분
      • ζ=[x0,x0+4h]\zeta=[x_0, x_0+4h]
    • Error식이 4차 - Order of Convergence = 4
  • Order of Convergence 계산
    • Error Eh=ChαE_h=Ch^\alpha라고 할 때 Order of convergence = O(h2)O(h^2)
    • h값이 1/2로 감소한다고 할때 이전 값은 2h이므로 E2h=C(2h)αE_2h=C(2h)^\alpha
    • error의 감소분은 E2hEh=2α\frac{E_2h}{E_h}=2^\alpha
    • α\alpha의 계산은 logE2hEh/log2log\frac{E_2h}{E_h}/log2로 구할 수 있음 (Error Of Convergence)

Application of the Formula

  • ex. f(x)=xexf(x)=xe^x
    • f(1.8) = 10.889365, f(1.9) = 12.703199, f(2.0) = 14.778112, f(2.1) = 17.148957, f(2.2) = 19.855030
    • h=0.1, x=1.9 기준으로 한 3-point endpoint formila
      f(x)=10.2[3f(1.9)+4f(2.0)f(2.1)]f(x)=\frac{1}{0.2}[-3f(1.9)+4f(2.0)-f(2.1)]
728x90

+ Recent posts