Documente Academic
Documente Profesional
Documente Cultură
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.
d2 u
AE + q0 = 0
dx2
û( 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.
Let’s follow out procedure as before - Derive governing equation of the physics.
d2 d2 w
EI 2 − q( x ) = 0
dx2 dx
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.
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)
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.
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)
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)
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