Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Hairer Book on ODE and Fortran

JohnNichols
Valued Contributor III
1,020 Views

I found an interesting book in the library Solving Ordinary Differential equations II about stiff equations.  Hairer provides his Fortran code on his Uni website, although this highlights the problem of code on individual websites, when the site goes the code goes. 

He mentions a algorithm DOP853 - teh book then takes a while to discuss the difficulty of solving the van der pols equations.  

It is a nice book to read, quite humourous for a interesting field. 

 

0 Kudos
6 Replies
JohnNichols
Valued Contributor III
1,014 Views

I downloaded the DOP853 code and the test program.  It has an interesting mix of code types,  there were four errors in compiling in VS 2019 with the IF 2021.1.2 - is the simplest way to fix the errors to get rid of the implicit reals and integers and go implicit none? 

 

Capture.PNG

0 Kudos
Steve_Lionel
Honored Contributor III
1,003 Views

This has nothing to do with typing. Instead, it's passing a scalar to a dummy declared as an array. See the section on Sequence Association at Doctor Fortran in "I've Come Here For An Argument" - Doctor Fortran (stevelionel.com)

One workaround is to turn these scalars into array constructors, such as [RTOL]. This works as long as the subroutine doesn't write into the argument.

 
0 Kudos
mecej4
Honored Contributor III
990 Views

Ernst Hairer(and Wanner)'s book is superb, both in content and typeset quality.

Hairer's son Martin, also a mathematician, won the 2014 Fields Medal.

0 Kudos
JohnNichols
Valued Contributor III
958 Views

I got the problem running in IFORT.  Changed all to Implicit None and then fixed the RPAR(*) issues, appears to run and solve. 

Was fun. 

0 Kudos
JohnNichols
Valued Contributor III
952 Views

Interestingly they have a Fortran program that takes the output and creates ps files and they can load into LATEX.  Brilliant.  

If in their second volume you look at the van der Pol's equation, the DOP853 can solve the problem until μ gets to about 50 and then the system becomes stiff and the book uses DEABM as the solver, the same plot as Figure 1.5 in the book for the mu of 31 is - they plot mu of 500 - DOP583 will not solve this. 

Capture.PNG

0 Kudos
JohnNichols
Valued Contributor III
944 Views

Hairer solves a beam problem for large displacements in Section IV.1 of his second book. The book develops an alternative Fortran code on page 46, which I have downloaded and updated slightly for IFORT -- his use of RPAR(*) causes some interesting moments.  

He provides a solution, which matches - but I am stumped on how he generates his Figure 3.4 and 3.5 from the data,  unfortunately in equations 1.19 he defines t from 0 to 5 obviously time and he defines X and Y, but in going from the program to the subroutine he swaps the variables t for X and the printout has X from 0 to 5.  

I enclose the code for IFORT.  Any thoughts welcome.  I will write to E Hairer tonight. 

I had a look at his son's thesis -- 130 pages of dense math, but interestingly he uses Brownian motion or white noise as the driving function.  Thermal noise is really a great device for studying things instead of hitting them with a large hammer or such. 

0 Kudos
Reply