SAMSA Journal Vol 4 Pp61 78 Thankane Stys

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

Finite Dierence Method for Beam Equation with Free

Ends Using Mathematica


K.S. Thankane and T. Stys
University of Botswana
Department of Mathematics
Pr. Bag 0022, Gaborone, Botswana
Email: [email protected]
Email: [email protected]
August 15, 2009
Abstract
For simple data functions f(x, u) and r(x), the exact solution u(x) of the Euler-
Bernoulis beam equation
d
2
dx
2
[r(x)
d
2
u
dx
2
] = f(x, u), 0 x L, (1)
with the free ends boundary conditions
u(0) = a0,
d
2
u(0)
dx
2
= b0,
u(L) = aL,
d
2
u(L)
dx
2
= bL,
(2)
can be found by standard methods well known in literature of ordinary dierential equa-
tions and their applications. For more developed data functions, when exact methods
fail, numerical methods are successfully applied to nd an approximate solution of a
broad class of the boundary value problems. In the paper, we present eective algo-
rithms based on nite dierence methods for linear and non-linear beam equations.
We give the complete analysis of convergence of the algorithms with global error esti-
mates. For the purpose of illustration of the methods and their applications, we design
Mathematica modulae and solve a number of beam equations . The numerical solutions
conrm eectiveness of the algorithms.
Keywords: Beam Equations, Finite Dierence Methods
1
1 Introduction
Beam equations have a long history starting from Leonardo da Vinci (1452-
1519) and Galileo Galilee (1584-1642) developed by Leonard Euler (1707-
1783), Jacob (1654-1705) and Daniel Bernoulli (1700-1782) in the eighteenth
century. There are numerous structures that evidently were constructed through
application of the beam theory. Practical applications of the beam equations
1
This is a part of Ms. Thankanes Master Dissertation
1
VOLUME 4 (2009) 61 - 78
2
are presented in broad literature (cf. [1],[2],[3],[7],[8]). These are very huge
buildings like the Manhattan towers, long bridges across big rivers, aero planes
and cars. In these structures, the beams are either used as supporting struc-
tures of the oor or as axles of cars. These would not be possible if it was not
for the usage of the beam theory.
In this paper, we consider numerical solutions of the beam equations with use
of Mathematica system for doing Mathematics (see [6]). The paper is intended
to present a complete mathematical analysis of eective algorithms based on
the Finite Dierence Method illustrated by a number of examples. The paper
can be also of an academic and scientic interest for those who deal with the
beam equations and their applications including engineering theory and con-
struction.
Boundary Value Problem. We consider the beam equation
d
2
dx
2
[r(x)
d
2
u
dx
2
] = f(x, u), 0 x L, (3)
with the free ends boundary conditions
u(0) = a
0
,
d
2
u(0)
dx
2
= b
0
,
u(L) = a
L
,
d
2
u(L)
dx
2
= b
L
,
(4)
Let us write the equation in the equivalent form:
d
2
v
dx
2
= f(x, u),
r(x)
d
2
u
dx
2
= v, 0 x L
(5)
with the corresponding boundary conditions
u(0) = a
0
, v(0) = b
0
,
u(L) = a
L
, v(L) = b
L
,
(6)
1.1 Engineering Interpretation
A beam is common element of a structure of bridges, towers, buildings, etc.
In the linear case, when f(x, u) = q(x)u + p(x), r = EI, E is the Youngs
modulus, and I is the area moment of inertia of the beams cross section, the
beam equation, takes the following form:
d
2
dx
2
[E I
d
2
u
dx
2
] = q(x)u +p(x), 0 x L, (7)
Here, u(x) is a deection of the beam, q(x) is the coecient of ground elasticity,
and p(x) is a load force normal to the beam at the point x.
62 K.S. THANKANE & T. STYS/ SAJPAM VOLUME 4 (2009) 61 - 78
3
In the case, when q(x) = 0, and the beam is supported with free ends, the
solution u(x) of the boundary problem
d
2
dx
2
[E I
d
2
u
dx
2
] = p(x), 0 x L,
u(0) = a
0
,
d
2
u(0)
dx
2
= b
0
,
u(L) = a
L
,
d
2
u(L)
dx
2
= b
L
.
(8)
describes deection of the beam from the original position under the force of
load p(x). (see Figure 1 and Figure 2).
?
x
p(x)

