FEM Method for the Wave Equation

In summary, the author is trying to understand how to apply the finite element method for a simple 1D wave equation with four elements. The author assumes that the user knows what the function ##f(x)## is, but if ##f(x)## is ##T(x)## then the equation becomes \begin{multline*}\frac{d^2T}{dx^2} + kT(x) = -f(x).\end{multline*} which can be solved by using the method shown in Numerical Methods for Engineers by Chapra and Canale.
  • #1
bob012345
Gold Member
2,066
891
TL;DR Summary
How to set up the Finite Element Method of a 1D Wave Equation.
I am trying to understand how to apply the finite element method for a simple 1D wave equation with four elements for learning purposes.

$$\frac{d^2 T(x)}{dx^2} = -f(x)$$

I am stuck because the structure of the equations set up in Numerical Methods for Engineers by Chapra and Canale as shown here seems to assume one knows what the function ##f(x)## is. What if ##f(x)## is ##T(x)## as in the wave equation? Is that case doable? Thanks.

0.jpg
 
  • Like
Likes Delta2
Physics news on Phys.org
  • #2
I assume [itex]N_i[/itex] are test functions with [itex]T[/itex] approximated by [itex]T_1N_1(x) + T_2N_2(x)[/itex]. If so, then [tex]\frac{d^2T}{dx^2} + kT(x) = -f(x)[/tex] where [itex]f[/itex] is a known source term gives [tex]
\begin{multline*}
\int_{x_1}^{x_2} N_i(x)\frac{d^2T}{dx^2} + kN_i(x)T(x) + N_i(x)f(x)\,dx \\=
\left[ N_i(x)\frac{dT}{dx}\right]_{x_1}^{x_2}
+\int_{x_1}^{x_2} -\frac{dN_i}{dx}\frac{dT}{dx} + kN_i(x)T(x) + N_i(x)f(x)\,dx
\end{multline*}[/tex] which results in [tex]
\begin{multline*}
\begin{pmatrix}
\int_{x_1}^{x_2} \left(\frac{dN_1}{dx}\right)^2\,dx & \int_{x_1}^{x_2} \frac{dN_1}{dx}\frac{dN_2}{dx} \,dx \\
\int_{x_1}^{x_2} \frac{dN_1}{dx}\frac{dN_2}{dx} \,dx & \int_{x_1}^{x_2} \left(\frac{dN_2}{dx}\right)^2\,dx
\end{pmatrix}
\begin{pmatrix} T_1 \\ T_2 \end{pmatrix} \\
- k\begin{pmatrix} \int_{x_1}^{x_2} N_1^2(x)\,dx & \int_{x_1}^{x_2} N_1(x)N_2(x)\,dx \\
\int_{x_1}^{x_2} N_1(x)N_2(x)\,dx & \int_{x_1}^{x_2} N_2^2(x)\,dx \end{pmatrix}
\begin{pmatrix} T_1 \\ T_2 \end{pmatrix} \\
=
\begin{pmatrix}
N_1(x_2) \frac{dT}{dx}(x_2) - N_1(x_1) \frac{dT}{dx}(x_1) \\
N_2(x_2) \frac{dT}{dx}(x_2) - N_2(x_1) \frac{dT}{dx}(x_1) \end{pmatrix} +
\begin{pmatrix}
\int_{x_1}^{x_2} N_1(x)f(x)\,dx \\
\int_{x_1}^{x_2} N_2(x)f(x)\,dx
\end{pmatrix}.\end{multline*}[/tex] I'm sure the authors will give an example of this at some point.

The wave equation is actually a PDE, so [itex]T_1[/itex] and [itex]T_2[/itex] are not constants but functions of time. You therefore end up with the system of ODEs [tex]
A\begin{pmatrix} \frac{d^2T_1}{dt^2} \\ \frac{d^2T_2}{dt^2} \end{pmatrix} = -c^2 B \begin{pmatrix} T_1 \\ T_2 \end{pmatrix} + (\mbox{boundary terms})[/tex] where [itex]B[/itex] is the stiffness matrix and [tex]
A = \begin{pmatrix} \int_{x_1}^{x_2} N_1^2(x)\,dx & \int_{x_1}^{x_2} N_1(x)N_2(x)\,dx \\
\int_{x_1}^{x_2} N_1(x)N_2(x)\,dx & \int_{x_1}^{x_2} N_2^2(x)\,dx \end{pmatrix}.[/tex]
 
  • Like
Likes Delta2 and bob012345
  • #3
I worked it out and it works great! Thanks. Here is a plot of the points calculated by the Finite Element Method as compared to the exact analytical solution ##\psi(x)= \sqrt{\frac{2}{10}}sin(\frac{\pi x}{10})## of an infinite potential well of width 10 units.;

desmos-graph (7).png
 
Last edited:
  • Like
Likes Delta2
  • #4
What does the input function ##f(x)## represent in the case of a wave equation? I know from experience it is a constant and it is necessary to solve the linear equations. I also noticed it can be scaled to get the amplitude I want but I am having trouble justifying it and what value to give it.
 

1. What is the FEM method for the wave equation?

The Finite Element Method (FEM) is a numerical technique used to approximate solutions to partial differential equations, such as the wave equation. It involves dividing the problem domain into smaller, simpler subdomains and using a system of equations to solve for the unknown values at each node.

2. How does the FEM method work for the wave equation?

The FEM method works by discretizing the problem domain into smaller elements and using interpolation functions to approximate the solution at each node. The equations for each element are then combined to form a system of equations, which can be solved to obtain an approximate solution to the wave equation.

3. What are the advantages of using the FEM method for the wave equation?

The FEM method allows for more complex geometries to be modeled and can handle irregular boundaries. It also provides a more accurate solution compared to analytical methods for certain types of problems. Additionally, the FEM method is a versatile and widely used numerical technique in engineering and science.

4. What are the limitations of the FEM method for the wave equation?

The FEM method can be computationally expensive for large and complex problems, as it requires solving a large system of equations. It also requires careful selection of element size and shape to ensure accurate results. Additionally, the FEM method may not be suitable for problems with rapidly changing solutions.

5. How is the FEM method for the wave equation applied in real-world scenarios?

The FEM method has a wide range of applications, including structural analysis, fluid dynamics, and electromagnetics. It is commonly used in the design and analysis of structures, such as buildings, bridges, and aircraft. It is also used in the simulation of wave propagation in various media, such as seismic waves in the Earth's crust or acoustic waves in fluids.

Similar threads

Replies
1
Views
1K
Replies
4
Views
771
  • Differential Equations
Replies
12
Views
3K
  • Differential Equations
Replies
9
Views
2K
  • Differential Equations
Replies
7
Views
2K
  • Differential Equations
Replies
7
Views
2K
Replies
7
Views
2K
  • Differential Equations
Replies
5
Views
2K
  • Differential Equations
Replies
1
Views
773
Replies
2
Views
1K
Back
Top