
Spline Collocation Methods for Partial Differential Equations
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Other editions
Additional editions


Person
Content
Preface xiii
About the CompanionWebsite xv
1 Introduction 1
1.1 Uniform Grids 2
1.2 Variable Grids 18
1.3 Stagewise Differentiation 24
Appendix A1 - Online Documentation for splinefun 27
Reference 30
2 One-Dimensional PDEs 31
2.1 Constant Coefficient 31
2.1.1 Dirichlet BCs 32
2.1.1.1 Main Program 33
2.1.1.2 ODE Routine 40
2.1.2 Neumann BCs 43
2.1.2.1 Main Program 44
2.1.2.2 ODE Routine 46
2.1.3 Robin BCs 49
2.1.3.1 Main Program 50
2.1.3.2 ODE Routine 55
2.1.4 Nonlinear BCs 60
2.1.4.1 Main Program 61
2.1.4.2 ODE Routine 63
2.2 Variable Coefficient 64
2.2.1 Main Program 67
2.2.2 ODE Routine 71
2.3 Inhomogeneous, Simultaneous, Nonlinear 76
2.3.1 Main Program 78
2.3.2 ODE routine 85
2.3.3 Subordinate Routines 88
2.4 First Order in Space and Time 94
2.4.1 Main Program 96
2.4.2 ODE Routine 101
2.4.3 Subordinate Routines 105
2.5 Second Order in Time 107
2.5.1 Main Program 109
2.5.2 ODE Routine 114
2.5.3 Subordinate Routine 117
2.6 Fourth Order in Space 120
2.6.1 First Order in Time 120
2.6.1.1 Main Program 121
2.6.1.2 ODE Routine 125
2.6.2 Second Order in Time 138
2.6.2.1 Main Program 140
2.6.2.2 ODE Routine 143
References 155
3 Multidimensional PDEs 157
3.1 2D in Space 157
3.1.1 Main Program 158
3.1.2 ODE Routine 163
3.2 3D in Space 170
3.2.1 Main Program, Case 1 170
3.2.2 ODE Routine 174
3.2.3 Main Program, Case 2 183
3.2.4 ODE Routine 187
3.3 Summary and Conclusions 193
4 Navier-Stokes, Burgers' Equations 197
4.1 PDE Model 197
4.2 Main Program 198
4.3 ODE Routine 203
4.4 Subordinate Routine 205
4.5 Model Output 206
4.6 Summary and Conclusions 208
Reference 209
5 Korteweg-de Vries Equation 211
5.1 PDE Model 211
5.2 Main Program 212
5.3 ODE Routine 225
Contents ix
5.4 Subordinate Routines 228
5.5 Model Output 234
5.6 Summary and Conclusions 238
References 239
6 Maxwell Equations 241
6.1 PDE Model 241
6.2 Main Program 243
6.3 ODE Routine 248
6.4 Model Output 252
6.5 Summary and Conclusions 252
Appendix A6.1. Derivation of the Analytical Solution 257
Reference 259
7 Poisson-Nernst-Planck Equations 261
7.1 PDE Model 261
7.2 Main Program 265
7.3 ODE Routine 271
7.4 Model Output 276
7.5 Summary and Conclusions 284
References 286
8 Fokker-Planck Equation 287
8.1 PDE Model 287
8.2 Main Program 288
8.3 ODE Routine 293
8.4 Model Output 295
8.5 Summary and Conclusions 301
References 303
9 Fisher-Kolmogorov Equation 305
9.1 PDE Model 305
9.2 Main Program 306
9.3 ODE Routine 311
9.4 Subordinate Routine 313
9.5 Model Output 314
9.6 Summary and Conclusions 316
Reference 316
10 Klein-Gordon Equation 317
10.1 PDE Model, Linear Case 317
10.2 Main Program 318
10.3 ODE Routine 323
10.4 Model Output 326
10.5 PDE Model, Nonlinear Case 328
10.6 Main Program 330
10.7 ODE Routine 335
10.8 Subordinate Routines 338
10.9 Model Output 339
10.10 Summary and Conclusions 342
Reference 342
11 Boussinesq Equation 343
11.1 PDE Model 343
11.2 Main Program 344
11.3 ODE Routine 350
11.4 Subordinate Routines 354
11.5 Model Output 355
11.6 Summary and Conclusions 358
References 358
12 Cahn-Hilliard Equation 359
12.1 PDE Model 359
12.2 Main Program 360
12.3 ODE Routine 366
12.4 Model Output 369
12.5 Summary and Conclusions 379
References 379
13 Camassa-Holm Equation 381
13.1 PDE Model 381
13.2 Main Program 382
13.3 ODE Routine 388
13.4 Model Output 391
13.5 Summary and Conclusions 394
13.6 Appendix A13.1: Second Example of a PDE with a Mixed Partial Derivative 395
13.7 Main Program 395
13.8 ODE Routine 398
13.9 Model Output 400
Reference 403
14 Burgers-Huxley Equation 405
14.1 PDE Model 405
14.2 Main Program 406
14.3 ODE Routine 411
14.4 Subordinate Routine 416
14.5 Model Output 417
14.6 Summary and Conclusions 422
References 422
15 Gierer-Meinhardt Equations 423
15.1 PDE Model 423
15.2 Main Program 424
15.3 ODE Routine 429
15.4 Model Output 432
15.5 Summary and Conclusions 437
Reference 440
16 Keller-Segel Equations 441
16.1 PDE Model 441
16.2 Main Program 443
16.3 ODE Routine 449
16.4 Subordinate Routines 453
16.5 Model Output 453
16.6 Summary and Conclusions 458
Appendix A16.1. Diffusion Models 458
References 459
17 Fitzhugh-Nagumo Equations 461
17.1 PDE Model 461
17.2 Main Program 462
17.3 ODE Routine 467
17.4 Model Output 470
17.5 Summary and Conclusions 475
Reference 475
18 Euler-Poisson-Darboux Equation 477
18.1 PDE Model 477
18.2 Main Program 478
18.3 ODE Routine 483
18.4 Model Output 488
18.5 Summary and Conclusions 493
References 493
19 Kuramoto-Sivashinsky Equation 495
19.1 PDE Model 495
19.2 Main Program 496
19.3 ODE Routine 503
19.4 Subordinate Routines 506
19.5 Model Output 508
19.6 Summary and Conclusions 513
References 514
20 Einstein-Maxwell Equations 515
20.1 PDE Model 515
20.2 Main Program 516
20.3 ODE Routine 521
20.4 Model Output 526
20.5 Summary and Conclusions 533
Reference 536
A Differential Operators in Three Orthogonal Coordinate Systems 537
References 539
Index 541
Chapter 1
Introduction
The principal objective of this book is to present the method of lines (MOL) numerical integration of partial differential equations (PDEs), with spline collocation (SC) approximation of the PDE boundary-value derivatives. This approach is therefore termed spline collocation method of lines (SCMOL).
The details of SCMOL computer implementation are presented in terms of a series of applications, first for one-dimensional (1D) PDEs, then for two-dimensional (2D) PDEs, and finally for a series of legacy PDEs to illustrate the broad applicability of SCMOL. The approach is not with formal mathematics, for example, theorems and proofs, but rather, by examples of SCMOL discussed in detail, including routines in R.1
In this introduction, some basic properties of splines are reviewed, including example applications of the utilities (functions) for splines in R. The R spline utilities are then applied to PDEs in the following chapters within the SCMOL setting.
Splines are polynomials that can be used for the functional approximation of a set of numerical pairs
Table 1.1 Data pairs for spline interpolation
A cubic spline is of the form
1.1aThe coefficients are evaluated to (i) return the original data of Table 1.1 and (ii) provide continuity in the computed first and second derivatives of at . The sequence in does not have to be uniformly spaced, which is a particularly useful feature in the SCMOL solution of PDEs, that is, the points can be placed as required to achieve good resolution in .
can be differentiated to give the first and second derivatives
1.1b 1.1c 1.1dThe derivatives of Eqs. (1.1a)-(1.1d) can then be used to approximate first, second, and third derivatives in PDEs.
All of the operations reflected in Eqs. (1.1) are implemented in the R function splinefun,2 which returns the coefficients for a set of data as listed in Table 1.1. are computed by the solution of a tridiagonal algebraic system of equations. This set of coefficients therefore requires the specification of two additional conditions.3
A variety of additional conditions can be specified. For example, if the two second derivatives at the end points of the data set are set to zero, so-called natural cubic splines result. The details of the splines resulting from various sets of two additional conditions as implemented in splinefun are given in Appendix A1 and in [1].
The use of splinefun is illustrated with a series of examples that follows.
1.1 Uniform Grids
Application of splinefun to the function is illustrated with the following code:
# # Previous workspaces are cleared rm(list=ls(all=TRUE)) # # Define uniform grid xl=0;xu=1;n=11; x=seq(from=xl,to=xu,by=(xu-xl)/(n-1)); # # Define function to be approximated u=sin(pi*x); # # Set up spline table utable=splinefun(x,u); # # Compute spline approximation us=utable(x); # # Display comparison of function and its spline # approximation cat(sprintf("\n x u us diff")); for(i in 1:n){ cat(sprintf("\n%5.2f%10.5f%10.5f%12.7f", x[i],u[i],us[i],us[i]-u[i])); } Listing 1.1 Spline approximation of .
We can note the following details about this listing:
- Previous workspaces are cleared to avoid the unintended use of out-of-date files.
# # Previous workspaces are cleared rm(list=ls(all=TRUE)) - A uniform grid is defined with 11 points, so that .
# # Define uniform grid xl=0;xu=1;n=11; x=seq(from=xl,to=xu,by=(xu-xl)/(n-1));Thesequtility is used for this purpose. - The function is defined on the grid in .
# # Define function to be approximated u=sin(pi*x);This definition ofu4 illustrates the vectorization available in R, that is,uis an -vector since is an -vector. Also, the functionsincan operate on a vector to produce a vector. splinefunis used to define a table of spline coefficients, for example, in Eq. (1.1a).# # Set up spline table utable=splinefun(x,u);splinefunis part of the basic R and does not have to be accessed from an external library. Here the default splinemmfis used in which an exact cubic polynomial is fitted to the four points at each end of the data of Table 1.1 [1], p. 73.- The table
utableis used to compute spline approximations to at the values of inx.# # Compute spline approximation us=utable(x);Other values of within the intervalxltoxucould be used for interpolation between the grid points. - The values of
u, their spline approximationsus, and the difference between the two are displayed.# # Display comparison of function and its spline # approximation cat(sprintf("\n x u us diff")); for(i in 1:n){ cat(sprintf("\n%5.2f%10.5f%10.5f%12.7f", x[i],u[i],us[i],us[i]-u[i])); }The use of the combinationcat(sprintf())provides detailed formatting of the output.
Execution of the code in Listing 1.1 gives the following output:
Table 1.2 Output from Listing 1.1
x u us diff 0.00 0.00000 0.00000 0.0000000 0.10 0.30902 0.30902 0.0000000 0.20 0.58779 0.58779 0.0000000 0.30 0.80902 0.80902 0.0000000 0.40 0.95106 0.95106 0.0000000 0.50 1.00000 1.00000 0.0000000 0.60 0.95106 0.95106 0.0000000 0.70 0.80902 0.80902 0.0000000 0.80 0.58779 0.58779 0.0000000 0.90 0.30902 0.30902 0.0000000 1.00 0.00000 0.00000 0.0000000 This output demonstrates that the spline in splinefun returns the original data (an important feature of splines in general).
Equations (1.1a)-(1.1d) can also give numerical approximations to the first to third derivatives, as demonstrated by the following routine:
# # Previous workspaces are cleared rm(list=ls(all=TRUE)) # # Define uniform grid xl=0;xu=1;n=11; x=seq(from=xl,to=xu,by=(xu-xl)/(n-1)); # # Define function to be approximated, and its # derivatives u=sin(pi*x); ux=pi*cos(pi*x); uxx=-pi^2*sin(pi*x); uxxx=-pi^3*cos(pi*x); # # Set up spline table for function, derivatives utable=splinefun(x,u); # # Compute spline approximation of function # derivatives us=utable(x); usx=utable(x,deriv=1); usxx=utable(x,deriv=2); usxxx=utable(x,deriv=3); # # Display comparison of function and its spline # approximation, and its derivatives # # u cat(sprintf("\n x u us diff")); for(i in 1:n){ cat(sprintf("\n%5.2f%10.5f%10.5f%12.7f", x[i],u[i],us[i],us[i]-u[i])); } # # ux cat(sprintf("\n x ux usx diff")); for(i in 1:n){ cat(sprintf("\n%5.2f%10.5f%10.5f%12.7f", x[i],ux[i],usx[i],usx[i]-ux[i])); } # # uxx cat(sprintf("\n x uxx usxx diff")); for(i in 1:n){ cat(sprintf("\n%5.2f%10.5f%10.5f%12.7f", x[i],uxx[i],usxx[i],usxx[i]-uxx[i])); } # # uxxx cat(sprintf("\n x uxxx usxxx diff")); for(i in 1:n){ cat(sprintf("\n%5.2f%10.5f%10.5f%12.7f", x[i],uxxx[i],usxxx[i],usxxx[i]-uxxx[i])); } Listing 1.2 Spline approximation of and the first to third derivatives.
We can note the following details about Listing 1.2:
- Previous workspaces are cleared and the same uniform grid in as in Listing 1.1 is defined.
- The function and its first three derivatives are computed. Again,
u, ux, uxx, uxxxare -vectors.# # Define function to be approximated, and its # derivatives u=sin(pi*x); ux=pi*cos(pi*x); uxx=-pi^2*sin(pi*x); uxxx=-pi^3*cos(pi*x);The derivatives are used to evaluate the numerical approximations fromsplinefun. - The table of spline coefficients is defined as in Listing 1.1.
# # Set up spline table for function, derivatives utable=splinefun(x,u); - The function
usand its first three derivatives are computed fromutable.# # Compute spline approximation of function # derivatives us=utable(x); usx=utable(x,deriv=1); usxx=utable(x,deriv=2); usxxx=utable(x,deriv=3);us, usx, usxx, usxxxare -vectors. The argumentderivspecifies the order of the derivative to be computed. - The exact values of and the numerical approximations are compared and displayed.
# # Display comparison of function and its spline # approximation, and its derivatives # # u cat(sprintf("\n x u us diff")); for(i in 1:n){ cat(sprintf("\n%5.2f%10.5f%10.5f%12.7f", x[i],u[i],us[i],us[i]-u[i])); } # # ux cat(sprintf("\n x ux usx diff")); for(i in 1:n){ ...
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.