A
A
A

A
A
A
u(0) = a
0
u

(0) = b
0
u(L) = a
L
u

(L) = b
L
Figure. 1 Beam with free ends
?
x
p(x)

A
A
A

A
A
A
u(0) = a
0
u

(0) = b
0
u(L) = a
L
u

(L) = b
L
Figure. 2. Beam deection
For simple data functions f(x, u) and r(x), the exact solution u(x) of equa-
tion (3) with the boundary conditions can be found by standard methods well
known in literature of ordinary dierential equations and their applications
(cf. [3]). For more developed data functions, when exact methods fail, numer-
ical methods can be successfully applied to nd an approximate solution of a
broad class of the boundary value problems. We shall present some eective
numerical methods for solving the boundary problems in the next sections.
We begin to consider the case, when the product of Youngs Modulus E and
the area moment of inertia I are constant. Then the equation (3) can be
written as
d
4
u
dx
4
=
1
EI
f(x, u).
63 K.S. THANKANE & T. STYS/ SAJPAM VOLUME 4 (2009) 61 - 78
4
2 Finite Dierence Scheme
We apply notation
x
i
= ih, h =
L
n + 1
, u
i
= u(x
i
),
d
2
u(x
i
)
dx
2
= u(x
i
, ) +
0
i
(h),
d
2
v(x
i
)
dx
2
= v
i
+
1
i
(h)
for i = 1, 2, ..., n, where the nite dierence operator
u
i
=
u
i1
2u
i
+u
i+1
h
2
,
and the local truncation errors

0
i
(h) =
h
2
12
d
4
u(
i
)
dx
4
,
1
i
(h) =
h
2
12
d
4
v(
i
)
dx
4
(9)
for a certain
i
(x
i1
, x
i+1
), provided that u(x) is six times continuously
dierentiable in the interval [0, L] .
Now let us consider the case when r(x) = 1 starting with the standard nite
dierence approximation of the derivatives
d
2
u
dx
2
and
d
4
u
dx
4
, on the mesh points
q
x
0
q
x
1
q
x
2
q
x
3
q
x
4
q
x
5
q
x
6
qd q
0
L
Figure 3. The knots x
i
, i = 1, 2, ..., n, n = 5
Then, the standard nite dierence scheme which approximates the two equa-
tions (5) with boundary conditions (6) is
v
i
= f(x, u
i
) +
0
i
(h),
u
i
= v
i
+
1
i
(h), i = 1, 2, 3, ..., n,
(10)
with the truncation error
i
(h) = O(h
2
)
2.1 Matrix Form of the Finite Dierence Scheme
Let us write equations (10) in the form of the system of equations including
the boundary value conditions.
Canceling the local truncation error
i
(h) in (10), we arrive at the nite dif-
64 K.S. THANKANE & T. STYS/ SAJPAM VOLUME 4 (2009) 61 - 78
5
ference scheme in the form of the system of equations
v
0
= b
0
v
i1
2v
i
+v
i+1
h
2
= f(x
i
, u
i
) i = 1, 2, ..., n,
v
n+1
= b
L
(11)
and
u
0
= a
0
u
i1
2u
i
+u
i+1
h
2
= v
i
, i = 1, 2, ..., n,
u
n+1
= a
L
(12)
Eliminating v
0
, v
n+1
and u
0
, u
n+1
, we obtain
2v
1
v
2
h
2
= b
0
f(x
1
, u
1
)
v
i1
+ 2v
i
v
i+1
h
2
= f(x
i
, u
i
) i = 2, 3, ..., n 1,
v
n1
+ 2v
n
h
2
= b
L
f(x
n
, u
n
)
(13)
and
2u
1
u
2
h
2
= a
0
v
1
u
i1
+ 2u
i
u
i+1
h
2
= v
i
, i = 2, 3, ..., n 1,
u
n1
+ 2u
n
h
2
= a
L
v
n
(14)
Now, let us write the nite dierence schemes (13) and (14) in the matrix form
for the vector-solutions U
h
= {u
1
, u
2
, ..., u
n
} and V
h
= {v
1
, v
2
, ..., v
n
}
M
0
V
h
= F(U
h
), M
0
U
h
= F
h
(V
h
), (15)
where
M
0
=
1
h
2
_

