Loading [MathJax]/jax/output/HTML-CSS/jax.js

Monday, April 29, 2024

PDE- Galerkin method and example

 
The Galerkin method is a numerical technique that transforms boundary value problems, particularly partial differential equations (PDEs), into a system of linear algebraic equations by projecting the problem onto a finite-dimensional subspace.
Steps of the Galerkin Method


 Problem Setup: 

Start with the weak form of the differential equation integrated against a test function.

Choice of Basis Functions

Select basis functions {ϕi}ni=1 that satisfy the boundary conditions.
 Approximation of the Solution: 

Assume u(x)un(x)=ni=1ciϕi(x).
 Galerkin Projection: 

Ensure the residual is orthogonal to the span of the basis functions:
  Residualϕjdx=0for all j.

Example: One-Dimensional Poisson Equation

Consider the problem
u(x)=f(x),u(0)=u(1)=0.
on the interval [0,1].
Step 1: Weak Form

Multiply by a test function v(x) and integrate by parts to get:
10u(x)v(x)dx=10f(x)v(x)dx.
Step 2: Discretization

Choose linear basis functions and assume:
u(x)un(x)=ni=1ciϕi(x).
Step 3: Galerkin Projection

Insert the approximation into the weak form using basis functions as test functions:
ni=1ci10ϕi(x)ϕj(x)dx=10f(x)ϕj(x)dxfor all j.
Step 4: Matrix Formulation

Define the stiffness matrix A and load vector b as follows:
Aij=10ϕi(x)ϕj(x)dx,bj=10f(x)ϕj(x)dx.
This leads to the linear system:
Ac=b,
where c is the vector of coefficients.
\subsection*{Example: Very simple and concrete}
Take a differential equation
d2ydx2+x+y=0,0x1
with boundary condition y(0)=y(1)=0

Example:

Step 1
Take a trail solution y(x)=a0+a1x+a2x2. Always take the number of constants one greater than the highest differential power. Here we have second order differential. So, we take 2+1=3 constants a0,a1,a2.
Apply boundary conditions x=0,y=0. This leads to a0=0. Then apply boundary condition x=1,y=0 leads to a1=a2. Then the trail function becomes y(x)=a2(x2x). This is one parameter solution - namely a2.

Step 2
Compute Weighting function
W(x)=ya2=x2x

Step 3
Compute domain residuals. Simply substitute the trail function into original differential equation.
Rd=d2ydx2+x+yRd(x)=da2(x2x)dx2+x+a2(x2x)
 Step 4
Minimization of domain residual:
10W(x)Rd(x)dx=0
Compute minimization. You will get a2=598.
Then the solution is y(x)=598(xx2).
Other formulations
For the differential equation u=f, we can write this as first order by setting
σ=u,σ=f
The pair σ,f can be characterized variationally as unique critical point of the functional
I(σ,u)=11(12σ2uσ)dx+11fudx
over H1(1,1)×L2(1,1)
Note if we take the original J(x) the Energy functional and substitute, we get above.
J(u)=1211|u(x)|2dx11f(x)u(x)dx=1211σ211f(x)u(x)dx=1211σ2+f(x)11u(x)dx1111u(x)dxf(x)dx=1211σ2+0=1211σ2+11f(x)u(x)dx11f(x)u(x)dx=1112σ2fσ+11f(x)u(x)dx

No comments:

Post a Comment

Chain complexes on Hilbert spaces

 Chain complexes are mathematical structures used extensively in algebraic topology, homological algebra, and other areas of mathematics. Th...