Minsky
minsky::RKdata Struct Reference
Collaboration diagram for minsky::RKdata:
Collaboration graph

Public Member Functions

 RKdata (RungeKutta *minsky)
 
 ~RKdata ()
 

Static Public Member Functions

static void errHandler (const char *reason, const char *file, int line, int gsl_errno)
 

Public Attributes

gsl_odeiv2_system sys
 
gsl_odeiv2_driver * driver
 

Detailed Description

Definition at line 81 of file rungeKutta.cc.

Constructor & Destructor Documentation

◆ RKdata()

minsky::RKdata::RKdata ( RungeKutta minsky)
inline

Definition at line 90 of file rungeKutta.cc.

References pyminsky::minsky.

90  {
91  gsl_set_error_handler(errHandler);
92  sys.function=RungeKutta::RKfunction;
93  sys.jacobian=RungeKutta::jacobian;
94  sys.dimension=minsky->stockVars.size();
95  sys.params=minsky;
96  const gsl_odeiv2_step_type* stepper;
97  switch (minsky->order)
98  {
99  case 1:
100  if (!minsky->implicit)
101  throw ecolab::error("First order explicit solver not available");
102  stepper=gsl_odeiv2_step_rk1imp;
103  break;
104  case 2:
105  stepper=minsky->implicit? gsl_odeiv2_step_rk2imp: gsl_odeiv2_step_rk2;
106  break;
107  case 4:
108  stepper=minsky->implicit? gsl_odeiv2_step_rk4imp: gsl_odeiv2_step_rkf45;
109  break;
110  default:
111  throw ecolab::error("order %d solver not supported",minsky->order);
112  }
113  driver = gsl_odeiv2_driver_alloc_y_new
114  (&sys, stepper, minsky->stepMax, minsky->epsAbs,
115  minsky->epsRel);
116  gsl_odeiv2_driver_set_hmax(driver, minsky->stepMax);
117  gsl_odeiv2_driver_set_hmin(driver, minsky->stepMin);
118  }
static int RKfunction(double, const double y[], double f[], void *)
function to be integrated (internal use)
Definition: rungeKutta.cc:50
static void errHandler(const char *reason, const char *file, int line, int gsl_errno)
Definition: rungeKutta.cc:86
gsl_odeiv2_driver * driver
Definition: rungeKutta.cc:84
static int jacobian(double, const double y[], double *, double dfdt[], void *)
compute jacobian (internal use)
Definition: rungeKutta.cc:65
Creation and access to the minskyTCL_obj object, which has code to record whenever Minsky's state cha...
Definition: constMap.h:22
Minsky & minsky()
global minsky object
Definition: minskyTCL.cc:51
gsl_odeiv2_system sys
Definition: rungeKutta.cc:83

◆ ~RKdata()

minsky::RKdata::~RKdata ( )
inline

Definition at line 119 of file rungeKutta.cc.

119 {gsl_odeiv2_driver_free(driver);}
gsl_odeiv2_driver * driver
Definition: rungeKutta.cc:84

Member Function Documentation

◆ errHandler()

static void minsky::RKdata::errHandler ( const char *  reason,
const char *  file,
int  line,
int  gsl_errno 
)
inlinestatic

Definition at line 86 of file rungeKutta.cc.

86  {
87  throw ecolab::error("gsl: %s:%d: %s",file,line,reason);
88  }

Member Data Documentation

◆ driver

gsl_odeiv2_driver* minsky::RKdata::driver

Definition at line 84 of file rungeKutta.cc.

◆ sys

gsl_odeiv2_system minsky::RKdata::sys

Definition at line 83 of file rungeKutta.cc.


The documentation for this struct was generated from the following file: