Assignment4 Solution
Assignment4 Solution
Assignment4 Solution
ANS 4.7
d2y dy
Differential equation: 5 7y 0
dx 2
dx
Galerkin method:
Let w be an arbitrary weight function:
w(
d2y dy
h
5 7 y )dx=0
0
dx 2
dx
Integrating by parts:
0
dx dx 0
dx 0
dx 0
x
1 h
Where N h=element length
x
h
dy
dx
N , x N , x dx 5 N N , x dx 7 N N dx y
h h h
ne 0
0 0 0 dy
dx h
……………since nodal values of weights are arbitrary
1
dy
1 1 7 2 1 5 1 1 y1 dx 0
On integrating : 2
1 1 12 1 2 2 1 1 y2 dy
dx h
……… see 4.31&4.32 from lecture notes(8-10 )
dy
1 40 61 y1 dx 0
…………………element equation
12 1 20 y2 dy
dx h
For 2 elements:
dy
40 61 0 y1 dx 0
1
1 20 61 y2 0
12
0 1 20 y3 dy
dx 1
Using boundary conditions
y=0 at x=0
y’=0 at x=1
1 20 61 y2 0
12 1 20 y3 0
y2 0
y3 0
For given differential equation and boundary conditions we will get zero nodal
displacements, no matter how many elements we take.
Exact solution:
3
y e ( A cos x B sin x) where 2.5 ,
2
i.e. y=0
2
ANS 4.8
Solution:
Since the given equation is in variational form. Therefore we can directly proceed, before
that we have to first convert 10 u(1) into a function by using the property of deriac delta
function.
Therefore we can rewrite the above equation as:
I 5( ) dx 10 uδ(1 x )dx
du 2
1 1
0
dx 0
Now putting
u u ne N
We will get
0 0
1 x / h
Putting N & solving, we get
x / h
u 10
1 1 ne 1 x / h ne
I 5 / h u ne u
1 1 x / h 1
I
Now finding =0
u ne
u 10 =0
I 1 1 ne 0
10 / h
u 1 1 1
ne
u 10 -----------------------------(1)
1 1 ne 0
10 / h
1 1 1
Putting h=1,
3
We have,
1 1 u1 0
10 10
1 1 u2 1
u2 =1
1 1 0 u1 0
10 / h 1 2 1 u2 0
0 1 1 u 10
3
1 1 0 0 u1 0
1 2 1 0 u2 0
10 / h
0 1 2 1 u3 0
0 0 1 1 u4 10
Since u(1), is always coming out to be 1.000,and hence the solution is converging.
4
ANS 4.9
Variational form is given
du 2
I
1
(5 u ) dx
0 dx
u une N
Element displacement matrix = u ne
u1
T
une
u 2
5
I une N , x N , x une 5 une N dx
1
d une 0
N , x N , x une 5 N dx
dI
1
u2=2.5.
--------------------------------------------------------------
6
c(1,1)=a(1,1);
c(2,1)=a(2,1);
c(1,2)=a(1,2);
c(2,2)=a(2,2);
for k=2:m
c(k,k)=c(k,k)+b(1,1);
c(k,k+1)=c(k,k+1)+b(1,2);
c(k+1,k)=c(k+1,k)+b(2,1);
c(k+1,k+1)=c(k+1,k+1)+b(2,2);
end
ANS 4.10
N1=0.1, N2=N3=0.2.
Using N1 N 2 N 3 N 4 1 , we get N4=0.5.
ANS 4.11
Given problem in variational form is,
du 2
I 5u dx
1
dx
0
Lagrangian shape functions are
7
By substituting we get,
N1 1 3 x 2 x 2
N2 4x 4 x2
N3 x 2 x 2
u e u ne N
I u ne N , x N , x u ne dx 5 u ne N dx
1 1
0 0
8
N N u dx 5 N dx 0
1 1
ne
,x ,x
0 0
u2 1.875
u3 2.5
ANS 4.12
d2 y
he given differential equation is 5 ( x 0.5) 0
dx 2
By Ritz method,
Variational form of above differential equation is
d 2 y
h
I n e
( 5 ( x 0 .5 )) y ) d x 0
0
d x 2
) d x 5 ( ( x 0 .5 ) y ) d x
dy dy dy
h h h
I ne = y (
dx 0 0
dx dx 0
1
Using the variational property, u u u 2
2
I = y ( ) 2 dx 5 ( ( x 0.5) y)dx
dy 1 dy
h h h
ne
dx 0 2 0 dx 0
I y ( ) 2 dx 5 y ( x 0.5)dx
dy 1 dy
h h h
ne
dx 0 2 0 dx 0
I ne 0
y ( )2 dx 5 y ( x 0.5)dx
dy 1 dy
h h h
I
ne
dx 0 2 0 dx 0
9
dy
dx h
1
y ne N , x N , x y ne ne h
5 N y ( x 0.5)dx
h
I dx y ne
ne
20 dy 0
dx 0
dI
ne
0
d y ne
dy
dx h
N , x N , x y 5 N ( x 0.5) dx
h
h
ne
dx
0 dy 0
dx 0
dy
dx
N , x N , x y 5 N 0.5 …………….(1)
h
h
ne
dx
0 dy
dx 0
Where,
0
N 0.5
1
x x
N (1 ) ( )
h h
x
(1 h )
N
( x)
h
1
N , x 1 1
h
1 1
N , x
h1
So now for first element the range of element is (0 to 0.5)
dy
dx 0
1 1 1 y1
0 h 1 h 1 1 y2 dx dy 5
1
0.5
dx 2
10
For first element on integration of equation between limits (0 to 0.5) we get,
dy
1 1 y1 dx 1 0
2
1 1 y2 dy 5
dx 2
For second element range is (0.5 to 1)
dy
dx
1 1 1 y1
0.5 h 1 h 1 1 y2 dx dy
2
1
dx 3
For second element on integration of equation between limits (0.5 to 1) we get,
dy
1 1 y2 dx 2
2
1 1 y3 dy
dx 3
On assembling the two elements and applying given boundary conditions
y=0, at x 0 …………..(1)
dy
0, at x 1 ………….(2)
dx
We get,
dy
1 1 0 y1 dx 1
2 1 2 1 y2 5
0 1 1 y3 0
2 1 5
2
1 1 0
On Solving we get,
y2 y3 2.5
y1 0
11