728x90
Numerical Integration

Numerical Integration

  • 수치적 적분은 \int대신 \sum을 쓰는 원리

Trapezoidal Rule

  • 적분 구간의 일부인 [a, b]구간의 적분을 가정 (구분구적법과 유사)
    • x0x2f(x)dx(x2x0)[f(x0)+f(x2)]2\int_{x_0}^{x_2}f(x)dx\simeq (x_2-x_0)\frac{[f(x_0)+f(x_2)]}{2}
  • 해당 구간의 Linear Lagrange Polynomial P1(x)=xx1x0x1f(x0)+xx0x1x0f(x1)P_1(x)=\frac{x-x_1}{x_0-x_1}f(x_0)+\frac{x-x_0}{x_1-x_0}f(x_1)
  • Lagrange Method x1, x2x_1,\ x_2를 shifting
    • L0=hxh, L1=xhL_0=\frac{h-x}{h},\ L_1=\frac{x}{h}
    • x0x2f(x)dx(2h)[f(x0)+f(x2)]2\int_{x_0}^{x_2}f(x)dx\simeq (2h)\frac{[f(x_0)+f(x_2)]}{2}
  • three-point rule 적용(x-h, 0, x+h)
    • taylor polynomial : f(x)=f(x1)+f(x1)(xx1)+f(ζ)2(xx1)2f(x)=f(x_1)+f'(x_1)(x-x_1)+\frac{f''(\zeta)}{2}(x-x_1)^2
    • a : x0x2f(x)=f(x1)2h+f(ζx)2(xx1)2\int_{x_0}^{x_2}f(x)=f(x_1)\cdot 2h+\frac{f''(\zeta_x)}{2}(x-x_1)^2
    • b : [f(x0)+f(x2)]h=2hf(x1)+[f(ζ1)+f(ζ2)]h32[f(x_0)+f(x_2)]h=2hf(x_1)+[f''(\zeta_1)+f''(\zeta_2)]\frac{h^3}{2}
    • error = a-b = x0x1f(ζ)2(xx1)2[f(ζ1)+f(ζ2)]2h3\int_{x_0}^{x_1}\frac{f''(\zeta)}{2}(x-x_1)^2-\frac{[f''(\zeta_1)+f''(\zeta_2)]}{2}h^3
      =h3[f(η)3[f(ζ1)+f(ζ2)]2]=h^3[\frac{f''(\eta)}{3}-\frac{[f''(\zeta_1)+f''(\zeta_2)]}{2}]
  • Error 발생 hhf(x)dxh[f(h)+f(h)]2\int^h_{-h} f(x)dx\simeq h\frac{[f(h)+f(-h)]}{2}
    • f(x)=1인 경우 : a=2h, b=2h
    • f(x)=x인 경우 : a=b=0
    • f(x)=x2x^2인 경우 : 23h3h3\frac{2}{3}h^3\not ={h^3}(error 발생)

Simpson's Rule

  • [a, b]구간을 세 점 (x0, x1, x2)로 가정
  • shifting : x0=h, x1=0, x2=hx_0=-h,\ x_1=0,\ x_2=h
    • hhf(x)hf(h)+4f(0)+f(h)3\int_{-h}^hf(x)\simeq h\frac{f(-h)+4f(0)+f(h)}{3}
    • 혹은 x0x2f(x)dx=2hf(x1)+h33f(x1)+f(ζ)60h5\int_{x_0}^{x_2}f(x)dx=2hf(x_1)+\frac{h^3}{3}f''(x_1)+\frac{f''''(\zeta)}{60}h^5
  • Trapizoidal Rule의 degree of precesion은 1이지만, simpson은 4(전자는 2차식, 후자는 5차식부터 오차 발생)
  • Composite Simpson's rule
    • 함수를 일정 구간으로 나누어 Simpson's Rule을 여러번 적용
    • I(f)=abf(x)dx,I(f)=\int^b_af(x)dx,
    • Tn(f)=h[f(x0)+f(x1)2+f(x1)+f(x2)2+...+f(xn2)+f(xn1)2+f(xn1)+f(xn)2T_n(f)=h[\frac{f(x_0)+f(x_1)}{2}+\frac{f(x_1)+f(x_2)}{2}+...+\frac{f(x_{n-2})+f(x_{n-1})}{2}+\frac{f(x_{n-1})+f(x_n)}{2}
      =h[f(x0)2+f(x1)+...+f(xn1)+f(xn)2]=h[\frac{f(x_0)}{2}+f(x_1)+...+f(x_{n-1})+\frac{f(x_n)}{2}]
    • 오차 = nO(h3)nO(h^3) - 간격이 줄어 h가 감소하므로 오차가 대폭 줄어듦

Gaussian Quadratic

  • f(x)dxc1f(x1)+c2f(x2)\int f(x)dx\simeq c_1f(x_1)+c_2f(x_2)
  • Simpson's rule의 변형으로, 양 끝점을 구분부적 하는 대신 구간 내 임의 두개의 점으로 구분구적을 진행
  • 미지수 c1, c2, x1, x2c_1,\ c_2,\ x_1,\ x_2를 알기 위한 4개 방정식 필요
  • 5개 점(a, x1, 0, x2, b)이 대칭형이라 가정
    • x1 = -x2
    • c1 = c2
728x90

+ Recent posts