# siconos.kernel.ZeroOrderHoldOSI (Python class)¶

class siconos.kernel.ZeroOrderHoldOSI[source]

Bases: siconos.kernel.OneStepIntegrator

ZeroOrderHoldOSI Time-Integrator for Dynamical Systems.

See User’s guide for details.

ZeroOrderHoldOSI class is used to define some time-integrators methods for a list of dynamical systems. A ZeroOrderHoldOSI instance is defined by the value of theta and the list of concerned dynamical systems. Each DynamicalSystem is associated to

• computeFreeState(): computes xfree of dynamical systems state without taking the non-smooth part into account
• updateState(): update the state x of the dynamical systems

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

Constructors

ZeroOrderHoldOSI()

basic constructor

Ad(DynamicalSystem ds) -> array_like (np.float64, 2D)[source]

get $$\Phi$$ corresponding to DynamicalSystem ds

Parameters: ds – the DynamicalSystem pointer to a SiconosMatrix
Bd(DynamicalSystem ds) -> array_like (np.float64, 2D)[source]

get $$B_d$$ corresponding to DynamicalSystem ds

Parameters: ds – the DynamicalSystem pointer to a SiconosMatrix
addInteractionInIndexSet(Interaction inter, int i) → bool[source]

Apply the rule to one Interaction to known if is it should be included in the IndexSet of level i.

Parameters: inter – a pointer to the Interaction to be added i – the level of the IndexSet true if y<=0
computeFreeOutput(InteractionsGraph::VDescriptor vertex_inter, OneStepNSProblem *osnsp) → None[source]

Compute the Output (y) which corresponds to the free state (state without taking into account the nonsmooth input) plus the possible contribution of the nslaw.

Parameters: vertex_inter – of the interaction graph osnsp – a pointer to the OneStepNSProblem
computeFreeState() → None[source]

Perform the integration of the dynamical systems linked to this integrator without taking into account the nonsmooth input (_r or _p)

computeResidu() → double[source]

return the maximum of all norms for the “ZeroOrderHoldOSI-discretized” residus of DS

Returns: a double
display() → None[source]

Displays the data of the ZeroOrderHoldOSI’s integrator.

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

initialization of the ZeroOrderHoldOSI integrator

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
integrate(double tinit, double tend, double tout, int notUsed) → 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 notUsed – useless flag (for ZeroOrderHoldOSI, used in LsodarOSI)
numberOfIndexSets() → int[source]

get the number of index sets required for the simulation

Returns: unsigned int
prepareNewtonIteration(double time) → None[source]

Unused.

Parameters: time – current time
removeInteractionFromIndexSet(Interaction inter, int i) → bool[source]

Apply the rule to one Interaction to known if is it should be removed in the IndexSet of level i.

Parameters: inter – a pointer to the Interaction to be removed i – the level of the IndexSet true if y>0
updateMatrices(DynamicalSystem ds) → None[source]
updateState(int level) → None[source]

updates the state of the Dynamical Systems

Parameters: level – level of interest for the dynamics: not used at this moment