#include "stdafx.h" #include "DllFunc.h" #define _USE_MATH_DEFINES // for C #include <math.h>
TranslationalForce_API void __cdecl translational_force(double time, double upar[], int npar, int jflag, int iflag, double result[3]) { 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 // Local Varialbe Definition int minus[3]; double value[3];
// Assign Impact Parameters minus[0] = (int) upar[0]; minus[1] = (int) upar[1]; minus[2] = (int) upar[2];
for (int i = 0; i < 3; i++) { if (minus[i] != 0) { value[i] = -pow((pow(4*M_PI, 2))/3, 0.5); } else { value[i] = pow((pow(4*M_PI, 2))/3, 0.5); } }
// Assign the Returned Value result[0] = value[0]; result[1] = value[1]; result[2] = value[2]; } |