Preface
xi
chapters. Explanations are now more complete, previous examples have been
modified, new examples have been added, and more. In particular, the importing
of code is now elaborated on in a greater detail, so is the making of modules.
Also, Sect. 4.2 is new, illustrating the important stepwise strategy of code writing
through a dedicated example. The five first chapters now cover about 150 pages
that explain, in a brief and simple manner, all the code basics required to follow
the remaining parts of the book.
3. The new Chap. 6 (Computing Integrals and Testing Code) and Chap. 7 (Solving
Nonlinear Algebraic Equations) are seen as gentle first applications of programming to problem-solving in mathematics. Both these chapters now precede the
mathematically more challenging Chaps. 8 and 9, which treat basic numerical
solving of ODEs and PDEs, respectively (the chapter Solving Nonlinear Algebraic Equations was, in the first edition, the final chapter of the book, but it
seems more appropriate to let it act as a “warm-up” chapter, together with the
new Chap. 6, for the two final chapters on differential equation solving).
4. Section 8.1 (Filling a Water Tank: Two Cases) is new, particularly written for
readers who lack experience with differential equations.
5. Section 8.5 (Rate of Convergence) is new, explaining convergence rate related to
differential equations.
6. New exercises have been added, e.g., on Fibonacci numbers, the Leapfrog
method, Adams-Bashforth methods, and more.
7. Errors and typos have been corrected, and many explanations have been reformulated throughout.
Supplementary Materials All program and data files referred to herein are
available from the book’s (2nd edition) primary web site:
https://github.com/slgit/prog4comp_2.
Acknowledgments We want to thank all students who attended the courses
FM1006 Modelling and simulation of dynamic systems, FM1115 Scientific Computing, FB1012 Mathematics, and FB2112 Physics at the University of South-Eastern
Norway over the last 5–10 years. They worked their way through early versions of
this text and gave us constructive and positive feedback that helped us correct errors
and improve the book in so many ways. Special acknowledgment goes to Guandong
Kou, Edirisinghe V. P. J. Manjula, and Yapi Donatien Achou for their careful reading
of the manuscript (first edition) and constructive suggestions for improvement. The
constructive feedback and good suggestions received from Om Prakash Chapagain
(second edition) is also highly appreciated. We thank all our good colleagues at the
University of South-Eastern Norway, the University of Oslo, and Simula Research
Laboratory for their continued support and interest, for the enlightening discussions,
and for providing such an inspiring environment for teaching and science.
Special thanks go to Prof. Kent-Andre Mardal, the University of Oslo, for his
insightful comments and suggestions.
xi
chapters. Explanations are now more complete, previous examples have been
modified, new examples have been added, and more. In particular, the importing
of code is now elaborated on in a greater detail, so is the making of modules.
Also, Sect. 4.2 is new, illustrating the important stepwise strategy of code writing
through a dedicated example. The five first chapters now cover about 150 pages
that explain, in a brief and simple manner, all the code basics required to follow
the remaining parts of the book.
3. The new Chap. 6 (Computing Integrals and Testing Code) and Chap. 7 (Solving
Nonlinear Algebraic Equations) are seen as gentle first applications of programming to problem-solving in mathematics. Both these chapters now precede the
mathematically more challenging Chaps. 8 and 9, which treat basic numerical
solving of ODEs and PDEs, respectively (the chapter Solving Nonlinear Algebraic Equations was, in the first edition, the final chapter of the book, but it
seems more appropriate to let it act as a “warm-up” chapter, together with the
new Chap. 6, for the two final chapters on differential equation solving).
4. Section 8.1 (Filling a Water Tank: Two Cases) is new, particularly written for
readers who lack experience with differential equations.
5. Section 8.5 (Rate of Convergence) is new, explaining convergence rate related to
differential equations.
6. New exercises have been added, e.g., on Fibonacci numbers, the Leapfrog
method, Adams-Bashforth methods, and more.
7. Errors and typos have been corrected, and many explanations have been reformulated throughout.
Supplementary Materials All program and data files referred to herein are
available from the book’s (2nd edition) primary web site:
https://github.com/slgit/prog4comp_2.
Acknowledgments We want to thank all students who attended the courses
FM1006 Modelling and simulation of dynamic systems, FM1115 Scientific Computing, FB1012 Mathematics, and FB2112 Physics at the University of South-Eastern
Norway over the last 5–10 years. They worked their way through early versions of
this text and gave us constructive and positive feedback that helped us correct errors
and improve the book in so many ways. Special acknowledgment goes to Guandong
Kou, Edirisinghe V. P. J. Manjula, and Yapi Donatien Achou for their careful reading
of the manuscript (first edition) and constructive suggestions for improvement. The
constructive feedback and good suggestions received from Om Prakash Chapagain
(second edition) is also highly appreciated. We thank all our good colleagues at the
University of South-Eastern Norway, the University of Oslo, and Simula Research
Laboratory for their continued support and interest, for the enlightening discussions,
and for providing such an inspiring environment for teaching and science.
Special thanks go to Prof. Kent-Andre Mardal, the University of Oslo, for his
insightful comments and suggestions.
