|
FhSim
3.1.0
Marine systems simulation
|
Class containing a Rigid Bar Cable (RBC) calculation engine. More...
#include <RBCEngine.h>
Public Member Functions | |
| RBCEngine (int nofBarElements, double barMass, double length, double omegaNL, double omegaN, double zetaNL, double zetaN, bool fixedFixed, double kei, double ked, double kep, double endNodeSumMax=10.0) | |
| The constructor. | |
| ~RBCEngine () | |
| The destructor cleans up dynamically allocated memory. | |
| bool | GetInitialStates (const double *const posA, const double *const posB, const double *const velA, const double *const velB, double *vecB, double *vecR, double *vecBdot, double *vecRdot, double *endNodeSum) |
| bool | StateUpdate (const double *const posA, const double *const velA, const double *const vecB, const double *const vecR, const double *const vecBdot, const double *const vecRdot, double *nodeForces) |
| void | AdvanceEndControl (const double *const posB, const double *const velB, const double *const vecB, const double *const vecBdot, const double *const vecR, const double *const vecRdot, const double *const endNodeSum) |
| void | GetEndNodeSumDot (const double *const posB, const double *const vecB, const double *const vecR, const double *const endNodeSum, double *endNodeSumDot) const |
| bool | GetAccelerations (double *dotDot, double *rDotDot) |
| Get functions are based on the last StateUpdate call. | |
| bool | GetEndForces (double *forceA, double *forceB) |
| (dim: 3) | |
| bool | GetNodePositions (double *nodePosition) |
| (dim: 3(N+1)) | |
| bool | GetNodeVelocities (double *nodeVelocities) |
| (dim: 3(N+1)) | |
| bool | IsInitialised () const |
| True once GetInitialStates has run. Before that StateUpdate computes nothing. | |
| RBCEngine::RBCEngine | ( | int | nofBarElements, |
| double | barMass, | ||
| double | length, | ||
| double | omegaNL, | ||
| double | omegaN, | ||
| double | zetaNL, | ||
| double | zetaN, | ||
| bool | fixedFixed, | ||
| double | kei, | ||
| double | ked, | ||
| double | kep, | ||
| double | endNodeSumMax = 10.0 |
||
| ) |
| nofBarElements | The number of bar elements in the cable |
| barMass | The mass of one bar of the cable. |
| length | Length of a bar |
| omegaNL | The natural frequency, length constrain |
| omegaN | The natural frequency, node constrain |
| zetaNL | Relative damping ratio, length constrain |
| zetaN | Relative damping ratio, node constrain |
| fixedFixed | Is the model fixated in both cable ends |
| kei | Parameter for FixedFixed |
| ked | Parameter for FixedFixed |
| kep | Parameter for FixedFixed |
| endNodeSumMax | Anti-windup limit of each component of the state EndNodeSum [m s] (agent default 10, the old fixed reset limit 10.01) |
| void RBCEngine::AdvanceEndControl | ( | const double *const | posB, |
| const double *const | velB, | ||
| const double *const | vecB, | ||
| const double *const | vecBdot, | ||
| const double *const | vecR, | ||
| const double *const | vecRdot, | ||
| const double *const | endNodeSum | ||
| ) |
The end control force (PID law, eq 6.141) at the accepted state, held until the next call. StateUpdate only reads the held control, so it is the same however often it runs (rule R3, ADR 0017). The I term is Kei times the state EndNodeSum, the integral of the end constraint error C (units m s), each component clamped to +- endNodeSumMax. Does nothing unless fixed-fixed.
| posB | (dim: 3) |
| velB | (dim: 3) |
| vecB | (dim: 3N) |
| vecBdot | (dim: 3N) |
| vecR | (dim: 3N) |
| vecRdot | (dim: 3N) |
| endNodeSum | (dim: 3) the state EndNodeSum, the integral of C |
| bool RBCEngine::GetAccelerations | ( | double * | dotDot, |
| double * | rDotDot | ||
| ) |
(dim: 3N
| void RBCEngine::GetEndNodeSumDot | ( | const double *const | posB, |
| const double *const | vecB, | ||
| const double *const | vecR, | ||
| const double *const | endNodeSum, | ||
| double * | endNodeSumDot | ||
| ) | const |
The derivative of the state EndNodeSum: the end constraint error C = posB - (r_n + b_n / 2) at the given state, zero unless fixed-fixed. A component that has reached the anti-windup limit and whose error pushes it further out has derivative zero (conditional integration), so the state stays in +- endNodeSumMax. A function of its arguments only.
| posB | (dim: 3) |
| vecB | (dim: 3N) |
| vecR | (dim: 3N) |
| endNodeSum | (dim: 3) the state EndNodeSum |
| endNodeSumDot | (dim: 3) |
| bool RBCEngine::GetInitialStates | ( | const double *const | posA, |
| const double *const | posB, | ||
| const double *const | velA, | ||
| const double *const | velB, | ||
| double * | vecB, | ||
| double * | vecR, | ||
| double * | vecBdot, | ||
| double * | vecRdot, | ||
| double * | endNodeSum | ||
| ) |
| posA | Position A (dim:3) |
| posB | Position B (dim:3) |
| velA | Velocity A (dim:3) |
| velB | Velocity B (dim:3) |
| vecB | State vector B (dim:3N) where N is the number of bar elements in the cable |
| vecR | State vector R (dim:3N) |
| vecBdot | State vector B time derived(dim:3N) |
| vecRdot | State vector R time derived (dim:3N) |
| endNodeSum | State vector EndNodeSum (dim:3) |
| bool RBCEngine::StateUpdate | ( | const double *const | posA, |
| const double *const | velA, | ||
| const double *const | vecB, | ||
| const double *const | vecR, | ||
| const double *const | vecBdot, | ||
| const double *const | vecRdot, | ||
| double * | nodeForces | ||
| ) |
StateUpdate is to be called when the next time step is happening
| posA | (dim: 3) |
| velA | (dim: 3) |
| vecB | (dim: 3N) |
| vecR | (dim: 3N) |
| vecBdot | (dim: 3N) |
| vecRdot | (dim: 3N) |
| nodeForces | (dim: 6N)) |