siconos.kernel.LsodarOSI (Python class)

class siconos.kernel.LsodarOSI[source]

Bases: siconos.kernel.OneStepIntegrator

LsodarOSI solver (odepack)

Many parameters are required as input/output for LSODAR. See the documentation of this function in externals/odepack/opkdmain.f to have a full description of these parameters. Most of them are read-only parameters (ie can not be set by user).

Except:
  • jt: Jacobian type indicator (1 means a user-supplied full Jacobian, 2 means an internally generated full Jacobian).

    Default = 2.

  • itol, rtol and atol

    ITOL = an indicator for the type of error control. RTOL = a relative error tolerance parameter, either a scalar or array of

    length NEQ.

    ATOL = an absolute error tolerance parameter, either a scalar or an array

    of length NEQ. Input only.

Generated class (swig), based on C++ header Program listing for file kernel/src/simulationTools/LsodarOSI.hpp.

Constructors

LsodarOSI()

Default constructor.

Attributes:
  • count_NFE (int) – Number of RHS evaluations for the problem so far.
  • count_NST (int) – Lsodar counter : Number of steps taken for the problem so far.
computeFreeOutput(InteractionsGraph::VDescriptor vertex_descr, OneStepNSProblem *osnsp) → None[source]

integrates the Interaction linked to this integrator, without taking non-smooth effects into account

Parameters:
  • vertex_descr – descriptor vertex of the interaction graph
  • osnsp – pointer to OneStepNSProblem
computeJacobianRhs(double t, DynamicalSystemsGraph DSG0) → None[source]

compute jacobian of the rhs at time t for all dynamical systems in the set

Parameters:
  • t – current time of simulation
  • DSG0 – the graph of DynamicalSystem
computeRhs(double t) → None[source]

compute rhs(t) for all dynamical systems in the set

Parameters:t – current time of simulation
static count_rhs_call() → int[source]

Return current number of rhs call (for all lsodar-like OSIs!)

Returns:int
static count_steps() → int[source]

Return the number of lsodar steps already done (for all lsodar-like OSIs!)

Returns:int
display() → None[source]

print the data to the screen

f(integer *sizeOfX, doublereal *time, doublereal *x, doublereal *xdot) → None[source]
fillXWork(integer *size, doublereal *array) → None[source]

fill xWork with a doublereal

Parameters:
  • size – size of x array
  • array – x array of double
g(integer *nEq, doublereal *time, doublereal *x, integer *ng, doublereal *gOut) → None[source]
getAtol() → SA::doublereal[source]

get absolute tolerance parameter for lsodar

Returns:a doublereal*
getIwork() → SA::integer[source]

get iwork

Returns:a pointer to integer
getJroot() → SA::integer[source]

get output of root information

Returns:a pointer to integer
getMaxNstep() → int[source]

get the maximum number of steps for one call

Returns:an interger
getRtol() → SA::doublereal[source]

get relative tolerance parameter for lsodar

Returns:a doublereal*
getRwork() → SA::doublereal[source]

get real work vector parameter for lsodar

Returns:a doublereal*
initialize() → None[source]

initialization of the integrator

initializeWorkVectorsForDS(double t, DynamicalSystem ds) → None[source]

initialization of the work vectors and matrices (properties) related to one dynamical system on the graph and needed by the osi

Parameters:
  • t – time of initialization
  • ds – the dynamical system
initializeWorkVectorsForInteraction(Interaction inter, InteractionProperties interProp, DynamicalSystemsGraph DSG) → None[source]

initialization of the work vectors and matrices (properties) related to one interaction on the graph and needed by the osi

Parameters:
  • inter – the interaction
  • interProp – the properties on the graph
  • DSG – the dynamical systems graph
intData(*args)[source]

Warning - Overloaded function : multiple signatures available, check prototypes below.

intData() → vector< integer >[source]

get vector of integer parameters for lsodar

Returns:a vector<integer>
intData(int i) → integer[source]

get _intData[i]

Parameters:i – index number (starting from 0)
Returns:an integer
integrate(double tinit, double tend, double tout, int ioparam) → None[source]

integrate the system, between tinit and tend (->iout=true), with possible stop at tout (->iout=false)

Parameters:
  • tinit – initial time
  • tend – end time
  • tout – real end time
  • ioparam – in-out parameter, input: 1 for first call, else 2. Output: 2 if no root was found, else 3.
jacobianfx(integer *, doublereal *, doublereal *, integer *, integer *, doublereal *, integer *) → None[source]
numberOfIndexSets() → int[source]

get the number of index sets required for the simulation

Returns:unsigned int
prepareNewtonIteration(double time) → None[source]
setIntData(int i, int newValue) → None[source]

set _intData[i]

Parameters:
  • i – index number (starting from 0)
  • newValue – the new value
setJT(integer newJT) → None[source]

set Jt value, Jacobian type indicator.

Excerpts from the lsodar documentation. 1 means a user-supplied full (neq by neq) jacobian. 2 means an internally generated (difference quotient) full jacobian (using neq extra calls to f per df/dy value). 4 means a user-supplied banded jacobian. 5 means an internally generated banded jacobian (using ml+mu+1 extra calls to f per df/dy evaluation). if jt = 1 or 4, the user must supply a subroutine jac (the name is arbitrary) as described above under jac. if jt = 2 or 5, a dummy argument can be used.

Parameters:newJT – new value for the jt parameter.
setMaxNstep(integer maxNumberSteps) → None[source]

set the maximum number of steps for one call of Lsodar

Parameters:maxNumberSteps – the maximum number of steps
setMaxOrder(integer maxorderNonStiff, integer maxorderStiff) → None[source]

set maximum method order

Parameters:
  • maxorderNonStiff – maximum order for nonstiff methods
  • maxorderStiff – maximum order for stiff methods
setMinMaxStepSizes(doublereal minStep, doublereal maxStep) → None[source]

set the minimum and maximum step sizes

Parameters:
  • minStep – minimum step size
  • maxStep – maximum step size
setTol(*args)[source]

Warning - Overloaded function : multiple signatures available, check prototypes below.

setTol(integer newItol, SA::doublereal newRtol, SA::doublereal newAtol) → None[source]

set itol, rtol and atol (tolerance parameters for lsodar)

Parameters:
  • newItol – itol value
  • newRtol – rtol value
  • newAtol – atol value
setTol(integer newItol, doublereal newRtol, doublereal newAtol) → None[source]

set itol, rtol and atol (scalar tolerance parameters for lsodar)

Parameters:
  • newItol – itol value
  • newRtol – rtol value
  • newAtol – atol value
updateData() → None[source]

update doubleData and iwork memory size, when changes occur in _intData.

updateState(int level) → None[source]

update the state of the DynamicalSystems attached to this Integrator

Parameters:level – level of interest for the dynamics