UNLV Theses, Dissertations, Professional Papers, and Capstones December 2015 Solving differential equations with least square and collocation Solving differential equations with least square and collocation methods methods Katayoun Bodouhi Kazemi University of Nevada, Las Vegas Follow this and additional works at: https://digitalscholarship.unlv.edu/thesesdissertations Part of the Mathematics Commons Repository Citation Repository Citation Kazemi, Katayoun Bodouhi, "Solving differential equations with least square and collocation methods" (2015). UNLV Theses, Dissertations, Professional Papers, and Capstones. 2548. http://dx.doi.org/10.34917/8220120 This Thesis is protected by copyright and/or related rights. It has been brought to you by Digital Scholarship@UNLV with permission from the rights-holder(s). You are free to use this Thesis in any way that is permitted by the copyright and related rights legislation that applies to your use. For other uses you need to obtain permission from the rights-holder(s) directly, unless additional rights are indicated by a Creative Commons license in the record and/ or on the work itself. This Thesis has been accepted for inclusion in UNLV Theses, Dissertations, Professional Papers, and Capstones by an authorized administrator of Digital Scholarship@UNLV. For more information, please contact [email protected].
66
Embed
Solving differential equations with least square and ...
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
UNLV Theses, Dissertations, Professional Papers, and Capstones
December 2015
Solving differential equations with least square and collocation Solving differential equations with least square and collocation
methods methods
Katayoun Bodouhi Kazemi University of Nevada, Las Vegas
Follow this and additional works at: https://digitalscholarship.unlv.edu/thesesdissertations
Part of the Mathematics Commons
Repository Citation Repository Citation Kazemi, Katayoun Bodouhi, "Solving differential equations with least square and collocation methods" (2015). UNLV Theses, Dissertations, Professional Papers, and Capstones. 2548. http://dx.doi.org/10.34917/8220120
This Thesis is protected by copyright and/or related rights. It has been brought to you by Digital Scholarship@UNLV with permission from the rights-holder(s). You are free to use this Thesis in any way that is permitted by the copyright and related rights legislation that applies to your use. For other uses you need to obtain permission from the rights-holder(s) directly, unless additional rights are indicated by a Creative Commons license in the record and/or on the work itself. This Thesis has been accepted for inclusion in UNLV Theses, Dissertations, Professional Papers, and Capstones by an authorized administrator of Digital Scholarship@UNLV. For more information, please contact [email protected].
3.1 Figure for the system . . . . . . . . . . . . . . . . . . . . . . . . . . . 333.2 x approximate vs t and error for mass spring sysytem . . . . . . . . . 343.3 Initial position of the bird on the wire . . . . . . . . . . . . . . . . . 363.4 Approximate and exact concentration distribution of medicine and er-
4.8 Error of an example of Poisson’s equation with Neumann boundarycondition with IMQ RBF (c = 3) (using 100 Halton collocation points) 49
4.9 Error of an example of Poisson’s equation with Neumann boundarycondition with IMQ RBF (c = 10) (using 100 Halton collocation points) 49
4.10 Error of an example of Elliptic equation with variable coefficient withIMQ RBF (c = 3) (using 100 uniform collocation points) . . . . . . . 51
4.11 Error of an example of PDE with mixed boundary conditions by IMQRBF (c = 3) (using 100 uniform collocation points) . . . . . . . . . . 52
LIST OF TABLES
2.1 Data for the example of second order ODE when k=1 . . . . . . . . . 212.2 Results for example 1, when k=0 . . . . . . . . . . . . . . . . . . . . 232.3 Results for example 1, when k=1 . . . . . . . . . . . . . . . . . . . . 262.4 Results for solving the example of PDE by B-spline functions . . . . . 31
3.1 The solution and the error for wave modeling . . . . . . . . . . . . . 36
vii
ACKNOWLEDGEMENTS
I would like to thank Dr. Xin Li, for all his advice and help through out working on
this project. I extend my gratitude to Dr. Dalpatadu, Dr. Ding and Dr. Hattchet
for accepting to be in my committee and reviewing my work. My special thank
to my mom, my husband and my brother for their continuous support and help.
Finishing up my course work and working on this thesis were impossible without
their encouragements and supports. I dedicate this work to my late father, my mom,
my husband and my two little angels, Lilia and Alyssa.
viii
CHAPTER 1 - INTRODUCTION TO LEAST SQUARE
METHODS
Least Square Methods (LSM) have been used to solve differential equations in Finite
Element Methods (FEM). For description, we consider the following linear boundary
value problem [1]
L(y) = f(x) for x ∈ domain Ω,
W (y) = g(x) for x ∈ boundary ∂Ω,
where Ω is a domain in R1 or R2 or R3, L is differential operator, and W is the
boundary operator. When solving a differential equation by Finite Element Methods
(FEM), the solution is given by a sum of weighted basis functions. Using φi(x),
1 ≤ i ≤ N , for basis functions, an approximate solution is expressed as
y =N∑i=1
qiφi(x), (1.1)
where qi’s are coefficients (weights) and they can be determined by least square meth-
ods, explained below. To be precise, define the residual RL(x), RW (x) as follows
1
RL(x, y) = L(y)− f(x) for x ∈ domain Ω,
RW (x, y) = W (y)− g(x) for x ∈ boundary ∂Ω.
Use yexact for exact solution of the boundary value problem. Then, it is obvious that
RL(x, yexact) = 0 and RW (x, yexact) = 0.
In using LSM, the goal is to find the coefficients qi’s by minimizing the error function
in L2 norm, defined by
E =
∫Ω
R2L(x, y)dx +
∫∂Ω
R2W (x, y)dx.
The best approximate solution is determined by finding the minimal value of E, or
∂E
∂qi= 0, for i = 1, .., N,
which yields
∫Ω
RL(x, y)∂RL
∂qidx +
∫∂Ω
RW (x, y)∂RW
∂qidx = 0, i = 1, .., N.
The above formulation is in continuous format and the squared residuals are inte-
grated over the domain. This will give N linear equations and by some algebraic
manipulation can be written as:
Da = b,
2
where D is an N ×N matrix, a = [q1, q2, ..., qN ]T , and some column vector b.
The following format is the discrete formulation and the squared residuals are summed
at finite points xi, 1 ≤ i ≤ k, in domain, and xi, k + 1 ≤ i ≤ m, on the boundary
points. Define
E =k∑i=1
R2L(xi, y) +
m∑i=k+1
R2W (xi, y).
Write
r =
RL(a,x1)
.
.
RL(a,xk)
RW (a,xk+1)
.
.
RW (a,xm)
=
Ly(a,x1)− f(x1)
.
.
Ly(a,xk)− f(xk)
Ly(a,xk+1)− f(xk+1)
.
.
Ly(a,xm)− f(xm)
.
The discrete least square solution, which minimizes E = rT r, is then determined by
∂E
∂qi= 0, for i = 1, .., N.
Choosing the right basis function φi is very important in LSM. In linear ODE we
usually use polynomials. In the next section, polynomials with different degrees are
used and compared to solve some first order ODE and second order ODEs in both
3
continuous and discrete formats.
1.1. Example of using LSM to solve a first-order ODE
1.1.1. Continuous Least Square Method
First, we want to solve an example of a first order ordinary differential equation
as an illustration to present least squares methods. Assume that we have the following
initial value problem of the first order ODE:
dy
dx− y = 0, y(0) = 1,
where 0 ≤ x ≤ 1.
Let
L(x, y) =dy
dx− y
Step 1: Choose basis functions. Here we use polynomials. So,
y =N∑i=1
qixi + y0. (1.2)
Step 2: For y to satisfy the boundary condition, clearly we must have y0 = 1.
Step 3: From the residual
R(x) =dy
dx− y. (1.3)
4
By replacing y(x) from (1.2) into (1.3), we will get:
R(x) =d(∑N
i=1 qixi + 1)
dx− (
N∑i=1
qixi + 1).
Step 4: To minimize the square error, we need to set up
E =
∫ 1
0
R2(x)dx.
The best approximate solution is determined by finding the minimal value of E, or
∂E
∂qi= 0, for i = 1, .., N
∫ 1
0
R(x)∂R
∂qidx = 0, i = 1, .., N
or
(R(x),
∂R(x)
∂qi
)= 0 for i = 1, 2, 3, ........, N
These lead to a linear system which can be solved for qi’s.
The above equations were solved by a Matlab program. The following results were
obtained by running the code for different N ’s.
5
When N=3, we get the following matrices
D =
0.33 0.25 0.2
0.25 0.533 0.66
0.2 0.66 0.94
, b =
−0.5
−0.66
−0.75
, a =
q1
q2
q3
,
and the approximate solution is
y = 0.2797x3 + 0.4255x2 + 1.0131x+ 1.
Results are shown in the figure 1.1.
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 11
1.5
2
2.5
3
x
y
x vs y approximate and y exact when N=3
y approximate
y exact
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1−1
−0.5
0
0.5
1x 10
−3
x
Err
or
x vs error
Figure 1.1: Exact solution, approximate solution, and the error for first order ODEexample when N=3
The above example was solved by Kansa collocation method. We choose IMQ RBF
and c = 3. 100 uniform collocation points were used (Figure 4.10).
50
Figure 4.10: Error of an example of Elliptic equation with variable coefficient withIMQ RBF (c = 3) (using 100 uniform collocation points)
Example 4: Solving a PDE with mixed boundary condition:
Consider
∇2u+ u = (2 + 3x)ex−y, (x, y) ∈ [0, 1]× [0, 1]
with the following mixed boundary conditions
u(0, y) = 0, u(x, 0) = xex,
∂u
∂x
∣∣∣∣x=1
= 2e1−y,∂u
∂y
∣∣∣∣y=1
= −xex−1.
The exact solution of this problem is [14]
u(x, y) = xex−y.
51
The problem was solved by using 100 Uniform collocation points by IMQ RBF (c = 3).
The result is followed (Figure 4.11).
Figure 4.11: Error of an example of PDE with mixed boundary conditions by IMQRBF (c = 3) (using 100 uniform collocation points)
4.4. Conclusion
Least square Method for Boundary Value Problems using B-splines discussed in
chapter 2, is an improved form of using B-spline basis functions [3]. Numerical Anal-
ysis contains little literature on higher order BVPs. In the papers by Loghmani all
the examples are higher order ODEs, but he suggested that the method works for
any linear and non-linear PDEs and system of elliptic PDEs. We used the method
for Poisson’s equation and the error was acceptable. As it can be seen in the ex-
amples, the accuracy of the method is efficient even with large partitioning of the
52
domain (k = 0 and k = 1). The Matlab program can take longer time to run for
solving PDEs. As we discussed earlier, meshfree methods introduced by Kansa at-
tract attention. In most popular finite element method, creating mesh was one of the
disadvantages. Creating mesh can be time consuming and costly especially for higher
dimensional and irregular shaped domains. Kansa Method is rather simple to use. He
suggests changing the shape parameter c to improve accuracy. The problem for this
method is that for a constant shape parameter c, the matrix A may become singular
for certain sets of centers xi. However, there is an approach that gives us strategies
to select a set of centers from possible points that ensure the non-singularity of the
collocation matrix [Ling et al. (2006)]. Kansa’s method has been extended by several
researchers to solve non-linear PDEs, systems of elliptic PDEs and time-dependent
parabolic and hyperbolic PDEs. Different methods have been suggested to improve
stability and it is an active research area.
53
REFERENCES
[1] Eason, Ernest D. A review of least square methods for solving partial differentialequations. International Journal for Numerical Methods In Engineering, Vol. 10,1021-1046 (1976)
[3] Loghmani, M. AHMADINIA, Numerical solution of third-order boundary valueproblems. Iranian Journal of Science & Technology, Transaction A, Vol. 30, No.A3 (2006) 291−295
[4] Loghmani G.B, Application of least square method to arbitrary-order problemswith separated boundary conditions. Journal of Computational and AppliedMathematics 222 (2008) 500−510
[5] Yahya Qaid, Hasan.The numerical solution of third-order boundary value prob-lems by the modified decomposition method. Advances in Intelligent Transporta-tion Systems (AITS), Vol. 1, No. 3, 2012.
[6] Viswanadham, Kasi and Showri Raju. B-spline Collocation Method For SixthOrder Boundary Value Problems. Global Journal of researches in engineeringNumerical, Volume 12 Issue 1 Version 1.0 March 2012 Type: Double Blind PeerReviewed International Research Journal Publisher: Global Journals Inc. (USA)ISSN: 0975-5861
[7] G.B. Loghmani a,*, M. Ahmadinia. Numerical solution of sixth order boundaryvalue problems. Applied Mathematics and Computation 186 (2007) 992999
[8] Tai-Ran Hsu. Application of Second Order Differential Equations in MechanicalEngineering Analysis.http://www.engr.sjsu.edu/trhsu/Chapter%204%20Second%20order%20DEs.pdf
[9] Diffusion of point source and biological dispersal.www.resnet.wm.edu/ jxshix/math490/lecture-chap3.pdf