About Me

I am an Aerospace Engineer with specialties in flutter, fluid structure interactions, and the use of CFD in a production environment. My dissertation shows how to improve the state-of-the-art unsteady CFD performance by 2 orders of magnitude. I am an engineer, a pilot, a marksman, a husband, and a dad.
Showing posts with label integral. Show all posts
Showing posts with label integral. Show all posts

Thursday, February 6, 2014

L Squared Error for a Fourier Sine Series

How close is my Fourier Sine series to a function f(x)?

Answer: $L_2(N) = -\frac{1}{2} a_n^2 + \int_\Omega f^2(x) dx$

This question came up recently while discussing PDE (partial differential equations) solution techniques. The final result is quite interesting.

Our sine series approximates the function f(x) over the domain $\Omega$ as $$f(x) \approx \sum {{a_n}\sin (n\pi x)}$$ You can determine the coefficients with the formula. $$ a_n = 2\int_\Omega f(x) sin(n\pi x) dx$$
One good measure of the error between the sine series and the function is the $L_2$, pronounced "el squared", error. $$ L_2 = \int_{\Omega} \left( u(x) - f(x) \right)^2 dx $$
Substitute for the sine series to obtain. $$ L_2 = \int_{\Omega} \left({{a_n}\sin (n\pi x)}- f(x) \right)^2 dx $$
Expand the terms to obtain $$ L_2 = \int_{\Omega} a_n^2 \sin^2(n\pi x) dx  -2\int_{\Omega} a_n f(x) \sin(n \pi x) dx + \int_{\Omega} f^2(x) dx $$

Now, these integrals are particularly interesting. The first integral is a constant $0.5 a_n^2$. The second contains the definition of $a_n$. The third only contains the function $f^2(x)$. This simplifies to $$L_2(N) = -\frac{1}{2} a_n^2 + \int_\Omega f^2(x) dx$$



Interestingly, if we let the error become zero, the following is an identity $$ a_n^2 = 2 \int_\Omega f^2(x) dx$$ Knowledge of this identity will allow you to quickly compute integrals of squared trig functions.

Neat! Do you have any interesting Fourier results? Let me know in the comments.