_
2 1 0 0 0 0 0
1 2 1 0 0 0 0
0 1 2 1 0 0 0

0 0 0 0 1 2 1
0 0 0 0 0 1 2
_

_
,
65 K.S. THANKANE & T. STYS/ SAJPAM VOLUME 4 (2009) 61 - 78
6
and right sides
F
h
(U
h
) =
_

_
b
0
f(x
1
, u
1
)
f(x
2
, u
2
)
f(x
3
, u
3
)
.
.
.
f(x
n1
, u
n1
)
b
L
f(x
n
, u
n
)
_

_
, F
h
(V
h
) =
_

_
a
0
v
1
v
2
v
3
.
.
.
v
n1
a
L
v
n
_

_
,
2.2 Convergence
Let us note that the matrix M
0
in the systems of equations (15) is positive
denite. Indeed, the matrix has the eigenvalues (cf. [4], p.55):

k
=
4
h
2
sin
2
k
2n
, k = 1, 2, ..., n
The eigenvalues
k
, k = 1, 2, ..., n, satisfy the inequalities (cf. [4], p. 57)

n2
>
n3
> >
1
>
8
L
2
(16)
The following theorem holds (cf. [4], p. 59 ) :
Theorem 1 A symmetric matrix M
0
which has positive eigenvalues is positive
denite
So, there exists a constant such that
(M
0
X, X) (X, X)
for any vector X R
n
and =
8
L
2
The inverse matrix M
1
0
is also positive denite and its spectral norm||M
1
0
||
1

.
In conclusion, the norm of the matrix M
1
0
satises the inequality
||M
1
0
||
L
2
8
. (17)
Global error estimate. Let U, V be the exact solution and U
h
, V
h
the
approximate solution. Then, the global error E
h
(U) = U
h
U, E
h
(V ) = V
h
V
satises the system of equations
M
0
E
h
(U) =
h
(U), M
0
E
h
(V ) =
h
(V ),
66 K.S. THANKANE & T. STYS/ SAJPAM VOLUME 4 (2009) 61 - 78
7
where, by (9), the local truncation error
||
h
(U)|| C h
2
, ||
h
(V )|| C h
2
for a constant C independent of h.
So that
E
h
(U) = M
1
0

h
(U), E
h
(U) = M
1
0

h
(V ).
Hence, we obtain the global error estimate
||U
h
U|| K h
2
, ||V
h
U|| K h
2
,
for a constant K independent of h.
Thus, we can state the following Theorem:
Theorem 2 The method is convergent as fast as O(h
2
) > 0 when h > 0.
2.3 Homogeneous Boundary Conditions
In applications, it is convenient to transform the non-homogeneous boundary
conditions to homogeneous one. We make the transformation by the mapping
u(x) = u
0
(x) +w(x), 0 x L,
where the interpolating polynomial w(x) satises the boundary conditions
w(0) = a
0
, w(L) = b
0
,
w

(0) = a
L
, w

