C/C++ example for STEP

 

#include "stdafx.h"

#include "DllFunc.h"

 

STEP_API void __cdecl differential_usub

   (double time, double upar[], int npar, int jflag, int iflag, double* result)

{          

   using namespace rd_syscall;

   // Parameter Information

   //   time   : Simulation time of RD/Solver. (Input)

   //   upar   : Parameters defined by user. (Input)

   //   npar   : Number of user parameters. (Input)

   //   jflag   : When RD/Solver evaluates a Jacobian, the flag is true. (Input)

   //   iflag   : When RD/Solver initializes arrays, the flag is true. (Input)

   //   result : Returned value. (Output)

 

   // User Statement

   double value, velo, stime;

   int iord, errflg;

 

   stime = 1.0;

   velo = 74.0;

   if (jflag) {

      iord = 1;

   }

   else {

      iord = 0;

   }

   rd_step(time,0.0,0.0,stime,velo,iord,&value,&errflg);

   *result = value;

 

}