The Calculator component reads DDS signal, makes calculations and publish the result as different DDS signals. The component includes some hard-coded functions to facilitate calculations which would be demanding to specify using the input file (or slow). This currently includes functionality related to propulsion calculations. An explaination to the file:
Options -> PeriodMs
is the period of the updates in milliseconds.Propulsion -> Propeller
and Propulsion -> Hull
specifies some particulars of the propeller and the hull.Constants
is a list of constant values which can be used in the expressions.InputSignals
is a list of DDS input signals which can be used in the expressions.OutputSignals
is a list of DDS signals to output.TempValues
is a list of variables with a initial value, which can be changed at will in the expressions and used for relaying values between expressions.Expressions
is a list of mathematical expressions which are to be evalueated for each time step. The values from each expression is available for all subsequent expressions. Expressions can be built-in propulsion functions or expressions interpretable by the muparser library.The signatures of the builtin functions are: - PropellerTorque_01(shipSpeed, propellerPith, propellerRpm)
returns the propeller torque in kNm. - PropellerThrust_01(shipSpeed, propellerPith, propellerRpm)
returns the propeller thrust in kN. - PropellerJetPower_01(shipSpeed, propellerPith, propellerRpm)
returns the power transferred to the propeller jet in kW. - PropellerEfficiency_01(shipSpeed, propellerPith, propellerRpm)
returns the propeller efficiency.
In these functions:
shipSpeed
is the speed of the ship, in m/s.propellerPith
si the propeller pitch as P/D.propellerRpm
is the propeller rotational speed in revolutions per minute.An example input file is shown below and in calculator.yml.