Sunteți pe pagina 1din 7

ApproximateSolution

August 10, 2018

1 ME G512 :Finite Element Method


1.1 Lecture 4: Approximate Solutions
1.2 Dr. Keyur Joshi
All Approximate methods to solve PDE (Partial Differential Equations) arising in Boundary Value
Problems use two basic principles.

• Discretize domain geometry into simple, smaller, manageable domains.


• Use simple approximate function as candidate solutions for representation of the governing
equation on the domain.

We know that any function can be represented as a sum of polynomial series (required poly-
nomial could be very very large for complex functions, nevertheless it is possible) e.g.,

P( x ) = a0 + a1 x + a2 x2 + a3 x3 + .....

Similarly, we also know that any PERIODIC function can be represented by its Fourier series
expansion.
F ( x ) = a0 /2 + a1 cos(θ ) + b1 sin(θ ) + a2 cos(2θ ) + b2 sin(2θ ) + ....
Let us demostrate what we mean by examples.

1.2.1 Axial deformation of a rod/bar:


Consider the following figure. It is a uniform rod/bar having uniform axial load (e.g., self-weight)
fixed at one end and subjected to a point load at the other end.

• Derive governing equation of the physics.

d2 u
AE + q0 = 0
dx2

Subject to: u(0) = 0; AE du


dx = FL
• Assume an approximate solution valid from [ a + (i − 1)h, a + ih], for ith element. Let’s say

û( x ) = c0 + c1 x + c2 x2

1
Axial Bar with Uniform Loading

2
• Apply boundary condition:
û(0) = 0 ⇒ c0 = 0
dû F
AE ( L) = FL ⇒ c1 + 2c2 L = L
dx AE
It also has to satisfy governing equation. i.e.,

d2 û
AE + q0 = 0 ⇒ AE(2c2 ) = −q0
dx2
This leads to
FL + q0 L
c1 =
AE
Thus approximate solution:

q0 x 2
 
1
û( x ) = ( FL + q0 L) x −
AE 2

Now Since this solution does satisfy governing equation everywhere, i.e., has residual Rd = 0 and
also satisfies boundary conditions, it is the exact solution.

1.2.2 Simply supported beam under unifrom loading:


Consider a simply supported beam as shown in the figure. It
has uniform transverse loading acting on it (e.g., self-weight).

Let’s follow out procedure as before - Derive governing equation of the physics.

d2 d2 w
 
EI 2 − q( x ) = 0
dx2 dx

Subject to: w(0) = 0; dw dw


dx (0) = 0; w ( L ) = 0; dx ( L ) = 0; Also, in our case, loading q ( x ) = q0 is a
constant.
- Assume an approximate solution. Let’s say ŵ( x ) = c0 + c1 x + c2 x2 + c3 x3 + c4 x4 - Apply bound-
ary condition:
ŵ(0) = 0 ⇒ c0 = 0
d2 ŵ
EI (0) = 0 ⇒ c2 = 0
dx2
ŵ( L) = 0 ⇒ c1 + c3 L2 + c4 L3 = 0 ⇒ c1 = −(c3 L2 + c4 L3 )
d2 ŵ
EI ( L) = 0 ⇒ 6c3 + 12c4 L = 0 ⇒ c3 = −2c4 L
dx2

3
- It also has to satisfy governing equation. i.e.,

d2 d2 ŵ
 
q0
EI 2 = q0 ⇒ c4 =
dx2 dx 24EI

This leads to
2q0 L
c3 = −
24EI
and
q0 L3
c1 =
24EI
Thus approximate solution:
q0 x
L3 − 2Lx2 + x3

ŵ( x ) =
24EI
Now Since this solution does satisfy governing equation everywhere, i.e., has residual Rd = 0 and
also satisfies boundary conditions, it is the exact solution.

Sinusoidal approximation function: Point Collocation example Now, let’s try sinusoidal func-
tions as an approximation function. Let ŵ( x ) = c1 sin( πx
L )
Note that it already satisfies all the boundary conditions.

