How to perform tests

You can perform one of the following types of tests:

 

How to solve test set problems with test set solvers
(back to top of page)

To test one of the solvers that are supported in the test set on one of the test set problems, you need to download four types of codes: a solver, a driver, a problem and auxiliary routines.

The drivers are such that runs can be performed that solve the problem numerically with these solvers. Unless stated otherwise, all input parameters are set to their default values in the drivers.

The solvers available are listed in the solvers section of the test set. In the related subsections, you can find the description of the solvers, all the fortran files needed to run a test and instructions for compilation.

A GNU makefile is available in the directory tests of the distribution tree to help in the compilation steps. Executing

  make PROBLEM=problem SOLVER=solver

will yield an executable called dotest that solves the problem. The Fortran routines for the problem are in the file src/problems/problem.f and the Fortran routines for the solvers are in src/solvers, src/drivers, src/auxil.

If you are using the facility to save the intermediate values of the computed solution in a file, the MATLAB function IVPfplot.m or the SCILAB function IVPfplot.sci can used to plot the computed solution.

The problem routines can be found at the software part of the test set. For an explanation of the format of these codes, we refer to Section IV.3 of the prologue of the descriptive part of the test set.

 

How to test your own solver
(back to top of page)

The following guidelines serve to test your own solver with the test set problems.

  • Write your own solver in a format similar to that of solvers that are supported in the test set in the file own.f.
  • (Optional) You may like to put the linear algebra subroutines in a separate file owna.f. In this way you can, for example, use the linear algebra of an existing solver.
  • Write driver subroutines in the file ownd.f. If the format of your solver is similar to that of a solver that is already available in the test set, then this will only require minor modifications of the driver routines of that solver.
  • Adjust the file report.f as indicated in the comment linesof this file. This will only be a minor modification.
  • Compiling

     

      f77 -o dotest ownd.f problem.f owna.f own.f report.f,

    will yield an executable called dotest that solves the problem, of which the Fortran routines are in the file problem.f.

 

How to solve your own problem
(back to top of page)

The following guidelines serve to solve your own problem with the solvers that are supported in the test set.

  • Write your own problem in a format similar to that of the test set problems in the file newprob.f. This format is described precisely in Section IV.3 of the prologue of the descriptive part of the test set.
  • Adjust the file report.f as indicated in the comment lines of this file. This will only be a minor modification.
  • To solve your problem with, for example, DASSL, compiling

     

      f77 -o dotest dassld.f newprob.f ddassl.f dassla.f report.f,

    will give you the desired executable.

 

How to solve a test set problem using the web facility
(
back to top of page)

Following the link compile and run on line it is possible to execute a test set problem on line, using the supported solvers.
The registation is mandatory to execute a test on line. The user input are the relative tolerance, the absolute tolerance and the initial stepsize for the solvers that need it. As a result the solution computed in the last point, the scd and mescd and some integration characteristics, as described in Section II.4 of the prologue of the descriptive part of the test set, are displayed. The plots of some components of the solution are also visualized.

 

How to solve yor own problem using the web facility

(back to top of page)

Following the link compile and run on line it is possible to upload a file containing the subroutines describing the problems written using the format described precisely in Section IV.3 of the prologue of the descriptive part of the test set. The registation is mandatory to upload and execute a test on line. It is possible to solve the problem on line, using the supported solvers. The user input are the relative tolerance, the absolute tolerance and the initial stepsize for the solvers that need it. As a results the solution computed in the last point, the scd and mescd and some integration characteristics, as described in Section II.4 of the prologue of the descriptive part of the test set, are displayed. The plots of the components of the solution defined in the subroutine setoutput are also visualized.

 

How to solve the test set problems with the MATLAB solvers
(back to top of page)

The MATLAB function minterface.m together with the fortran function matlab_interface.F , allows to construct the mex files to run the test set problems in the MATLAB environment.

The MATLAB instruction:

  >> MPROB = minterface(problem)

returns a function handle to a MEX-Function interface to problem.f. If needed, the Fortran MEX-Function interface is automatically generated and compiled, you need a Fortran compiler compatible with the MATLAB environment to complete the compilation steps. Moreover, before using, for the first time, this utilities, at the MATLAB prompt type

  >> mex -setup

and select the Fortran compiler you want to use.

The interface mprob supports the following calling sequences:

PROB = MPROB('Prob')
[Y0,YP0,CONSIST] = MPROB('Init',NEQ,T0)
[ATOL,RTOL] = MPROB('Tolerances',NEQN,ATOL,RTOL)
[F,IERR,RPAR,IPAR] = MPROB('Feval',NEQ,T,Y,YP,RPAR,IPAR)
[J,IERR,RPAR,IPAR] = MPROB('Jeval',LDIM,NEQ,T,Y,YP,RPAR,IPAR)
[M,IERR,RPAR,IPAR] = MPROB('Meval',LDIM,NEQ,T,Y,YP,RPAR,IPAR)
Y = MPROB('Solut',NEQ,TFINAL)
[MESCD,SCD] = MPROB('Report',NEQ,YREF,Y,PROBNM,TOLVEC,ATOL,RTOL)
MPROB('Help')

The meaning of the input/output parameters is described precisely in Section IV.3 of the prologue of the descriptive part of the test set.

The function odetest.m contains a user interface to run and compile the problems in the MATLAB environment.

As an example the instruction:

  >> [sol,stats] = odetest(problem,'ode15s',1e-5,1e-4,1)

solves the problem using the matlab solver 'ode15s', with absolute tolerance equal to 1e-5, relative tolerance equal to 1e-4; the first component of the solution is plotted using the function 'odeplot'. The output variable sol contains information about the solution.

Use the MATLAB help to have information about the input/output parameters of the function.

 

How to solve your own problem with MATLAB solvers (back to top of page)

  • Write your own problem in a format similar to that of the test set problems in the file newprob.f. This format is described precisely in Section IV.3 of the prologue of the descriptive part of the test set.

  • As an example the instruction
      >> [sol,stats] = odetest(newprob,'ode15s',1e-5,1e-4,1)

    will automatically construct the mex file to run your Fortran problem in MATLAB.

Be Sociable, Share!