FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
Pendulum Class Reference
+ Inheritance diagram for Pendulum:
+ Collaboration diagram for Pendulum:

Public Member Functions

 Pendulum (const std::string &simObjectName, ISimObjectCreator *const creator)
 
void OdeFcn (const double T, const double *const X, double *const XDot) const
 
bool HasJacobians () const override
 
void OdeJacobian (double T, const double *X, double *J, int nStates) override
 
int GetJacobianSparsity (int nStates, int *rowPtr, int *colIdx) override
 
void InitialConditionSetup (const double T, const double *const currentIC, double *const updatedIC, ISimObjectCreator *const creator)
 

Protected Member Functions

void SetOutputPortValues (const double T, const double *const X) const
 
const double * Angle (const double T, const double *const X)
 
const double * AngularVelocity (const double T, const double *const X)
 
int LocalIndex (int globalStateIndex) const
 

Protected Attributes

ICommonComputation * m_SetOutputPortValues
 
int m_AngleIndex
 
int m_AngularVelocityIndex
 
double m_Length
 
double m_Gravity
 
double m_Angle
 
double m_AngularVelocity
 
double m_Origin [3]
 

Member Function Documentation

◆ LocalIndex()

int Pendulum::LocalIndex ( int  globalStateIndex) const
inlineprotected

Turns a model-global state index into one local to this SimObject.

OdeFcn and the port functions are handed the whole model's state vector, so they use the global indices AddState returned directly. OdeJacobian is handed this object's own slice, whose first element is Angle, so every index it uses goes through this function (BASE-0033).


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