Abstract
In this chapter, finite difference (FD) approximations and the method of lines, which combine FD with available time integrators, are discussed. First, a convection diffusion-reaction PDE is used to introduce a few basic FD schemes and addresses the concept of stability of the numerical scheme. As a rule of thumb, centered FD schemes appear as good choices for approximating second-order (diffusion) operators, whereas upwind FD schemes are preferable to first-order (convection) operators. Once stability is ensured, accuracy can be adjusted by selecting appropriately the fineness of the spatial grid and the order of the FD approximation (i.e. the stencil of points on which the FD approximation is built). The calculation of FD approximation can be conveniently organized using differentiation matrices, which are easy to manipulate in MATLAB, SCILAB, or OCTAVE. FD can also be efficiently computed on arbitrarily spaced grids using an algorithm due to Fornberg. This chapter continues with a presentation of different methods to take the boundary conditions into account. Boundary conditions are an essential part of the IBVP definition, and several methods for translating the BCs in the code implementation are presented. Finally, attention is paid to the computation of the Jacobian matrix of the ODE system, which is used by various solvers.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Schiesser WE (1991) The numerical method of lines. Academic Press, San Diego
Owens DH (1981) Multivariable and optimal systems. Academic Press, London
Varga RS (1981) Matrix iterative analysis. Prentice-Hall, New York
Glansdorff P, Prigogine I (1971) Thermodynamic theory of structure, stability and fluctuations. Wiley-Interscience, New York
Hairer E, Wanner G (1996) Solving ordinary differential equations II: stiff and differential algebraic problems. Springer, Berlin
Fornberg B (1988) Generation of finite difference formulas on arbitrarily spaced grids. Math Comput 51(184):699–706
Fornberg B (1998) Calculation of weights in finite difference formulas. SIAM Rev 40(3):685–691
Weng HS, Eigenberger G, Butt JB (1975) Catalyst poisoning and fixed bed reactor dynamics. Chem Eng Sci 30(11):1341–1351
Tali-Maamar N, Damak T, Babary JT, Nihtilä MT (1993) Application of a collocation method for simulation of distributed parameter bioreactors. Math Comp Sim 35:303–319
Lyness JN, Moler CB (1967) Numerical differentiation of analytic functions. SIAM J Numer Anal 4(2):202–210
Squire W, Trapp G (1998) Using complex variables to estimate derivatives of real functions. SIAM Rev 40(1):110–112
Cao Y (2008) Complex step jacobian. Technical Report 18176, Matlab Central
Brewster MW, Gobber MK (2011) A comparative evaluation of matlab, octave, freemat, and scilab on tara. Technical Report HPCF-2011-10, Department of Mathematics and Statistics, University of Maryland, Baltimore County
Further Reading
Vande Wouwer A, Saucez P, Schiesser WE (2001) Adaptive method of lines. Chapman Hall/CRC, Boca Raton
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2014 Springer International Publishing Switzerland
About this chapter
Cite this chapter
Vande Wouwer, A., Saucez, P., Vilas, C. (2014). Finite Differences and the Method of Lines. In: Simulation of ODE/PDE Models with MATLAB®, OCTAVE and SCILAB. Springer, Cham. https://doi.org/10.1007/978-3-319-06790-2_3
Download citation
DOI: https://doi.org/10.1007/978-3-319-06790-2_3
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-06789-6
Online ISBN: 978-3-319-06790-2
eBook Packages: EngineeringEngineering (R0)