Implementing a Numerical Solution of the KPI Equation Using Single Assignment C: Lessons and Experiences

  • Alex Shafarenko
  • Sven-Bodo Scholz
  • Stephan Herhut
  • Clemens Grelck
  • Kai Trojahner
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4015)


We report our experiences of programming in the functional language SaC[1] 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.


Functional Programming Single Assignment Fortran Compiler Simulation Size Fortran Version 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    SAC development team: Single Assignment C. A definitive web site,
  2. 2.
    Grelck, C., Scholz, S.-B.: Towards an efficient functional implementation of the NAS benchmark FT. In: Malyshkin, V.E. (ed.) PaCT 2003. LNCS, vol. 2763, pp. 230–235. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  3. 3.
    Hammes, J., Sur, S., Bohm, A.P.W.: On the effectiveness of functional language features: NAS benchmark FT. Journal of Functional Programming 7, 103–123 (1997)zbMATHCrossRefGoogle Scholar
  4. 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
  5. 5.
    Frens, J., Wise, D.: Auto-Blocking Matrix-Multiplication or Tracking BLAS3 Performance from Source Code. In: Proceedings of the 6th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming. SIGPLAN Notices, vol. 32(7), pp. 206–216. ACM, New York (1997)CrossRefGoogle Scholar
  6. 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
  7. 7.
    Kadomtsev, B.B., Petviashvili, V.I.: On the stability of solitary waves in weakly dispersive media. Sov. Phys. Dokl. 15, 539–541 (1970)zbMATHGoogle Scholar
  8. 8.
    Singh, S., Honzawa, T.: Kadomtsev-petviashivili equation for an ion-acoustic soliton in a collisionless weakly relativistic plasma with finite ion temperature. Physics of Fluids B: Plasma Physics 5, 2093–2097 (1993)CrossRefGoogle Scholar
  9. 9.
    Gilbert, G.: The kadomtsev-petviashvili equations and fundamental string theory. Communications in Mathematical Physics 117, 331–348 (1988)zbMATHCrossRefMathSciNetGoogle Scholar
  10. 10.
    Chen, X.N., Sharma, S.D.: Zero wave resistance for ships moving in shallow channels at supercritical speeds. J. Fluid Mech. 335, 305–321 (1997)zbMATHCrossRefGoogle Scholar
  11. 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. 12.
    Timmes, F.X.: A pentadiagonal linear equation solver,
  13. 13.
    Grelck, C., Scholz, S.-B., Trojahner, K.: With-loop scalarization – merging nested array operations. In: Trinder, P., Michaelson, G.J., Peña, R. (eds.) IFL 2003. LNCS, vol. 3145, pp. 118–134. Springer, Heidelberg (2004)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Alex Shafarenko
    • 1
  • Sven-Bodo Scholz
    • 1
  • Stephan Herhut
    • 1
  • Clemens Grelck
    • 2
  • Kai Trojahner
    • 2
  1. 1.Department of Computer ScienceUniversity of HertfordshireU.K.
  2. 2.Institute of Software Technology and Programming LanguagesUniversity of LübeckGermany

Personalised recommendations