FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
CDerivative.h
1#ifndef CDerivative_H
2#define CDerivative_H
3
64#include <fhsim/simobject/SimObject.h>
65#include "SignalBlock.h"
66
67#include <string>
68#include <vector>
69
71{
72 public:
74 CDerivative(std::string sSimObjectName, ISimObjectCreator* pCreator);
76
77 void OdeFcn(const double dT, const double* const adX, double* const adXDot) const { }
78
79 const double* Output(const double T, const double* const X);
80
81 void AcceptedStep(const double T, const double* const X) override;
82
83
84 protected:
85 ISignalPort* m_Input;
86
87
88
89 std::vector<double> m_LastStepInput;
90 std::vector<double> m_LastDerivative;
93
95 void StartHistory(const double T, const double* const In);
96};
97
98
99#endif
Definition CDerivative.h:71
double m_LastStepTime
The time of the last accepted step (the start time before the first step).
Definition CDerivative.h:91
std::vector< double > m_LastDerivative
The difference over the last accepted step.
Definition CDerivative.h:90
CDerivative(std::string sSimObjectName, ISimObjectCreator *pCreator)
Constructor.
std::vector< double > m_LastStepInput
The input at the last accepted step.
Definition CDerivative.h:89
void StartHistory(const double T, const double *const In)
Sets the memory to the input In at time T, with derivative 0.
bool m_HasHistory
False until the first evaluation, which is at the start time.
Definition CDerivative.h:92
Definition SignalBlock.h:18