ŵ(0) = 0 ⇒ c1 sin(0) = 0
d2 ŵ  π 2
EI 2 (0) = 0 ⇒ − EIc1 sin(0) = 0
dx L
ŵ( L) = 0 ⇒ c1 sin(π ) = 0
d2 ŵ  π 2
EI 2 ( L) = 0 ⇒ − EIc1 sin(π ) = 0
dx L
Now, the domain residue,

d2 d2 w
   π 4 πx
Rd ( x ) = 2 EI 2 − q0 = c1 EI sin( ) − q0
dx dx L L

We can note that now it is not at all possible to make Rd ( x ) zero everywhere in the domain. We
may select a point in the domain where we would like to make the domain residue zero. Let’s say
q0 L4
we want to make Rd ( L/2) = 0 ∴ c1 = EIπ 4 sin(π/2)
. Let’s see how our approximation compares.

In [12]: import numpy as np


from math import sin, cos
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D

L=1.
E=2.1e11
q_0=7860.*0.001*0.100*9.81 # rho*A*g
I=(0.100*0.001**3)/12. # b*h^3/12

# def exact(x):

4
# return q_0*x/(24.*E*I)*(L**3-2*L*x**2+x**3)

# def collocation(x0,x):
# c_1=q_0*L**4/(E*I*np.pi**4*sin(np.pi*x0/L))
# return c_1*sin(np.pi*x/L)
def compare1(x0):
fig=plt.figure()
fig, ax=plt.subplots()

x=np.linspace(0.,L,101)

wcolloc=np.linspace(0.,L,101)
# print(wcolloc)
wexact=q_0*x/(24.*E*I)*(L**3-2*L*x**2+x**3)

for i in range(101):
wcolloc[i]=q_0*L**4/(E*I*np.pi**4*sin(np.pi*x0/L))*sin(np.pi*x[i]/L)
# print(wcolloc)
ax.plot(x,wexact,'k-',label='analytical solution')
ax.plot(x,wcolloc,'r--',label='numerical solution')
ax.legend(['analytical','numerical'])
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_xlim([-0.05,1.05])
# ax.set_ylim([-0.06,0.06])
plt.show()
compare1(L/2)

<Figure size 432x288 with 0 Axes>

5
2-Parameter Point Collocation Similar exercise can be done with 2 sinusoidal terms ŵ( x ) =
3πx
c1 sin( πx
L ) + c3 sin ( L )

d2 d2 w 3π 4
   π 4    
 πx  3πx
Rd ( x ) = 2 EI 2 − q0 = c1 EI sin + c3 EI sin − q0
dx dx L L L L
 π 4   πx  
3πx

Rd ( x ) = EI c1 sin + 81c3 sin − q0
L L L
Now we can choose two different location where we can make Rd = 0, giving us 2 equations
for 2 unknown coefficients.

In [9]: def compare2(x0,x1):


fig=plt.figure()
fig, ax=plt.subplots()

x=np.linspace(0.,L,101)

wcolloc=np.linspace(0.,L,101)
wexact=q_0*x/(24.*E*I)*(L**3-2*L*x**2+x**3)

a=np.array([[sin(np.pi*x0/L), sin(3*np.pi*x0/L)],[sin(np.pi*x1/L), sin(3*np.pi*x1/L)


a=E*I*(np.pi/L)**4*a
b=np.array([q_0,q_0],dtype='float')
cc=np.linalg.solve(a,b)

6
c1=cc[0]
c3=cc[1]
for i in range(101):
wcolloc[i]=c1*sin(np.pi*x[i]/L)+c3*sin(3*np.pi*x[i]/L)
# print(wcolloc)
ax.plot(x,wexact,'k-',label='analytical solution')
ax.plot(x,wcolloc,'r--',label='numerical solution')
ax.legend(['analytical','numerical'])
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_xlim([-0.05,1.05])
# ax.set_ylim([-0.06,0.06])
plt.show()
compare2(L/4,L/2)

<Figure size 432x288 with 0 Axes>

In [ ]: # <img src="L4_AxialBar.png" alt="Deformation of rod/bar under uniform and end load appl
# <img src="L4_SimplySupportedBeam.png" alt="Simply supported beam with uniform loading"
# ![Simply supported beam with uniform loading](L4_SimplySupportedBeam.png "Simply suppo

S-ar putea să vă placă și