Upload
dangtuong
View
244
Download
9
Embed Size (px)
Citation preview
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
1
"msharpmath" revised on 2014.09.01
Numerical Analysis Using M#math
Chapter 9 Eigenvalue Problems
9-1 Existence of Solution and Eigenvalues
9-2 Sturm-Liouville Problems
9-3 Eigenvalues on Stability and Convergence Rate
9-4 Exercises ==============================
9-5 Higher-order ODE and Eigenvalue Problems (optional)
Eigenvalue problems occurring in electromagnetics, vibration, structure
analysis and so on are related to the boundary value problems of ordinary
differential equations. The eigenvalue-finding methods discussed in Chapter 4
provide the necessary platform to solve the eigenvalue problems of ordinary
differential equations. Nevertheless, eigenvalues for relevant to an
matrix consist of at most eigenvalues. This is in contrast to the
fact that the eigenvalue problems are associated with an infinite number of
eigenvalues. Therefore, there occurs an intrinsic limitation in obtaining
eigenvalues for eigenvalue problems such as the well-known Sturm-Liouville
problems. However, fortunately the fundamental eigenvalue that has the
smallest absolute value is the most important in applications. And engineering
importance diminishes as the absolute value of eigenvalues increases. In this
regard, the methods treated in this chapter are of practical importance even
though only a finite number of eigenvalues can be determined.
First of all, discussed is the situation where an infinite number of solutions
are existing. Next, the eigenvalue problems are properly defined. Then,
numerical approaches to obtain eigenvalues are discussed.
In doing this, the generalized nonlinear differential operator adopted earlier
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
2
is exploited again and the eigenvalue problems are expressed in the following
compact form
In the last section, the role of eigenvalues is explored in the initial value
problems and in the iteration methods.
//======================================================================
// syntax in M#math
//----------------------------------------------------------------------
Umbrella ‘bvp’ is designed to solve BVPs the general forms of which are
cz*{f''''}
+cw*{f'''} +cfw*{ff'''} +cuw*{f'f'''} + cvw*{f''f'''} + cww*{f'''f'''}
+cv*{f''} +cfv*{ff''} +cuv*{f'f''} + cvv*{f''f''}
+cu*{f'} +cfu*{ff'} +cuu*{f'f'}
+cf*{f} +cff*{ff} = cs
bw*{f'''} + bv*{f''} + bu*{f'} + bf*{f} = bs
Syntax
bvp .x[n=101,g=1](a,b) ( DE, [ BCs ] ) .Spoke.Spoke ...
x = (a,b).span(n,g=1); bvp [x] ( DE, [BCs] ) .Spoke.Spoke ...
Spokes
.peep // peep the iteration procedure
.relax(relax=0.5) // under-relaxation factor
.tol/abstol(abstol=1.e-5) // absolute tolerance
.reltol(reltol=1.e-5) // relative tolerance
.maxiter(maxiter=500) // maximum iteration count
.shift(scalar) // eigenvalue shift
.plot // plot default data
.plot(f,f',f'',...) // plot user-defined data
.return (f,f',f'',...) // return user-defined data
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
3
.togo (Y=y,Y1=y',...) // takeout each field
Section 9-1 Existence of Solution and Eigenvalues
In this section, the existence of an infinite number of solutions are
discussed focusing on second-order ODEs, and the eigenvalue problems are
defined.
■ Existence of an infinite number of solutions. As was discussed in
Chapter 8, solutions to boundary value problems are either ① unique, ②
nonexisting, or ③ of an infinite number. Nevertheless, despite the nonexistence
of mathematical solution, a meaningless numerical solution is always obtained
due to the inherent limitation of computing with finite number of digits, as was
confirmed in Example 8-5.
As a beginning step, let us investigate the case where an infinite number of
solutions are existing. For a particular second-order ODE , there are
two types of boundary conditions with which an infinite number of solutions are
obtained.
○ infinite number of solutions with multiple integration constants
(1)
○ infinite number of solutions with a single integration constant
(2)
(3)
For the cases of equations (1) and (2), only a trivial solution is obtained
numerically. This is because both the ODE and boundary conditions are
homogeneous.
■ Homogeneous conditions and eigenvalue problems. As was discussed
above, the ODE with non-homogeneous boundary conditions cannot have a
trivial solution . In this case, only one non-trivial solution is
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
4
numerically obtained even though there exist an infinite number of solutions
[the case of equation (3)].
The eigenvalue problems for the ODE over an interval treat
only homogeneous boundary conditions
(4)
and only nontrivial solutions . In the above, are not zero
simultaneously. The homogeneous boundary condition guarantees that a
constant multiple of an eigenfunction is also an eigenfunction. Of course, the
ODE relevant to the eigenvalue problem is type of homogeneous differential
equation.
■ Eigenvalue problems, definition and property. Especially for the second-
order ODE, the eigenvalue problems are generalized as the Sturm-Liouville
problem the detail of which will be discussed in the next section. Here, the
characteristics of eigenvalue problems are addressed briefly.
Let us find the mathematical solution to the following second-order ODE
with homogeneous differential equation and boundary conditions
(5)
First for the case of , the general solution is given as
(6)
so that from the boundary condition . And from the boundary
condition , we must have . However, since , it
follows that . In other words, a trivial solution is the only
possible solution. Next for the case of , from the general solution
and from the boundary conditions, the only possible solution is
found to be the trivial solution .
Last for the case of , the general solution
(7)
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
5
is utilized to find from the boundary condition . This means
that . And the remaining boundary condition enforces
that
(8)
which can be satisfied by . At this point, the corresponding
value is called the eigenvalue, and the corresponding solution
is called the eigenfunction. Meanwhile, it is conventional that the
integration constant is set to be unity, unless otherwise specified.
From the above simple example, the eigenvalue problems are understood
to exhibit the following characteristics.
• homogeneous ODE
• homogeneous boundary condition
• infinite number of eigenvalues
• eigenfunction corresponding to an eigenvalue
• , a constant multiple of , is also an eigenfunction
• the fundamental eigenvalue of smallest absolute value
Next, let us investigate the trend of eigenfunctions in response to the increase of
their absolute values. The graphical solution to the above-studied eigenvalue
problem
(9)
is shown in Figure 9-1.
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
6
Figure 9-1 Eigenfunctions corresponding to
The eigenfunction corresponding to the smallest absolute eigenvalue is
especially termed to be the fundamental eigenfunction. As shown in Figure 9-1,
the fundamental eigenfunction does not have any root that satisfies
inside the domain. Similarly, the second, third and fourth eigenfunctions have
one, two and three roots of , respectively, inside the domain. This
property is valid for other types of boundary conditions. For example, the
profiles of eigenfunctions corresponding to the boundary conditions
are displayed in Figure 9-2. It can be easily seen that the number
of roots of is the same as that shown in Figure 9-1.
Figure 9-2 Eigenfunctions corresponding to
Section 9-2 Sturm-Liouville Problems
The Sturm-Liouville problem, the most famous eigenvalue problem of
second-order ODE, is studied in this section due to its practical importance in
engineering and science.
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
7
★ Self-adjoint form. A standard second-order linear differential equation
written as
(10)
can be recast into the so-called self-adjoint form by multiplying
to both sides of the equation
(11)
The above self-adjoint form serves as the generic form producing an infinite
number of orthogonal functions, and is used to define the Sturm-Liouville
problem.
Table 9-1 Sturm-Liouville Problem and eigenfunction expansion
• differential equation:
• boundary conditions: at each side
or at both sides
(periodic)
• for , is a real continuous function
• for an interval , ,
• eigenvalue: all the eigenvalues are real and of infinite number
• eigenfunction: two distinct eigenfunctions are orthogonal,
• eigenfunction expansion:
■ Sturm-Liouville problem. For the interval , the Sturm-Liouville
equation is defined by the following self-adjoint form
(12)
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
8
where a parameter is called the eigenvalue. In the above, are all
real-valued and continuous over an interval . Especially
over an interval .
The self-adjoint form in equation (12) and the boundary conditions as
given in Table 9-1 consist of the boundary value problem called the Sturm-
Liouville problem. Frequently, the conditions ①, ②, ③ in Table 9-1 are
combined together as
(13)
where and are not zeros simultaneously.
The condition ④ in Table 9-1 is related to the singular Sturm-Liouville
problem, and the condition ⑤ to the periodic Sturm-Liouville problem. In
contrast, the regular Sturm-Liouville problem is defined by the conditions ①,
② and ③.
■ Discretization of Sturm-Liouville equation. The following Sturm-
Liouville equation
(14)
can be discretized for the internal grids such that
(15)
where the central difference approximation over the interval shown in Figure 9-
3 is employed. By rearranging, we have
(16)
which is further standardized to represent a typical eigenvalue problem
(17)
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
9
Then, by utilizing the tridiagonal form of matrix , eigenvalues can be easily
found by the inverse power method.
Figure 9-3 Grid configuration for discretization of Sturm-Liouville equation
(Example 1) For a Sturm-Liouville problem , ,
, find the fundamental eigenvalue and the fundamental eigenfunction
by numerical treatment.
The given ODE belongs to the Sturm-Liouville problem and is characterized
by . Re-writing equation (16)
and inserting gives
(18)
where 5 uniform subintervals are used, i.e. . And the
boundary condition at can be discretized from equation
(8-47) such that
or
(19)
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
10
Also, the boundary condition at is simply written as
(20)
These two boundary conditions are inserted into equation (18), and the
following linear equations are obtained.
(21)
By defining the matrix
(22)
and by using the Fadeev-Leverrier method, the characteristic equation is derived
as (refer to the note ☑)
(23)
the solution of which gives
(24)
Indeed, for the given matrix , the same result can be obtained by the QR
iteration method also. However, the above method is frequently used only for
small matrices, and does not utilize the tridiagonal form. Therefore, it is
desirable to use the inverse power method and the eigenvalue shifting. In order
to exploit the inverse power method, by putting and
solving , we have
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
11
(25)
The above-obtained is again substituted into the right-hand side of
and is solved to give
(26)
This procedure is repeated to obtain the following result
iter 1/lambda f[1] f[2] f[3] f[4]
1
2
3
4
5
6
7
8
9
10
11
1.899266
1.696450
1.674655
1.672051
1.671722
1.671676
1.671668
1.671667
1.671667
1.671667
1.671667
0.917610
0.922965
0.926777
0.927945
0.928246
0.928319
0.928336
0.928340
0.928341
0.928341
0.928341
1.000000
1.000000
1.000000
1.000000
1.000000
1.000000
1.000000
1.000000
1.000000
1.000000
1.000000
0.874528
0.844323
0.837483
0.835947
0.835600
0.835521
0.835502
0.835498
0.835497
0.835497
0.835497
0.541195
0.485133
0.475924
0.474158
0.473787
0.473705
0.473687
0.473682
0.473682
0.473681
0.473681
from which the converged solution is found to be
(27)
The fundamental eigenvalue shows an error of 3.6%
compared with the exact value (see a note in ☑). And the
fundamental eigenfunction is shown as below [the boundary value is
determined by using equation (19)].
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
12
0.000000
0.628319
1.256637
1.884956
2.513274
3.141593
0.637443
0.928341
1.000000
0.835497
0.473681
0.000000
0.621057
0.921032
1.000000
0.839012
0.476699
0.000000
☑ The exact eigenvalue can be determined from and
the eigenfunction is determined to be where .
M#math to find the exact eigenvalue is as follows.
#> double ftn(x) = tan(x*pi)+x;
#> w = .bisect(0.51,0.99, ftn); lam = w^2; // eigenvalue
w = 0.78763729
lam = 0.62037251
#> bvp.x(0,pi) ( {y''}+{%y}=0, [ {y}-{y'}=0, {y}=0 ] ).togo(u = y);
ans = 0.62142265
#> x = (0,pi).span(6).tr;
#> [ x, u.tr.rowskip(-20), sin(w*(pi-x)), sin(w*(pi-x))/0.996293 ];
ans =
[ 0 0.617094 0.618755 0.621057 ]
[ 0.628319 0.916981 0.917618 0.921032 ]
[ 1.25664 0.996459 0.996293 1 ]
[ 1.88496 0.836422 0.835902 0.839012 ]
[ 2.51327 0.475338 0.474932 0.476699 ]
[ 3.14159 0 0 0 ]
■ Use of generalized differential operator. Here, the following generalized
differential operator
(28)
or the linearized differential operator as in equation (8-65)
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
13
(29)
is employed to express the eigenvalue problem as
(30)
Meanwhile, the differential operator is thought to be discretized to be
(31)
as was discussed in Chapter 8. Therefore, the eigenvalue problem
(32)
can be discretized as above. At this point, it is observed that the term in the
right-hand side of equation (32) contributes nothing to the discretization of the
differential operator . The eigenvalues are obtained in sequence of smaller
magnitudes by using the inverse power method and eigenvalue shifting.
For example, the Sturm-Liouville equation can be expanded and modified
as
(33)
where the coefficients of the differential operator are defined to be
(34)
★(Example 2) The Bessel equation is
transformed into the Sturm-Liouville problem as below
For the case of and , find the three smallest eigenvalues.
The boundary condition is given as . Use the form for
numerical solution.
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
14
Re-writing the equation in the form with , we have
(35)
By the way, it is actually unnecessary to specify the boundary condition at
due to the nature of singular Sturm-Liouville problem. Indeed, in order
to exploit the compact form, it is required to specify the boundary
condition at . Therefore, an additional condition is imposed
considering the symmetry (in reality, corresponds to the center of the
cylinder). M#math is written as below
#> double eiglam(s) {
Lam = bvp.x[201](0,1) ( {y''} +1/x*{y'}-1/x^2*{y}+{%y} = 0,
[ {y'}=0, {y}=0 ] ) .shift(s);;
return sqrt(Lam);
}
#> eiglam(0); eiglam.Lam = 14.681712 ans = 3.8316723
#> eiglam(50); eiglam.Lam = 49.21481 ans = 7.0153268
#> eiglam(100); eiglam.Lam = 103.48168 ans = 10.172594
then the result is
1
2
3
3.831672
7.015327
10.172594
3.831706
7.015587
10.173468
It can be seen that use of 200 subintervals gives very accurate eigenvalues.
☑ The exact eigenvalues are obtained from the following M#math.
#> solve.x ( .J_1(x) = 0 ).span(0.01,11);
ans =
[ 3.83171 -1.40363e-008 ]
[ 7.01559 4.56504e-009 ]
[ 10.1735 3.24155e-008 ]
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
15
Section 9-3 Eigenvalues on Stability and Convergence Rate
In contrast to the situations where the main objective is to find eigenvalues,
it also happens that eigenvalues are not required to be sought even though they
play an underlying serious effect. This can be illustrated with stiff differential
equations and iteration methods on matrix equations.
■ Eigenvalues associated with initial value problems. It was already
discussed in section 7-8 that the stiffness of the differential equations is
determined from the eigenvalues of the Jacobian matrix given in equation (7-
91). In solving initial value problems, eigenvalues of the Jacobian matrix have
the following nature.
◦ greatest eigenvalue determines step sizes due to stability
◦ smallest eigenvalue determines the number of steps for integration
Therefore, there occurs a severe difficulty if a ratio of the greatest to smallest
eigenvalues differ by several orders of magnitudes. An example is presented
below to discuss this behavior.
(Example 3) When a numerical solution to the following coupled linear
equations is obtained by the Runge-Kutta method with ,
discuss the numerical stability.
First, the coupled linear equations are written in the following matrix form
(36)
and M#math is written as
#> double y1e(x) = 2*exp(-2*x)-exp(-1000*x);
#> double y2e(x) = -exp(-2*x)+exp(-1000*x);
#> matrix odesol(double h) {
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
16
x = (0,h).march(6);
return ode[x] ( y1' = 996*y1+1996*y2, y2' = -998*y1-1998*y2,
y1 = 1, y2 = 0 )
.return( x, y1/y1e(x), y2/y2e(x) );
}
#> odesol(0.01);
ans =
[ 0 1 -1.#IND ]
[ 0.01 343.05 685.116 ]
[ 0.02 -233985 -467970 ]
[ 0.03 1.60066e+008 3.20132e+008 ]
[ 0.04 -1.09499e+011 -2.18997e+011 ]
[ 0.05 7.49062e+013 1.49812e+014 ]
#> odesol(0.05);
ans =
[ 0 1 -1.#IND ]
[ 0.005 9.28357 17.6239 ]
[ 0.01 -135.193 -271.393 ]
[ 0.015 2248.68 4496.36 ]
[ 0.02 -37094.6 -74190.3 ]
[ 0.025 612226 1.22445e+006 ]
#> odesol(0.001);
ans =
[ 0 1 -1.#IND ]
[ 0.001 1.00153 1.00396 ]
[ 0.002 1.00099 1.00213 ]
[ 0.003 1.00052 1.00107 ]
[ 0.004 1.00025 1.00051 ]
[ 0.005 1.00011 1.00023 ]
From the above results, it can be seen that solutions with
diverge, whereas a considerably accurate solution is obtained with the smallest
step size of . The reason why these results are appearing is that the
eigenvalues associated with the corresponding matrix
(37)
differ in two orders of magnitude, i.e. .
The greatest eigenvalue limits the step size through the
Euler's stability condition
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
17
(38)
The convergence of numerical solutions depends on whether the stability
condition is satisfied or not.
☑ The exact solution to (Example 3) is given below.
A proper use of M#math is utilizing Spoke '.stiff(tol=0.01)'
#> ode.x[1000](0,1) ( y1' = 996*y1+1996*y2, y2' = -998*y1-1998*y2,
y1=1, y2=0 ) .stiff .return(x,y1,y2).skip(10).plot;
■ Eigenvalues occurring in iteration methods. When the Gauss-Seidel
iteration method is used to solve coupled linear equations, the diagonal
dominance should be determined a priori as was discussed in section 3-6. The
convergence characteristics of iteration methods is greatly affected by
distribution of the eigenvalues of associated matrix.
(Example 4) Solve the following coupled linear equation by the
Gauss-Seidel iteration method until the error falls below .
The diagonal elements of the given matrix are greater than the off-diagonal
elements, and therefore the diagonal dominance is satisfied. This implies that
solution can be obtained by iteration. To apply the Gauss-Seidel iteration
method, the given equations are modified as
(39)
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
18
By initializing and performing the first iteration, we have
(40)
Subsequent iterations can be performed by using the following M#math
#> (a,b,c,d) = (3.2,3,5,5.2);; (x,y) = (0,0);; a=3.2;
#> for.i(1,1000) {
r1 = 7-b*y;; // a*x + b*y = 7
r2 = -2-c*x;; // c*x + d*y = -2
x = r1/a;;
y = r2/d;;
err = |7-a*x-b*y|+|-2-c*x-d*y| ;;
[ i, x, y, err ];
if( err < 1.e-7) break; // 354 iterations are required
}
ans = [ 1 2.1875 -0.384615 12.0913 ]
ans = [ 2 2.54808 -2.48798 8.11298 ]
ans = [ 3 4.51998 -2.83469 10.8997 ]
...
ans = [ 353 25.8537 -25.2439 1.41759e-007 ]
ans = [ 354 25.8537 -25.2439 9.51168e-008 ]
Then, a final solution can be obtained by a total of 354 iterations. Even though
the given matrix is just a simple matrix, it requires more than 300
iterations, the reason of which stems from the underlying effect of the
eigenvalue of the given matrix. This will be discussed in detail below.
■ Role of eigenvalues in iteration methods. In order to examine the
iteration method from the standpoint of eigenvalues, matrices , are
introduced as
(41)
then, the iteration given in equation (39) can be written as
(42)
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
19
where is given as an initial guess at the start of iteration. Meanwhile, the
error at the th iteration
(43)
is defined, and equation (42) is recast into
(44)
or
(45)
By utilizing the above expression, the error at the th iteration becomes
(46)
or
(47)
If the matrix is selected to be , then . This means that the
solution is obtained by the direct method since iteration is not required.
Otherwise the error at the -th itration is calculated recursively from equation
(47) such that
(48)
where the matrix is a key factor determining the convergence rate.
In the case of (Example 4), the matrix is
(49)
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
20
the eigenvalues of which are and their
absolute values are very close to the unity (see the note in ☑).
If the absolute value of eigenvalues of matrix exceeds the unity, the
error diverges as iterations continue. In other words, by letting
be the absolute eigenvalue close to the unity, the magnitude of error
diminishes as
(50)
Therefore, convergence is very slow when , whereas convergence is
considerably accelerated when . For example, for the following case
(51)
the matrix is calculated to be
(52)
the eigenvalues of which are . As a result, the error diminishes rapidly
as iterations continue. Actual computation shows that
iter x y residue
1
2
3
4
5
6
7
8
0.233333
0.237333
0.239667
0.239707
0.239730
0.239730
0.239731
0.239731
-0.040000
-0.063333
-0.064733
-0.063967
-0.063971
-0.063973
-0.063973
-0.063973
1.286667
0.090000
0.012867
0.000900
0.000129
0.000009
0.000001
0.000000
where the rate of residue decreasing is about a factor multiplied by ,
i.e. a decreasing rate of one-tenth per iteration is found.
☑ M#math for equation (52)
#> I = .I(2); A = [ 30,3; 5,50 ]; B = [ 30; 0,50 ];
#> (I-A*B.inv).eig;
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
21
ans =
[ 0.1 ]
[ -0.1 ]
Section 9-4 Exercises ===========================
【1】For an interval of , the Sturm-Liouville problem is given as
. Find the fundamental eigenvalue for the following
homeogenous boundary conditions.
(a)
(b)
(c)
【2】For an interval of , the Sturm-Liouville equation known as the
Bessel function is given as
Find the fundamental eigenvalue for the following boundary conditions
(a)
(b)
(c)
【3】When an axial load of is applied, the curvature of the slender rod can
be determined from
where . The final result becomes an eigenvalue problem written as
For the two cases shown in the accompanying figure, find the axial road
where values are given as .
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
22
【4】An axisymmetric vibration of a circular membrane is governed by the
following differential equation
For the case of , find the fundamental eigenvalue.
【5】The most well-known Sturm-Liouville problems are as follows
(a) Bessel equation
(b) Legendre equation
(c) Tchebyshev equation
(d) Hermite equation
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
23
(e) Laguerre equation
//----------------------------------------------------------------------
// end of Lectures
//----------------------------------------------------------------------
Section 9-5 Higher-order ODE and Eigenvalue Problems
(optional)
Eigenvalue problems associated with higher-order ODEs can be
solved in a similar way. In this section, eigenvalue related to the bending and
vibration of a beam is considered which is characterized by the fourth-order
ODEs.
■ Bending of a beam . When a distributed load is applied on a beam,
the vertical displacement of the beam is governed by the following fourth-order
differential equation
(53)
where is the modulus of elasticity, is the moment of inertia of the cross
section. Especially, the product of is termed the flexural rigidity. The
boundary conditions for the beam shown in Figure 9-4 are
(54)
(55)
By converting the ODE in equation (53) into the form , we have
(56)
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
24
where in general.
Figure 9-4 Bending of a beam with a fixed end
☑ However, the boundary condition at takes a different form other than
equation (55), depending on the state in which the right end of the beam is
located.
(Example 5) Find the displacement of a beam when a distributed load
is applied to the beam. Here, boundary conditions are given
as , and ,
(units are omitted for convenience). Find a numerical solution with 100
subintervals.
Since is a constant, solution can be found easily by using equation (53)
with the following program
#> double ye(x) {
L = 8;
Lpi = L/pi;
kEI = 0.001;
a2 = 0.5*L/pi^3;
return kEI*( Lpi^3*(Lpi*sin(x/Lpi)-x) + a2*x^2*(3*L-x) );
}
#> kEI = 0.001; L = 8;
#> bvp.x(0,L) ( {y''''}-kEI*sin(pi*x/L) = 0,
[ {y}=0, {y'}=0, {y}=0, {y''}=0 ] )
.return( x, ye(x), y/ye(x) ) .rowskip(-10);
A use of 100 subintervals produces a fairly exact solution as below.
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
25
kEI = 0.001
L = 8
ans =
[ 0 0 1.#INF ]
[ 0.8 0.00169925 0.999101 ]
[ 1.6 0.00569333 0.999442 ]
[ 2.4 0.0104385 0.999555 ]
[ 3.2 0.0146278 0.999611 ]
[ 4 0.0172803 0.999643 ]
[ 4.8 0.0177982 0.999663 ]
[ 5.6 0.0159868 0.999675 ]
[ 6.4 0.0120342 0.999684 ]
[ 7.2 0.00645494 0.999691 ]
[ 8 0 1.#INF ]
☑ The exact solution is given as
■ Vibration of beam. Now, the dynamic behavior related to the vibration of
a beam is expressed by the following partial differential equation
(57)
where is the distributed load on the beam, is the mass per length.
Consider the case where the displacement is given as
(58)
from which equation (57) becomes ( )
(59)
If were constants, the exact solution to the above equation can be found
to be
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
26
(60)
from the boundary conditions [equations (54) and (55)].
(Example 6) For the case of , find the smallest three
eigenvalues for the eigenvalue problem given in equation (59). Numerical
solutions should be obtained with from 10 to 100 subintervals by adding 10
subintervals after each run. Find the effect of grid density on the eigenvalue
obtained numerically.
Exact solutions are found to be , and
(see the note ☑ below). Since is a constant, the form
of differential operator is very simple. M#math is written as
#> L = 8; EIm = 1000; s = 0; // change s for other eigenvalues
#> row = [];
#> for.nx(10,100, 10) {
Lam = bvp.x[nx+1](0,L) ( -EIm*{f''''}+{%f} = 0,
[ {f} = 0, {f'} = 0, {f''}=0, {f'''}=0 ] ).shift(s);
row _= [ nx, sqrt(Lam)];; // vertical concatenation
}
#> row;
row =
[ 10 1.75116 ]
[ 20 1.74066 ]
[ 30 1.73877 ]
[ 40 1.73812 ]
[ 50 1.73782 ]
[ 60 1.73765 ]
[ 70 1.73755 ]
[ 80 1.73749 ]
[ 90 1.73745 ]
[ 100 1.73742 ]
Comparing with the exact solution , the result corresponding to
100 subintervals gives a consistency up to 4 significant digits. Finding other
eigenvalues can be carried out by changing the shifintg value in the above
M#math code.
[101] 009 Numerical Analysis Using M#math, www.msharpmath.com
27
//----------------------------------------------------------------------
// end of file
//----------------------------------------------------------------------