(L) = b
L
To nd the interpolating polynomial, we apply the Mathematica commands
(cf. [6])
Enter
n (for example n=9 to be h=10;)
p = {{0, {a_0, 0, b_0}}, {1, {a_L, 0, b_L}}};
Execute
Simplify[InterpolatingPolynomial[p, x]];
to obtain
w(x) = (a
0
+x
2
((b
0
/2 + ((a
0
+a
L
b
0
/2 + 1/2((6a
0
6a
L
+b
0
((12a
0
12a
L
+b
0
b
L
))((1 +x))))((1 +x)))x))
The new unknown u
0
(x) is the solution of the equation
d
4
u
0
dx
4
= f(x, u
0
+w)
d
4
w
dx
4
, 0 x L
(18)
67 K.S. THANKANE & T. STYS/ SAJPAM VOLUME 4 (2009) 61 - 78
8
and satises the homogeneous boundary conditions
u
0
(0) = 0, u
0
(L) = 0,
u

0
(0) = 0, u

0
(L) = 0.
We split equation (18) into two equations of the second order
d
2
v
0
dx
2
= f(x, u
0
+w)
d
4
w
dx
4
,
d
2
u
0
dx
2
= v
0
(x), 0 x L
(19)
with the corresponding homogeneous boundary conditions
u
0
(0) = 0, v(0) = 0,
u
0
(L) = 0, v(L) = 0,
(20)
In the case of homogeneous boundary value conditions, we have the system of
equations
v
0
0
= 0
v
0
i1
+ 2v
0
i
v
0
i+1
h
2
= f(x
i
, u
0
i
+w
i
) +
d
4
w
i
dx
4
, i = 1, 2, ..., n,
v
0
n+1
= 0
(21)
and
u
0
0
= 0
u
0
i1
+ 2u
0
i
u
0
i+1
h
2
= v
0
i
, i = 1, 2, ..., n,
u
0
n+1
= 0
(22)
Because v
0
0
= 0, v
0
n+1
= 0 and u
0
0
= 0, u
0
n+1
= 0, the system of equations takes
the following form:
2v
0
1
v
0
2
h
2
= f(x
1
, u
0
1
+w
1
) +
d
4
w
1
dx
4
v
0
i1
+ 2v
0
i
v
0
i+1
h
2
= f(x
i
, u
0
i
+w
i
) +
d
4
w
i
dx
4
, i = 2, 3, ..., n 1,
v
0
n1
+ 2v
0
n
h
2
= f(x
n
, u
0
n
+w
n
) +
d
4
w
n
dx
4
(23)
68 K.S. THANKANE & T. STYS/ SAJPAM VOLUME 4 (2009) 61 - 78
9
and
2u
0
1
u
0
2
h
2
= v
0
1
u
0
i1
+ 2u
0
i
u
0
i+1
h
2
= v
0
i
, i = 2, 3, ..., n 1,
u
0
n1
+ 2u
0
n
h
2
= v
n
(24)
Now, let us write the nite dierence schemes (23) and (24) for the solutions
U
0
h
= {u
0
1
, u
0
2
, ..., u
0
n
} and V
0
h
= {v
0
1
, v
0
2
, ..., v
0
n
} in the matrix form
M
0
V
0
h
= F(U
0
h
), M
0
U
0
h
= F
h
(V
0
h
), (25)
where the matrix M
0
and the vectors F(U
0
h
), F(V
0
h
) are given by formula (15)
for a
0
= a
L
= 0 and b
0
= b
L
= 0
Example 1 Consider the beam equation
d
4
u
dx
4
=
4
xsin x 4
3
cos x, 0 x 1,
(26)
with the corresponding non-homogeneous boundary conditions
u(0) = 0, u

(0) = 2,
u(1) = 0, u

(1) = 2,
(27)
Let us note that u(x) = xsin x is the exact solution of the boundary problem.
In order to transform the non-homogeneous boundary conditions to homoge-
neous one, we introduce the new unknown u
0
(x) by the substitution
u(x) = u
0
(x) +w(x), 0 x 1,
where the interpolating polynomial w(x) is obtained by the Mathematica com-
mand:
Enter
p = {{0, {0, 0, 2}}, {1, {0, 0, 2}}};
Execute
Simplify[InterpolatingPolynomial[p, x]];
to get
w(x) = (x 1)
2
x
2
(2x 1).
Then, the new unknown u
0
(x) = xsin x w(x) satises the equations
d
2
dx
2
d
2
u
0
dx
2
=
4
u
0
4
3
cos x
d
2
dx
2
d
2
w
dx
2
, 0 x 1, (28)
69 K.S. THANKANE & T. STYS/ SAJPAM VOLUME 4 (2009) 61 - 78
10
with the free ends homogeneous boundary conditions
u
0
(0) = 0,
d
2
u
0
(0)
dx
2
= 0,
u
0
(1) = 0,
d
2
u
0
(1)
dx
2
= 0,
(29)
or in the form of two equations of the second order
d
2
v
0
dx
2
=
4
u
0
4
3
cos x
d
2
dx
2
d
2
w
dx
2
, 0 x 1,
d
2
u
0
dx
2
= v
0
, 0 x 1
(30)
with the corresponding homogeneous boundary conditions
u
0
(0) = 0, v(0) = 0,
u
0
(1) = 0, v(1) = 0.
(31)
Then, the solution with the non-homogeneous boundary conditions
u(x) = u
0
(x) +w(x), 0 x 1,
where the solution u
0
(x) with homogeneous boundary conditions is determined
by the following algorithm.
3 Optimal Algorithm
In order to nd the solution of equations (25), we shall modify the algorithm
given in (cf. [5], p.165), which contains proportional number of arithmetic
operations to the number of unknowns n. Let us note that a stable algorithm
for solving a system of equations MV = F with a square matrix M of dimen-
sion n n and with n unknowns is called optimal if it solves the system of
equations with the cost of the number of arithmetic operations proportional
to n. In this sense the proposed algorithms are optimal. By the algorithm one
can nd a solution of a beam equation in the case of a function f(x, u) = p(x)
independent of u. In the next sections, we shall use the algorithm for any func-
tion f(x, u).
70 K.S. THANKANE & T. STYS/ SAJPAM VOLUME 4 (2009) 61 - 78
11
Algorithm
To evaluate V
h
= (v
1
, v
2
, ..., v
n
)
Set :
1
=
1
2
,
1
=
F
1
(V
h
)h
2
2
evaluate
i
=
1
2 +
i1
for i = 2, 3, . . . , n 1,
evaluate,
i
=
F
i
(V
h
)h
2
+
i1
2 +
i1
for i = 2, 3, . . . , n,
set : v
n
=
n
evaluate : v
i
=
i

i
v
i+1
for i = n 1, n 2, . . . , 1
To evaluate U
h
= (u
1
, u
2
, ..., u
n
)
Set :
1
=
F
1
(U
h
)h
2
2
evaluate,
i
=
F
i
(U
h
)h
2
+
i1
2 +
i1
for i = 2, 3, . . . , n,
set : u
n
=
n
evaluate : u
i
=
i

i
u
i+1
for i = n 1, n 2, . . . , 1
(32)
3.1 Mathematica Module solveFreeEnds
Applying the algorithm, we design Mathematica module solveFreeEnds
The module solves a beam equation with free ends under homogeneous bound-
ary conditions.
The entry date:
n is the number of interior mesh points in the interval [0, L].
q(x) is a given continuous function.
Mathematica module solveFreeEnds
solveFreeEnds[q_, L_, n_] := Module[{x },
h = N[L/(n + 1)];
solveTri[g_] := Module[{al, be, x, fv, v1, u1},
al[1] = -1/2;
al[i_] := al[i] = -1/(2 + al[i - 1]);
be[1] = g[[1]]h^2/2;
be[i_] := be[i] = (g[[i ]]h^2 + be[i - 1])/(2 + al[i - 1]);
71 K.S. THANKANE & T. STYS/ SAJPAM VOLUME 4 (2009) 61 - 78
12
x[n] = be[n];
x[i_] := x[i] = be[i] - al[i]*x[i + 1];
Table[x[i], {i, 1, n}]
];
fv = Table[q[i h], {i, n}];
v1 = solveTri[fv];
u1 = solveTri[v1];
u1
]
In order to invoke the module, we enter data
q[x_], n, L,
and execute the command
solveFreeEnds[q_,n_,L_]
As the result of execution of the module, we obtain the numerical solution in
the form of the table at the mesh points
x
0
= 0, x
0
+h, x
0
+ 2h, ..., x
0
+nh, x
n+1
= L.
Example 2 Find the solution u(x) of the beam equation
d
2
dx
2
[
d
2
u
dx
2
] =
4
xsin x 4
3
cos x 0 x 1,
which satises the free ends boundary value conditions
u(0) = u(1) = 0, u

(0) = 2 u

(1) = 2.
First, we transform the boundary value problem with the non-homogeneous
boundary conditions to the boundary value problem with the homogeneous
boundary conditions (see the example (26)).
Then, we solve the beam equation
d
4
u
0
dx
4
=
4
xsin x 4
3
cos x
+ 96(x 1) + 12(8x + 2(2x 1)), 0 x 1,
(33)
with the corresponding homogeneous boundary conditions
u
0
(0) = 0,
d
2
u
0
(0)
dx
2
= 0,
u
0
(1) = 0,
d
2
u
0
(1)
dx
2
= 0.
(34)
72 K.S. THANKANE & T. STYS/ SAJPAM VOLUME 4 (2009) 61 - 78
13
In order to apply the module, we dene in Mathematica the function
q[x ] :=
4
xsin x 4
3
cos x + 96(x 1) + 12(8x + 2(2x 1)),
and invoke the module for the number of interior mesh points n = 9 in the
interval [0, L] = [0, 1] with step size h =
L
n + 1
= 0.1
solveFreeEnds[q,9,1]
Then, we write the solutions u
0
h
(x) and u
0
(x) rounded o to four decimal places
in the table
x 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
u
0
h
(x) 0.0069 0.0657 0.1864 0.3477 0.5083 0.6191 0.6361 0.5319 0.3072
u
0
(x) 0.0105 0.0693 0.1873 0.3442 0.5 0.6068 0.6217 0.5185 0.2985
Table 1
The exact solution
u
0
(x) = xsin[x] w[x],
where
w(x) = (x 1)
2
x
2
(2x 1).
The absolute global error
globalError = max
1i9
|u
0
h
(x
i
) u
0
(x
i
)| = 0.0143432
and relative error
relativeError = 1.43432%
The exact solution u(x) = xsin x satises the beam equation
d
4
u
dx
4
=
4
xsin x 4
3
cos x, 0 x 1,
(35)
and the non-homogeneous boundary value conditions
u(0) = 0,
d
2
u(0)
dx
2
= 2,
u(1) = 0,
d
2
u(1)
dx
2
= 2.
(36)
Then, we get the solution u
h
(x) = u
0
h
(x) +w(x).
3.2 Implicit iterative method
We shall solve the system of equations (25) by the following implicit iterative
method:
V
0
h
given initial values
M
0
U
(m+1)
h
= F
h
(V
m
h
),
M
0
V
(m+1)
h
= F
h
(U
m
h
), m = 0, 1, ...
(37)
73 K.S. THANKANE & T. STYS/ SAJPAM VOLUME 4 (2009) 61 - 78
14
The following theorem holds:
Theorem 3 The implicit iterative method is convergent for any given initial
vector V
(0)
h
, when L < 2

2.
Proof. The dierence of two following iterations
E
(m+1)
(U
h
) = U
(m+1)
h
U
(m)
h
satises the relation
M
0
E
(m+1)
(U
h
) = F(V
(m+1)
h
) F(V
(m)
h
)
= V
(m+1)
h
V
(m)
h
= E
(m+1)
(V
h
),
Hence, we have the recursive relation
E
(m+1)
(U
h
) = M
1
0
E
(m)
(V
h
), m = 0, 1, 2, ...,
Because ||M
1
0
||
L
2
8
, therefore, by the above relation, we get the estimate
||E
(m+1)
(U
h
)||
1

|| E
(m)
h
(V
h
)||
1

m
|| E
(0)
h
(V
h
)||, m = 0, 1, 2, ..., (38)
For =
8
L
2
, we have
1

=
L
2
8
< 1, when L < 2

2.
Thus, by inequality (38), we conclude that
||E
(m+1)
|| > 0 , when m > ,
since then
1

m
> 0. End of the proof.
3.3 Mathematica Module solveFreeEndsImplicit
We solve equation (25) with free ends, by the Implicit Iterative Method using
the Mathematica module
solveFreeEndsImplicit[v0_, g_, L_, n_] := Module[{x },
h = L/(n + 1);
solveTri[f_] := Module[{al, be, x},
al[1] = -1/2;
al[i_] := al[i] = -1/(2 + al[i - 1]);
be[1] = f[[1]]/2;
be[i_] := be[i] = (f[[i]] + be[i - 1])/(2 + al[i - 1]);
x[n] = be[n];
x[i_] := x[i] = be[i] - al[i]*x[i + 1];
74 K.S. THANKANE & T. STYS/ SAJPAM VOLUME 4 (2009) 61 - 78
15
Table[x[i], {i, 1, n}]
];
oneIter[v_] := Module[{ fv, fu},
fv = h^2Table[v[[i]], {i, n}];
u1 = solveTri[fv];
fu = h^2Table[g[i h, u1[[i]]], {i, 1, n}];
v1 = solveTri[fu]
];
N[Nest[oneIter, v0, 10]];
u1
]
Example 3 Solve the beam equation
d
4
u
dx
4
= Exp[u], 0 x 1,
(39)
with the corresponding homogeneous boundary conditions
u(0) = 0, u

(0) = 0,
u(1) = 0, u

(1) = 0,
(40)
Solution. We enter data
g[x_,u_]:=Exp[-u];
n=9; L=1;
v0=Table[0,{i,n}];
and call the module
t1=solveFreeEndsImplicit[v0,g,L,n]
Let us repeat calculations for n = 19
Execute the commands
g[x_,u_]:=Exp[-u];
n=19; L=1;
v0=Table[0,{i,n}];
t1=solvFreeEndsImplicit[v0,g,L,n]
We give the results in the table rounded o to four digits after decimal point.
x 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
u
0
2h
(x) 0.0041 0.0077 0.011 0.0124 0.0130 0.0124 0.011 0.0077 0.0041
u
h
(x) 0.00416 0.0077 0.0105 0.0124 0.0129 0.01230 0.01050 0.0077 0.0041
Table 2
75 K.S. THANKANE & T. STYS/ SAJPAM VOLUME 4 (2009) 61 - 78
16
In order to estimate the global error, we apply the Runges Principle
globalError =
1
3
max
1in
|u
2h
(ih) u
h
)(ih)| =
1
3
max
1in
|t2[i] t1[i]| = 0.000025
The relative error
relativeError = 100
globalError
max
1in
|t2[i]|
= 0.195%
Then, the most correct result
u
h
=
1
3
(4u
h
u
2h
).
Residual error. For convergent methods the global error is proportional to
the residual error. The residual error can be approximately determined by the
numerical solution, when the exact solution is unknown. Then, to estimate
the residual error, rstly, we nd the interpolating polynomial spanned on the
list of pairs determined by the table 2 and using the Mathematica command
pairlist=N[Table[{i h,t2[[i]]},{i,n}]
{{0.05, 0.002057}, {0.1, 0.00406}, {0.15, 0.005943},
{0.2, 0.007672}, {0.25,0.009203},{0.3, 0.010502},
{0.35, 0.011541}, {0.4, 0.012299},{0.45, 0.012759},
{0.5, 0.012914}, {0.55,0.0127594},{0.6,0.012299},
{0.65, 0.011541}, {0.7, 0.010502}, {0.75,0.009203},
{0.8, 0.007672}, {0.85,0.005943}, {0.9, 0.004056},
{0.95, 0.002057}}
Then, we nd the interpolating polynomial by execution of the command
Clear[x];
pol19 = Simplify[InterpolatingPolynomial[pairlist, x]]
0.041353 x 0.000104 x
2
0.082645 x
3
+ 0.041667x
4
0.000346 x
5
+
2.869905 10
6
x
6
+ 0.0001 x
7
0.000035 x
8
+ 0.00002366 x
9

0.000052 x
10
+ 0.000095 x
11
0.000133 x
12
+ 0.000143 x
13

0.000116 x
14
+ 0.00006868 x
15
0.000027836 x
16
+ 6.9208865 10
6
x
17

7.9540742 10
7
x
18
Next, we evaluate the residual error by the formula
residualError =
d
4
u
dx
4
f(x, u),
replacing u by the pol19. Then, we get the residual error by the commands
Clear[x]; n = 19;
residual =
Table[g[x, pol19] /. x -> i h-D[pol19, {x, 4}] {i, n}]
In the example, the maximal residual error, we calculate by the commands
76 K.S. THANKANE & T. STYS/ SAJPAM VOLUME 4 (2009) 61 - 78
17
blad = Max[Abs[residual]]
0.0000510502
and relative residual error
relativeblad = 100 blad/Max[Abs[t2]] %
0.39531 %
Hence, the residual error 0.00005105 is small and proportional to the global
error of the method. Therefore, the global error is also small.
Conclusion. In conclusion, we have proposed stable and convergent algo-
rithms implemented in Mathematica modelae solveFreeEnds and solveFreeEnd-
sImplicit for solving the beam equations. The numerical results given in the
Table 1 and Table 2 conrm high accuracy of the results with small global
and relative errors. For the further analysis of the errors, we represent the
numerical results in the form of interpolating polynomials. Using the interpo-
lating polynomials, we can easily compute the residual errors which for stable
algorithms are consistent with the global errors of the methods. As a standard
principle used in engineering computations the acceptable results are on the
level up 5%. In the examples, the relative errors are: 1.4% in example 2,
0.195% in example 3, and the residual error in example 3 with f(x, u) = e
u
is 0.4%,. By the principle, these results conrm the eectiveness of the pro-
posed algorithms.
References
1. Clough, R.W. and Penzien J., Dynamics of Structures, McGraw-Hill,
1993.
2. Gere, J.M.,Mechanics of Materials,Nelson Thomas Publishing, 2002.
3. Popov, E.P., Mechanics of Materials, Prentice-Hall, 1978.
4. T. Stys, (2001), A Course in Numerical Methods of Dierential Equations,
5. K. Stys & T. Stys, (2000), A First Course in Numerical Analysis, Na-
tional Institute of Development Research and Documentation, University
of Botswana, ISBN99912-2-1492.
6. Wolfram, S., (1992), Mathematica a System for Doing Mathematics by
Computers, Addison-Wesley Publishing Company.
7. Euler-Bernoulli Beam Equation, http://en.wikipedia/Euler-Bernoulli-beam-
equation.
8. Timoshenko Beam Theory, http://en.wikipedia.org/wiki/Timoshenko-beam-
theory
77 K.S. THANKANE & T. STYS/ SAJPAM VOLUME 4 (2009) 61 - 78

You might also like