Implementing a Numerical Solution of the KPI Equation Using Single Assignment C: Lessons and Experiences
We report our experiences of programming in the functional language SaC a numerical method for the KPI (Kadomtsev-Petiviashvili I) equation. KPI describes the propagation of nonlinear waves in a dispersive medium. It is an integro-differential, nonlinear equation with third-order derivatives, and so it presents a noticeable challenge in numerical solution, as well as being an important model for a range of topics in computational physics. The latter include: long internal waves in a density-stratified ocean, ion-acoustic waves in a plasma, acoustic waves on a crystal lattice, and more. Thus our solution of KPI in SaC represents an experience of solving a “real” problem using a single-assignment language and as such provides an insight into the kind of challenges and benefits that arise in using the functional paradigm in computational applications. The paper describes the structure and functionality of the program, discusses the features of functional programming that make it useful for the task in hand, and touches upon performance issues.
KeywordsFunctional Programming Single Assignment Fortran Compiler Simulation Size Fortran Version
Unable to display preview. Download preview PDF.
- 1.SAC development team: Single Assignment C. A definitive web site, http://www.sac-home.org
- 4.Serrarens, P.: Implementing the Conjugate Gradient Algorithm in a Functional Language. In: Kluge, W. (ed.) IFL 1996. LNCS, vol. 1268, pp. 125–140. Springer, Heidelberg (1997)Google Scholar
- 6.Kuznetsov, E.A., Musher, S., Shafarenko., A.: Collapse of acoustic waves in dispersive media. In: Sagdeev, R. (ed.) Nonlinear and Turbulent Processes in Physics, pp. 335–349. Harward Academic Publishers (1984)Google Scholar
- 11.Lu, Z., Tian, E.M., Grimshaw, R.: Interaction of two lump solitons described by the kadomtsev-petviashvili equation. Technical report, Dept. Math. Sci., Loughborough University (2003)Google Scholar
- 12.Timmes, F.X.: A pentadiagonal linear equation solver, http://www.cococubed.com/code_pages/pent.shtml