Marine systems simulation
TrawlBeam.h
1#pragma once
9#include <SimObject.h>
10#include <string>
11#include <Eigen/Eigen>
12using namespace Eigen;
13
14
15class TrawlBeam : public SimObject {
16 public:
17 TrawlBeam(const std::string& simObjectName, ISimObjectCreator* const creator);
18 void InitialConditionSetup(const double T, const double *const currentIC, double* const updatedIC, ISimObjectCreator* const creator);
19 void FinalSetup(const double T, const double *const X, ISimObjectCreator* const creator);
20 virtual void OdeFcn(const double T, const double* const X, double* const XDot, const bool bIsMajorTimeStep);
21 virtual void PreOdeFcn(const double T, const double *const X, IStateUpdater* updater);
22
23#ifdef FH_VISUALIZATION
25 virtual void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator) {}
27 virtual void RenderUpdate(const double T, const double* const X) {}
28#endif
29
30 const double* ShipForce(const double T, const double *const X);
31 const double* Error(const double T, const double *const X);
32 const double* ErrorI(const double T, const double *const X);
33 const double* ErrorD(const double T, const double *const X);
34 const double* StateDist(const double T, const double *const X);
35 const double* StateVel(const double T, const double *const X);
36 const double* PositionNED(const double T, const double *const X, int index);
37 const double* VelocityNED(const double T, const double *const X, int index);
38
39 protected:
40 ISignalPort *m_inForceStbd, *m_inForcePort;
41
42 void compute(const double T, const double* const X);
43 ICommonComputation *m_compute;
44
45 double m_position[6];
46 double m_velocity[6];
47
48 int m_stateTravel;
49 int m_stateVel;
50
51 int m_stateIError;
52 int m_stateDError;
53
54 bool m_saturation;
55 double m_forceSaturation;
56
57 double m_kp, m_kd, m_ki;
58 double m_kd_T;
59
60 double m_outError;
61 double m_outForce;
62 double m_direction;
63 double m_speedTravel;
64 double m_beamLength;
65
66 double m_mass;
67 double m_power;
68
69};
Definition: TrawlBeam.h:15
void InitialConditionSetup(const double T, const double *const currentIC, double *const updatedIC, ISimObjectCreator *const creator)
reads parameters, registers states, input/output ports and shared resources
virtual void PreOdeFcn(const double T, const double *const X, IStateUpdater *updater)
returns object derivatives as a function of time, states and input ports