``physics.c'' and ``physics.h''

The Schrödinger is a new type of subroutine for us. It isn't a basic mathematical routine like simpint() or rk4p480(), but a physics subroutine. We will have a number of these, and thus it is useful to keep them in their own file, which we shall call ``physics.c''. Separating these routines means that we will need yet another header file ``physics.h'' to keep the function prototypes. If you are working in Unix, this also means that you will have to add ``physics.o'' and ``physics.h'' to the definition lines for OBJECTS and HEADERS in your makefile.

As you know, rk4p480() will want to call a function specifying the differential equation, derivs_Schrodinger() in this case. As this function is only called through schint(), it is not necessary or appropriate to include the prototype in ``physics.h''. Be sure to include derivs_Schrodinger() in ``physics.c'' before schint() so that the compiler will have the prototype for derivs_Schrodinger() while it is working on schint().



Tomas Arias 2004-02-20