OpenFAST
Wind turbine multiphysics simulator
Functions/Subroutines | Variables
servodyn Module Reference

Control and electrical drive dynamics module for FAST. More...

Functions/Subroutines

subroutine, public srvd_init (InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOut, ErrStat, ErrMsg)
 This routine is called at the start of the simulation to perform initialization steps. More...
 
subroutine, public srvd_end (u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg)
 This routine is called at the end of the simulation. More...
 
subroutine, public srvd_updatestates (t, n, Inputs, InputTimes, p, x, xd, z, OtherState, m, ErrStat, ErrMsg)
 This is a loose coupling routine for solving constraint states, integrating continuous states, and updating discrete and other states. More...
 
subroutine dll_controller_call (t, u, p, x, xd, z, OtherState, m, ErrStat, ErrMsg)
 Routine for deciding if Bladed-style DLL controller should be called. More...
 
subroutine, public srvd_calcoutput (t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg)
 Routine for computing outputs, used in both loose and tight coupling. More...
 
subroutine, public srvd_calccontstatederiv (t, u, p, x, xd, z, OtherState, m, dxdt, ErrStat, ErrMsg)
 Tight coupling routine for computing derivatives of continuous states. More...
 
subroutine, public srvd_updatediscstate (t, u, p, x, xd, z, OtherState, m, ErrStat, ErrMsg)
 Tight coupling routine for updating discrete states. More...
 
subroutine, public srvd_calcconstrstateresidual (t, u, p, x, xd, z, OtherState, m, z_residual, ErrStat, ErrMsg)
 Tight coupling routine for solving for the residual of the constraint state equations. More...
 
subroutine, public srvd_jacobianpinput (t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg, dYdu, dXdu, dXddu, dZdu)
 Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions with respect to the inputs (u). More...
 
subroutine, public srvd_jacobianpcontstate (t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg, dYdx, dXdx, dXddx, dZdx)
 Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions with respect to the continuous states (x). More...
 
subroutine, public srvd_jacobianpdiscstate (t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg, dYdxd, dXdxd, dXddxd, dZdxd)
 Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions with respect to the discrete states (xd). More...
 
subroutine, public srvd_jacobianpconstrstate (t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg, dYdz, dXdz, dXddz, dZdz)
 Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions with respect to the constraint states (z). More...
 
subroutine, public srvd_getop (t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg, u_op, y_op, x_op, dx_op, xd_op, z_op)
 Routine to pack the data structures representing the operating points into arrays for linearization. More...
 
subroutine srvd_readinput (InitInp, InputFileData, Default_DT, OutFileRoot, ErrStat, ErrMsg)
 This subroutine reads the input file and stores all the data in the SrvD_InputFile structure. More...
 
subroutine readprimaryfile (InitInp, InputFileData, OutFileRoot, UnEc, ErrStat, ErrMsg)
 This routine reads in the primary ServoDyn input file and places the values it reads in the InputFileData structure. More...
 
subroutine validateprimarydata (InitInp, InputFileData, ErrStat, ErrMsg)
 This routine validates the inputs from the primary input file. More...
 
subroutine srvd_setparameters (InputFileData, p, ErrStat, ErrMsg)
 This subroutine sets the parameters, based on the data stored in InputFileData. More...
 
subroutine yaw_calcoutput (t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg)
 Routine for computing the yaw output: a yaw moment. More...
 
subroutine calculatestandardyaw (t, u, p, m, YawPosCom, YawRateCom, YawPosComInt, ErrStat, ErrMsg)
 Routine that calculates standard yaw position and rate commands: YawPosCom and YawRateCom. More...
 
subroutine yaw_updatestates (t, u, p, x, xd, z, OtherState, m, ErrStat, ErrMsg)
 This routine updates the other states associated with the yaw controller: BegYawMan, NacYawI, and TYawManE. More...
 
subroutine pitch_calcoutput (t, u, p, x, xd, z, OtherState, BlPitchCom, ElecPwr, m, ErrStat, ErrMsg)
 Routine for computing the pitch output: blade pitch commands. More...
 
subroutine pitch_updatestates (t, u, p, x, xd, z, OtherState, m, ErrStat, ErrMsg)
 This routine updates the continuous and other states associated with the pitch controller: BegPitMan, BlPitchI, and TPitManE. More...
 
subroutine setoutparam (OutList, p, ErrStat, ErrMsg)
 This routine checks to see if any requested output channel names (stored in the OutList(:)) are invalid. More...
 
subroutine tipbrake_calcoutput (t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg)
 Routine for computing the tip-brake output: TBDrCon. More...
 
real(reki) function tbfract (t, BrakStrt, BrakEnd)
 A math S-function for the fraction of tip brake drag between normal and fully deployed operation. More...
 
subroutine tipbrake_updatestates (t, u, p, x, xd, z, OtherState, m, ErrStat, ErrMsg)
 This routine updates the other states of the tip brakes: BegTpBr, TTpBrDp, and TTpBrFl. More...
 
subroutine torque_calcoutput (t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg)
 This routine calculates the drive-train torque outputs: GenTrq, ElecPwr, and HSSBrTrqC. More...
 
subroutine torque_updatestates (t, u, p, x, xd, z, OtherState, m, ErrStat, ErrMsg)
 This routine updates the other states of the torque control: GenOnLine, and Off4Good. More...
 
subroutine calculatetorque (t, u, p, m, GenTrq, ElecPwr, ErrStat, ErrMsg)
 This routine calculates the drive-train torque (GenTrq, ElecPwr) assuming the generator is on. More...
 
real(reki) function calculateelecpwr (GenTrq, u, p)
 This routine calculates the electrical power (ElecPwr) after the electrical generator torque (GenTrq) has been calculated. More...
 
subroutine torque_jacobianpinput (t, u, p, x, xd, z, OtherState, m, GenTrq_du, ElecPwr_du, ErrStat, ErrMsg)
 This routine calculates the partials with respect to inputs of the drive-train torque outputs: GenTrq and ElecPwr. More...
 
subroutine calculatetorquejacobian (t, u, p, m, GenTrq_du, ElecPwr_du, ErrStat, ErrMsg)
 This routine calculates jacobians (with respect to uHSS_Spd) of the drive-train torque (GenTrq, ElecPwr) assuming the generator is on. More...
 

Variables

type(progdesc), parameter srvd_ver = ProgDesc( 'ServoDyn', '', '' )
 
logical, parameter, public cmpl4sfun = .TRUE.
 
logical, parameter, public cmpl4lv = .TRUE.
 
integer, parameter indx_u_yaw = 1
 
integer, parameter indx_u_yawrate = 2
 
integer, parameter indx_u_hss_spd = 3
 
integer, dimension(3), parameter, public srvd_indx_y_blpitchcom = (/1,2,3/)
 
integer, parameter, public srvd_indx_y_yawmom = 4
 
integer, parameter, public srvd_indx_y_gentrq = 5
 
integer, parameter, public srvd_indx_y_elecpwr = 6
 
integer, parameter, public srvd_indx_y_wroutput = 6
 
integer(intki), parameter outstrlenm1 = ChanLen - 1
 
integer(intki), parameter time = 0
 
integer(intki), parameter blpitchc1 = 1
 
integer(intki), parameter blpitchc2 = 2
 
integer(intki), parameter blpitchc3 = 3
 
integer(intki), parameter gentq = 4
 
integer(intki), parameter genpwr = 5
 
integer(intki), parameter hssbrtqc = 6
 
integer(intki), parameter yawmomcom = 7
 
integer(intki), parameter ntmd_xq = 8
 
integer(intki), parameter ntmd_xqd = 9
 
integer(intki), parameter ntmd_yq = 10
 
integer(intki), parameter ntmd_yqd = 11
 
integer(intki), parameter ttmd_xq = 12
 
integer(intki), parameter ttmd_xqd = 13
 
integer(intki), parameter ttmd_yq = 14
 
integer(intki), parameter ttmd_yqd = 15
 
integer(intki), parameter blairflc1 = 16
 
integer(intki), parameter blairflc2 = 17
 
integer(intki), parameter blairflc3 = 18
 
integer(intki), parameter maxoutpts = 18
 
integer(intki), dimension(3), parameter blpitchc = (/ BlPitchC1, BlPitchC2, BlPitchC3 /)
 
integer(intki), dimension(3), parameter blairfoilc = (/ BlAirFlC1, BlAirFlC2, BlAirFlC3 /)
 
integer(intki), parameter controlmode_none = 0
 The (ServoDyn-universal) control code for not using a particular type of control.
 
integer(intki), parameter controlmode_simple = 1
 The (ServoDyn-universal) control code for obtaining the control values from a simple built-in controller.
 
integer(intki), parameter controlmode_advanced = 2
 The (ServoDyn-universal) control code for not using the control values from an advanced built-in controller (or just a different simple model?)
 
integer(intki), parameter controlmode_user = 3
 The (ServoDyn-universal) control code for obtaining the control values from a user-defined routine.
 
integer(intki), parameter controlmode_extern = 4
 The (ServoDyn-universal) control code for obtaining the control values from Simulink or Labivew.
 
integer(intki), parameter controlmode_dll = 5
 The (ServoDyn-universal) control code for obtaining the control values from a Bladed-Style dynamic-link library.
 
integer(intki), parameter, public trimcase_none = 0
 
integer(intki), parameter, public trimcase_yaw = 1
 
integer(intki), parameter, public trimcase_torque = 2
 
integer(intki), parameter, public trimcase_pitch = 3
 

Detailed Description

Control and electrical drive dynamics module for FAST.

Function/Subroutine Documentation

◆ calculateelecpwr()

real(reki) function servodyn::calculateelecpwr ( real(reki), intent(in)  GenTrq,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p 
)
private

This routine calculates the electrical power (ElecPwr) after the electrical generator torque (GenTrq) has been calculated.

Parameters
[in]gentrqgenerator torque computed at t
[in]uInputs at t
[in]pParameters
Returns
The result of this function

◆ calculatestandardyaw()

subroutine servodyn::calculatestandardyaw ( real(dbki), intent(in)  t,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p,
type(srvd_miscvartype), intent(inout)  m,
real(reki), intent(out)  YawPosCom,
real(reki), intent(out)  YawRateCom,
real(reki), intent(inout)  YawPosComInt,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

Routine that calculates standard yaw position and rate commands: YawPosCom and YawRateCom.

Parameters
[in]tCurrent simulation time in seconds
[in]uInputs at t
[in]pParameters
[in,out]mMisc (optimization) variables
[out]yawposcomCommanded yaw angle from user-defined routines, rad.
[out]yawratecomCommanded yaw rate from user-defined routines, rad/s.
[in,out]yawposcomintInternal variable that integrates the commanded yaw rate and passes it to YawPosCom
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ calculatetorque()

subroutine servodyn::calculatetorque ( real(dbki), intent(in)  t,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p,
type(srvd_miscvartype), intent(inout)  m,
real(reki), intent(out)  GenTrq,
real(reki), intent(out)  ElecPwr,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine calculates the drive-train torque (GenTrq, ElecPwr) assuming the generator is on.

Parameters
[in]tCurrent simulation time in seconds
[in]uInputs at t
[in]pParameters
[in,out]mMisc (optimization) variables
[out]gentrqgenerator torque command
[out]elecpwrelectrical power
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ calculatetorquejacobian()

subroutine servodyn::calculatetorquejacobian ( real(dbki), intent(in)  t,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p,
type(srvd_miscvartype), intent(inout)  m,
real(r8ki), intent(out)  GenTrq_du,
real(r8ki), intent(out)  ElecPwr_du,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine calculates jacobians (with respect to uHSS_Spd) of the drive-train torque (GenTrq, ElecPwr) assuming the generator is on.

Parameters
[in]tCurrent simulation time in seconds
[in]uInputs at t
[in]pParameters
[in,out]mMisc (optimization) variables
[out]gentrq_dupartial generator torque / partial uHSS_Spd
[out]elecpwr_dupartialelectrical power / partial uHSS_Spd
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ dll_controller_call()

subroutine servodyn::dll_controller_call ( real(dbki), intent(in)  t,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p,
type(srvd_continuousstatetype), intent(in)  x,
type(srvd_discretestatetype), intent(in)  xd,
type(srvd_constraintstatetype), intent(in)  z,
type(srvd_otherstatetype), intent(in)  OtherState,
type(srvd_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

Routine for deciding if Bladed-style DLL controller should be called.

Parameters
[in]tCurrent simulation time in seconds
[in]uInputs at t
[in]pParameters
[in]xContinuous states at t
[in]xdDiscrete states at t
[in]zConstraint states at t
[in]otherstateOther states at t
[in,out]mMisc (optimization) variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ pitch_calcoutput()

subroutine servodyn::pitch_calcoutput ( real(dbki), intent(in)  t,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p,
type(srvd_continuousstatetype), intent(in)  x,
type(srvd_discretestatetype), intent(in)  xd,
type(srvd_constraintstatetype), intent(in)  z,
type(srvd_otherstatetype), intent(in)  OtherState,
real(reki), dimension(:), intent(inout)  BlPitchCom,
real(reki), intent(in)  ElecPwr,
type(srvd_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

Routine for computing the pitch output: blade pitch commands.

This routine is used in both loose and tight coupling.

Parameters
[in]tCurrent simulation time in seconds
[in]uInputs at t
[in]pParameters
[in]xContinuous states at t
[in]xdDiscrete states at t
[in]zConstraint states at t
[in]otherstateOther states at t
[in,out]blpitchcompitch outputs computed at t (Input only so that mesh con- nectivity information does not have to be recalculated)
[in]elecpwrElectrical power (watts)
[in,out]mMisc (optimization) variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ pitch_updatestates()

subroutine servodyn::pitch_updatestates ( real(dbki), intent(in)  t,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p,
type(srvd_continuousstatetype), intent(inout)  x,
type(srvd_discretestatetype), intent(inout)  xd,
type(srvd_constraintstatetype), intent(inout)  z,
type(srvd_otherstatetype), intent(inout)  OtherState,
type(srvd_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine updates the continuous and other states associated with the pitch controller: BegPitMan, BlPitchI, and TPitManE.

Parameters
[in]tt+dt
[in]uInputs at t+dt
[in]pParameters
[in,out]xInput: Continuous states at t; Output: Continuous states at t + dt
[in,out]xdInput: Discrete states at t; Output: Discrete states at t + dt
[in,out]zInput: Constraint states at t; Output: Constraint states at t + dt
[in,out]otherstateOther states: Other states at t; Output: Other states at t + dt
[in,out]mMisc (optimization) variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ readprimaryfile()

subroutine servodyn::readprimaryfile ( type(srvd_initinputtype), intent(in)  InitInp,
type(srvd_inputfile), intent(inout)  InputFileData,
character(*), intent(in)  OutFileRoot,
integer(intki), intent(out)  UnEc,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine reads in the primary ServoDyn input file and places the values it reads in the InputFileData structure.

It opens and prints to an echo file if requested.

Parameters
[out]unecI/O unit for echo file. If > 0, file is open for writing.
[out]errstatError status
[in]initinpInput data for initialization routine
[out]errmsgError message
[in]outfilerootThe rootname of the echo file, possibly opened in this routine
[in,out]inputfiledataAll the data in the ServoDyn input file

◆ setoutparam()

subroutine servodyn::setoutparam ( character(chanlen), dimension(:), intent(in)  OutList,
type(srvd_parametertype), intent(inout)  p,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine checks to see if any requested output channel names (stored in the OutList(:)) are invalid.

It returns a warning if any of the channels are not available outputs from the module. It assigns the settings for OutParam(:) (i.e, the index, name, and units of the output channels, WriteOutput(:)). the sign is set to 0 if the channel is invalid. It sets assumes the value pNumOuts has been set before this routine has been called, and it sets the values of pOutParam here.

◆ srvd_calcconstrstateresidual()

subroutine, public servodyn::srvd_calcconstrstateresidual ( real(dbki), intent(in)  t,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p,
type(srvd_continuousstatetype), intent(in)  x,
type(srvd_discretestatetype), intent(in)  xd,
type(srvd_constraintstatetype), intent(in)  z,
type(srvd_otherstatetype), intent(in)  OtherState,
type(srvd_miscvartype), intent(inout)  m,
type(srvd_constraintstatetype), intent(out)  z_residual,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

Tight coupling routine for solving for the residual of the constraint state equations.

Parameters
[in]tCurrent simulation time in seconds
[in]uInputs at t
[in]pParameters
[in]xContinuous states at t
[in]xdDiscrete states at t
[in]zConstraint states at t (possibly a guess)
[in]otherstateOther states at t
[in,out]mMisc (optimization) variables
[out]z_residualResidual of the constraint state equations using the input values described above
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ srvd_calccontstatederiv()

subroutine, public servodyn::srvd_calccontstatederiv ( real(dbki), intent(in)  t,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p,
type(srvd_continuousstatetype), intent(in)  x,
type(srvd_discretestatetype), intent(in)  xd,
type(srvd_constraintstatetype), intent(in)  z,
type(srvd_otherstatetype), intent(in)  OtherState,
type(srvd_miscvartype), intent(inout)  m,
type(srvd_continuousstatetype), intent(out)  dxdt,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

Tight coupling routine for computing derivatives of continuous states.

Parameters
[in]tCurrent simulation time in seconds
[in]uInputs at t
[in]pParameters
[in]xContinuous states at t
[in]xdDiscrete states at t
[in]zConstraint states at t
[in]otherstateOther states at t
[in,out]mMisc (optimization) variables
[out]dxdtContinuous state derivatives at t
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ srvd_calcoutput()

subroutine, public servodyn::srvd_calcoutput ( real(dbki), intent(in)  t,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p,
type(srvd_continuousstatetype), intent(in)  x,
type(srvd_discretestatetype), intent(in)  xd,
type(srvd_constraintstatetype), intent(in)  z,
type(srvd_otherstatetype), intent(in)  OtherState,
type(srvd_outputtype), intent(inout)  y,
type(srvd_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

Routine for computing outputs, used in both loose and tight coupling.

Parameters
[in]tCurrent simulation time in seconds
[in]uInputs at t
[in]pParameters
[in]xContinuous states at t
[in]xdDiscrete states at t
[in]zConstraint states at t
[in]otherstateOther states at t
[in,out]yOutputs computed at t (Input only so that mesh con- nectivity information does not have to be recalculated)
[in,out]mMisc (optimization) variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ srvd_end()

subroutine, public servodyn::srvd_end ( type(srvd_inputtype), intent(inout)  u,
type(srvd_parametertype), intent(inout)  p,
type(srvd_continuousstatetype), intent(inout)  x,
type(srvd_discretestatetype), intent(inout)  xd,
type(srvd_constraintstatetype), intent(inout)  z,
type(srvd_otherstatetype), intent(inout)  OtherState,
type(srvd_outputtype), intent(inout)  y,
type(srvd_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine is called at the end of the simulation.

Parameters
[in,out]uSystem inputs
[in,out]pParameters
[in,out]xContinuous states
[in,out]xdDiscrete states
[in,out]zConstraint states
[in,out]otherstateOther states
[in,out]ySystem outputs
[in,out]mInitial misc (optimization) variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ srvd_getop()

subroutine, public servodyn::srvd_getop ( real(dbki), intent(in)  t,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p,
type(srvd_continuousstatetype), intent(in)  x,
type(srvd_discretestatetype), intent(in)  xd,
type(srvd_constraintstatetype), intent(in)  z,
type(srvd_otherstatetype), intent(in)  OtherState,
type(srvd_outputtype), intent(in)  y,
type(srvd_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
real(reki), dimension(:), intent(inout), optional, allocatable  u_op,
real(reki), dimension(:), intent(inout), optional, allocatable  y_op,
real(reki), dimension(:), intent(inout), optional, allocatable  x_op,
real(reki), dimension(:), intent(inout), optional, allocatable  dx_op,
real(reki), dimension(:), intent(inout), optional, allocatable  xd_op,
real(reki), dimension(:), intent(inout), optional, allocatable  z_op 
)

Routine to pack the data structures representing the operating points into arrays for linearization.

Parameters
[in]tTime in seconds at operating point
[in]uInputs at operating point (may change to inout if a mesh copy is required)
[in]pParameters
[in]xContinuous states at operating point
[in]xdDiscrete states at operating point
[in]zConstraint states at operating point
[in]otherstateOther states at operating point
[in]yOutput at operating point
[in,out]mMisc/optimization variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None
[in,out]u_opvalues of linearized inputs
[in,out]y_opvalues of linearized outputs
[in,out]x_opvalues of linearized continuous states
[in,out]dx_opvalues of first time derivatives of linearized continuous states
[in,out]xd_opvalues of linearized discrete states
[in,out]z_opvalues of linearized constraint states

◆ srvd_init()

subroutine, public servodyn::srvd_init ( type(srvd_initinputtype), intent(in)  InitInp,
type(srvd_inputtype), intent(out)  u,
type(srvd_parametertype), intent(out)  p,
type(srvd_continuousstatetype), intent(out)  x,
type(srvd_discretestatetype), intent(out)  xd,
type(srvd_constraintstatetype), intent(out)  z,
type(srvd_otherstatetype), intent(out)  OtherState,
type(srvd_outputtype), intent(out)  y,
type(srvd_miscvartype), intent(out)  m,
real(dbki), intent(inout)  Interval,
type(srvd_initoutputtype), intent(out)  InitOut,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This routine is called at the start of the simulation to perform initialization steps.

The parameters are set here and not changed during the simulation. The initial states and initial guess for the input are defined.

Parameters
[in]initinpInput data for initialization routine
[out]uAn initial guess for the input; input mesh must be defined
[out]pParameters
[out]xInitial continuous states
[out]xdInitial discrete states
[out]zInitial guess of the constraint states
[out]otherstateInitial other states
[out]yInitial system outputs (outputs are not calculated; only the output mesh is initialized)
[out]mInitial misc (optimization) variables
[in,out]intervalCoupling interval in seconds: the rate that (1) SrvD_UpdateStates() is called in loose coupling & (2) SrvD_UpdateDiscState() is called in tight coupling. Input is the suggested time from the glue code; Output is the actual coupling interval that will be used by the glue code.
[out]initoutOutput for initialization routine
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ srvd_jacobianpconstrstate()

subroutine, public servodyn::srvd_jacobianpconstrstate ( real(dbki), intent(in)  t,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p,
type(srvd_continuousstatetype), intent(in)  x,
type(srvd_discretestatetype), intent(in)  xd,
type(srvd_constraintstatetype), intent(in)  z,
type(srvd_otherstatetype), intent(in)  OtherState,
type(srvd_outputtype), intent(in)  y,
type(srvd_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dYdz,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dXdz,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dXddz,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dZdz 
)

Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions with respect to the constraint states (z).

The partial derivatives dY/dz, dX/dz, dXd/dz, and DZ/dz are returned. Note SrvD does not have constraint states, so these are not set.

Parameters
[in]tTime in seconds at operating point
[in]uInputs at operating point (may change to inout if a mesh copy is required)
[in]pParameters
[in]xContinuous states at operating point
[in]xdDiscrete states at operating point
[in]zConstraint states at operating point
[in]otherstateOther states at operating point
[in]yOutput (change to inout if a mesh copy is required); Output fields are not used by this routine, but type is available here so that mesh parameter information (i.e., connectivity) does not have to be recalculated for dYdz.
[in,out]mMisc/optimization variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None
[in,out]dydzPartial derivatives of output functions (Y) with respect to the constraint states (z) [intent in to avoid deallocation]
[in,out]dxdzPartial derivatives of continuous state functions (X) with respect to the constraint states (z) [intent in to avoid deallocation]
[in,out]dxddzPartial derivatives of discrete state functions (Xd) with respect to the constraint states (z) [intent in to avoid deallocation]
[in,out]dzdzPartial derivatives of constraint state functions (Z) with respect to the constraint states (z) [intent in to avoid deallocation]

◆ srvd_jacobianpcontstate()

subroutine, public servodyn::srvd_jacobianpcontstate ( real(dbki), intent(in)  t,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p,
type(srvd_continuousstatetype), intent(in)  x,
type(srvd_discretestatetype), intent(in)  xd,
type(srvd_constraintstatetype), intent(in)  z,
type(srvd_otherstatetype), intent(in)  OtherState,
type(srvd_outputtype), intent(in)  y,
type(srvd_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dYdx,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dXdx,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dXddx,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dZdx 
)

Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions with respect to the continuous states (x).

The partial derivatives dY/dx, dX/dx, dXd/dx, and DZ/dx are returned. Note SrvD does not have continuous states, so these are not set.

Parameters
[in]tTime in seconds at operating point
[in]uInputs at operating point (may change to inout if a mesh copy is required)
[in]pParameters
[in]xContinuous states at operating point
[in]xdDiscrete states at operating point
[in]zConstraint states at operating point
[in]otherstateOther states at operating point
[in]yOutput (change to inout if a mesh copy is required); Output fields are not used by this routine, but type is available here so that mesh parameter information (i.e., connectivity) does not have to be recalculated for dYdx.
[in,out]mMisc/optimization variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None
[in,out]dydxPartial derivatives of output functions (Y) with respect to the continuous states (x) [intent in to avoid deallocation]
[in,out]dxdxPartial derivatives of continuous state functions (X) with respect to the continuous states (x) [intent in to avoid deallocation]
[in,out]dxddxPartial derivatives of discrete state functions (Xd) with respect to the continuous states (x) [intent in to avoid deallocation]
[in,out]dzdxPartial derivatives of constraint state functions (Z) with respect to the continuous states (x) [intent in to avoid deallocation]

◆ srvd_jacobianpdiscstate()

subroutine, public servodyn::srvd_jacobianpdiscstate ( real(dbki), intent(in)  t,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p,
type(srvd_continuousstatetype), intent(in)  x,
type(srvd_discretestatetype), intent(in)  xd,
type(srvd_constraintstatetype), intent(in)  z,
type(srvd_otherstatetype), intent(in)  OtherState,
type(srvd_outputtype), intent(in)  y,
type(srvd_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dYdxd,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dXdxd,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dXddxd,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dZdxd 
)

Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions with respect to the discrete states (xd).

The partial derivatives dY/dxd, dX/dxd, dXd/dxd, and DZ/dxd are returned. Note SrvD does not have discrete states, so these are not set.

Parameters
[in]tTime in seconds at operating point
[in]uInputs at operating point (may change to inout if a mesh copy is required)
[in]pParameters
[in]xContinuous states at operating point
[in]xdDiscrete states at operating point
[in]zConstraint states at operating point
[in]otherstateOther states at operating point
[in]yOutput (change to inout if a mesh copy is required); Output fields are not used by this routine, but type is available here so that mesh parameter information (i.e., connectivity) does not have to be recalculated for dYdxd.
[in,out]mMisc/optimization variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None
[in,out]dydxdPartial derivatives of output functions (Y) with respect to the discrete states (xd) [intent in to avoid deallocation]
[in,out]dxdxdPartial derivatives of continuous state functions (X) with respect to the discrete states (xd) [intent in to avoid deallocation]
[in,out]dxddxdPartial derivatives of discrete state functions (Xd) with respect to the discrete states (xd) [intent in to avoid deallocation]
[in,out]dzdxdPartial derivatives of constraint state functions (Z) with respect to the discrete states (xd) [intent in to avoid deallocation]

◆ srvd_jacobianpinput()

subroutine, public servodyn::srvd_jacobianpinput ( real(dbki), intent(in)  t,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p,
type(srvd_continuousstatetype), intent(in)  x,
type(srvd_discretestatetype), intent(in)  xd,
type(srvd_constraintstatetype), intent(in)  z,
type(srvd_otherstatetype), intent(in)  OtherState,
type(srvd_outputtype), intent(in)  y,
type(srvd_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dYdu,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dXdu,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dXddu,
real(r8ki), dimension(:,:), intent(inout), optional, allocatable  dZdu 
)

Routine to compute the Jacobians of the output (Y), continuous- (X), discrete- (Xd), and constraint-state (Z) functions with respect to the inputs (u).

The partial derivative dY/du is returned.

Parameters
[in]tTime in seconds at operating point
[in]uInputs at operating point (may change to inout if a mesh copy is required)
[in]pParameters
[in]xContinuous states at operating point
[in]xdDiscrete states at operating point
[in]zConstraint states at operating point
[in]otherstateOther states at operating point
[in]yOutput (change to inout if a mesh copy is required); Output fields are not used by this routine, but type is available here so that mesh parameter information (i.e., connectivity) does not have to be recalculated for dYdu.
[in,out]mMisc/optimization variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None
[in,out]dyduPartial derivatives of output functions (Y) with respect to the inputs (u) [intent in to avoid deallocation]
[in,out]dxduPartial derivatives of continuous state functions (X) with respect to inputs (u) [intent in to avoid deallocation]
[in,out]dxdduPartial derivatives of discrete state functions (Xd) with respect to inputs (u) [intent in to avoid deallocation]
[in,out]dzduPartial derivatives of constraint state functions (Z) with respect to inputs (u) [intent in to avoid deallocation]

\begin{equation} \frac{\partial Y}{\partial u} = \begin{bmatrix} \frac{\partial Y_{BlPitchCom_1}}{\partial u_{Yaw}} & \frac{\partial Y_{BlPitchCom_1}}{\partial u_{YawRate}} & \frac{\partial Y_{BlPitchCom_1}}{\partial u_{HSS\_Spd}} \\ \frac{\partial Y_{BlPitchCom_2}}{\partial u_{Yaw}} & \frac{\partial Y_{BlPitchCom_2}}{\partial u_{YawRate}} & \frac{\partial Y_{BlPitchCom_2}}{\partial u_{HSS\_Spd}} \\ \frac{\partial Y_{BlPitchCom_3}}{\partial u_{Yaw}} & \frac{\partial Y_{BlPitchCom_3}}{\partial u_{YawRate}} & \frac{\partial Y_{BlPitchCom_3}}{\partial u_{HSS\_Spd}} \\ \frac{\partial Y_{YawMom}}{\partial u_{Yaw}} & \frac{\partial Y_{YawMom}}{\partial u_{YawRate}} & \frac{\partial Y_{YawMom}}{\partial u_{HSS\_Spd}} \\ \frac{\partial Y_{GenTrq}}{\partial u_{Yaw}} & \frac{\partial Y_{GenTrq}}{\partial u_{YawRate}} & \frac{\partial Y_{GenTrq}}{\partial u_{HSS\_Spd}} \\ \frac{\partial Y_{ElecPwr}}{\partial u_{Yaw}} & \frac{\partial Y_{ElecPwr}}{\partial u_{YawRate}} & \frac{\partial Y_{ElecPwr}}{\partial u_{HSS\_Spd}} \\ \frac{\partial Y_{WriteOutput_i}}{\partial u_{Yaw}} & \frac{\partial Y_{WriteOutput_i}}{\partial u_{YawRate}} & \frac{\partial Y_{WriteOutput_i}}{\partial u_{HSS\_Spd}} \end{bmatrix} = \begin{bmatrix} 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ \frac{\partial Y_{YawMom}}{\partial u_{Yaw}} & \frac{\partial Y_{YawMom}}{\partial u_{YawRate}} & 0 \\ 0 & 0 & \frac{\partial Y_{GenTrq}}{\partial u_{HSS\_Spd}} \\ 0 & 0 & \frac{\partial Y_{ElecPwr}}{\partial u_{HSS\_Spd}} \\ \frac{\partial Y_{WriteOutput_i}}{\partial u_{Yaw}} & \frac{\partial Y_{WriteOutput_i}}{\partial u_{YawRate}} & \frac{\partial Y_{WriteOutput_i}}{\partial u_{HSS\_Spd}} \end{bmatrix} \end{equation}

Compute \( \frac{\partial Y_{GenTrq}}{\partial u_{HSS\_Spd}} \) and \( \frac{\partial Y_{ElecPwr}}{\partial u_{HSS\_Spd}} \) in servodyn::torque_jacobianpinput.

\( \frac{\partial Y_{BlPitchCom_k}}{\partial u} = 0 \)

\( \frac{\partial Y_{YawMom}}{\partial u_{Yaw}} = -p\%YawSpr \)

\( \frac{\partial Y_{YawMom}}{\partial u_{YawRate}} = -p\%YawDamp \)

◆ srvd_readinput()

subroutine servodyn::srvd_readinput ( type(srvd_initinputtype), intent(in)  InitInp,
type(srvd_inputfile), intent(out)  InputFileData,
real(dbki), intent(in)  Default_DT,
character(*), intent(in)  OutFileRoot,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This subroutine reads the input file and stores all the data in the SrvD_InputFile structure.

It does not perform data validation.

Parameters
[in]initinpInput data for initialization routine
[in]default_dtThe default DT (from glue code)
[in]outfilerootThe rootname of all the output files written by this routine.
[out]inputfiledataData stored in the module's input file
[out]errstatThe error status code
[out]errmsgThe error message, if an error occurred

◆ srvd_setparameters()

subroutine servodyn::srvd_setparameters ( type(srvd_inputfile), intent(inout)  InputFileData,
type(srvd_parametertype), intent(inout)  p,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This subroutine sets the parameters, based on the data stored in InputFileData.

Parameters
[in,out]inputfiledataData stored in the module's input file (intent OUT for MOVE_ALLOC)
[in,out]pThe module's parameter data
[out]errstatThe error status code
[out]errmsgThe error message, if an error occurred

◆ srvd_updatediscstate()

subroutine, public servodyn::srvd_updatediscstate ( real(dbki), intent(in)  t,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p,
type(srvd_continuousstatetype), intent(in)  x,
type(srvd_discretestatetype), intent(inout)  xd,
type(srvd_constraintstatetype), intent(in)  z,
type(srvd_otherstatetype), intent(in)  OtherState,
type(srvd_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

Tight coupling routine for updating discrete states.

Parameters
[in]tCurrent simulation time in seconds
[in]uInputs at t
[in]pParameters
[in]xContinuous states at t
[in,out]xdInput: Discrete states at t; Output: Discrete states at t + Interval
[in]zConstraint states at t
[in]otherstateOther states at t
[in,out]mMisc (optimization) variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ srvd_updatestates()

subroutine, public servodyn::srvd_updatestates ( real(dbki), intent(in)  t,
integer(intki), intent(in)  n,
type(srvd_inputtype), dimension(:), intent(inout)  Inputs,
real(dbki), dimension(:), intent(in)  InputTimes,
type(srvd_parametertype), intent(in)  p,
type(srvd_continuousstatetype), intent(inout)  x,
type(srvd_discretestatetype), intent(inout)  xd,
type(srvd_constraintstatetype), intent(inout)  z,
type(srvd_otherstatetype), intent(inout)  OtherState,
type(srvd_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)

This is a loose coupling routine for solving constraint states, integrating continuous states, and updating discrete and other states.

Continuous, constraint, discrete, and other states are updated to values at t + Interval.

Parameters
[in]tCurrent simulation time in seconds
[in]nCurrent step of the simulation: t = n*Interval
[in,out]inputsInputs at InputTimes (output only for mesh record-keeping in ExtrapInterp routine)
[in]inputtimesTimes in seconds associated with Inputs
[in]pParameters
[in,out]xInput: Continuous states at t; Output: Continuous states at t + Interval
[in,out]xdInput: Discrete states at t; Output: Discrete states at t + Interval
[in,out]zInput: Constraint states at t; Output: Constraint states at t + Interval
[in,out]otherstateOther states: Other states at t; Output: Other states at t + Interval
[in,out]mMisc (optimization) variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ tbfract()

real(reki) function servodyn::tbfract ( real(dbki), intent(in)  t,
real(dbki), intent(in)  BrakStrt,
real(dbki), intent(in)  BrakEnd 
)
private

A math S-function for the fraction of tip brake drag between normal and fully deployed operation.

(This function was formerly part of RtHS.)

Parameters
[in]tCurrent time
[in]brakendTime at which brakes are fully deployed
[in]brakstrtTime at which brakes are first deployed
Returns
This function.

◆ tipbrake_calcoutput()

subroutine servodyn::tipbrake_calcoutput ( real(dbki), intent(in)  t,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p,
type(srvd_continuousstatetype), intent(in)  x,
type(srvd_discretestatetype), intent(in)  xd,
type(srvd_constraintstatetype), intent(in)  z,
type(srvd_otherstatetype), intent(in)  OtherState,
type(srvd_outputtype), intent(inout)  y,
type(srvd_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

Routine for computing the tip-brake output: TBDrCon.

This routine is used in both loose and tight coupling.

Parameters
[in]tCurrent simulation time in seconds
[in]uInputs at t
[in]pParameters
[in]xContinuous states at t
[in]xdDiscrete states at t
[in]zConstraint states at t
[in]otherstateOther states at t
[in,out]yOutputs computed at t (Input only so that mesh con- nectivity information does not have to be recalculated)
[in,out]mMisc (optimization) variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ tipbrake_updatestates()

subroutine servodyn::tipbrake_updatestates ( real(dbki), intent(in)  t,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p,
type(srvd_continuousstatetype), intent(inout)  x,
type(srvd_discretestatetype), intent(inout)  xd,
type(srvd_constraintstatetype), intent(inout)  z,
type(srvd_otherstatetype), intent(inout)  OtherState,
type(srvd_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine updates the other states of the tip brakes: BegTpBr, TTpBrDp, and TTpBrFl.

Parameters
[in]tt+dt
[in]uInputs at t+dt
[in]pParameters
[in,out]xInput: Continuous states at t; Output: Continuous states at t + dt
[in,out]xdInput: Discrete states at t; Output: Discrete states at t + dt
[in,out]zInput: Constraint states at t; Output: Constraint states at t + dt
[in,out]otherstateOther states: Other states at t; Output: Other states at t + dt
[in,out]mMisc (optimization) variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ torque_calcoutput()

subroutine servodyn::torque_calcoutput ( real(dbki), intent(in)  t,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p,
type(srvd_continuousstatetype), intent(in)  x,
type(srvd_discretestatetype), intent(in)  xd,
type(srvd_constraintstatetype), intent(in)  z,
type(srvd_otherstatetype), intent(in)  OtherState,
type(srvd_outputtype), intent(inout)  y,
type(srvd_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine calculates the drive-train torque outputs: GenTrq, ElecPwr, and HSSBrTrqC.

Parameters
[in]tCurrent simulation time in seconds
[in]uInputs at t
[in]pParameters
[in]xContinuous states at t
[in]xdDiscrete states at t
[in]zConstraint states at t
[in]otherstateOther states at t
[in,out]yOutputs computed at t (Input only so that mesh con- nectivity information does not have to be recalculated)
[in,out]mMisc (optimization) variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ torque_jacobianpinput()

subroutine servodyn::torque_jacobianpinput ( real(dbki), intent(in)  t,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p,
type(srvd_continuousstatetype), intent(in)  x,
type(srvd_discretestatetype), intent(in)  xd,
type(srvd_constraintstatetype), intent(in)  z,
type(srvd_otherstatetype), intent(in)  OtherState,
type(srvd_miscvartype), intent(inout)  m,
real(r8ki), intent(out)  GenTrq_du,
real(r8ki), intent(out)  ElecPwr_du,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine calculates the partials with respect to inputs of the drive-train torque outputs: GenTrq and ElecPwr.

Parameters
[in]tCurrent simulation time in seconds
[in]uInputs at t
[in]pParameters
[in]xContinuous states at t
[in]xdDiscrete states at t
[in]zConstraint states at t
[in]otherstateOther states at t
[in,out]mMisc (optimization) variables
[out]gentrq_dupartial derivative of generator torque output with respect to HSS_Spd input
[out]elecpwr_dupartial derivative of electrical power output with respect to HSS_Spd input
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ torque_updatestates()

subroutine servodyn::torque_updatestates ( real(dbki), intent(in)  t,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p,
type(srvd_continuousstatetype), intent(inout)  x,
type(srvd_discretestatetype), intent(inout)  xd,
type(srvd_constraintstatetype), intent(inout)  z,
type(srvd_otherstatetype), intent(inout)  OtherState,
type(srvd_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine updates the other states of the torque control: GenOnLine, and Off4Good.

Parameters
[in]tt+dt
[in]uInputs at t+dt
[in]pParameters
[in,out]xInput: Continuous states at t; Output: Continuous states at t + dt
[in,out]xdInput: Discrete states at t; Output: Discrete states at t + dt
[in,out]zInput: Constraint states at t; Output: Constraint states at t + dt
[in,out]otherstateOther states: Other states at t; Output: Other states at t + dt
[in,out]mMisc (optimization) variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ validateprimarydata()

subroutine servodyn::validateprimarydata ( type(srvd_initinputtype), intent(in)  InitInp,
type(srvd_inputfile), intent(in)  InputFileData,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine validates the inputs from the primary input file.

Parameters
[in]initinpInput data for initialization routine
[in]inputfiledataAll the data in the ServoDyn input file
[out]errstatError status
[out]errmsgError message

◆ yaw_calcoutput()

subroutine servodyn::yaw_calcoutput ( real(dbki), intent(in)  t,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p,
type(srvd_continuousstatetype), intent(in)  x,
type(srvd_discretestatetype), intent(in)  xd,
type(srvd_constraintstatetype), intent(in)  z,
type(srvd_otherstatetype), intent(in)  OtherState,
type(srvd_outputtype), intent(inout)  y,
type(srvd_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

Routine for computing the yaw output: a yaw moment.

This routine is used in both loose and tight coupling.

Parameters
[in]tCurrent simulation time in seconds
[in]uInputs at t
[in]pParameters
[in]xContinuous states at t
[in]xdDiscrete states at t
[in]zConstraint states at t
[in]otherstateOther states at t
[in,out]yOutputs computed at t (Input only so that mesh con- nectivity information does not have to be recalculated)
[in,out]mMisc (optimization) variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None

◆ yaw_updatestates()

subroutine servodyn::yaw_updatestates ( real(dbki), intent(in)  t,
type(srvd_inputtype), intent(in)  u,
type(srvd_parametertype), intent(in)  p,
type(srvd_continuousstatetype), intent(inout)  x,
type(srvd_discretestatetype), intent(inout)  xd,
type(srvd_constraintstatetype), intent(inout)  z,
type(srvd_otherstatetype), intent(inout)  OtherState,
type(srvd_miscvartype), intent(inout)  m,
integer(intki), intent(out)  ErrStat,
character(*), intent(out)  ErrMsg 
)
private

This routine updates the other states associated with the yaw controller: BegYawMan, NacYawI, and TYawManE.

Parameters
[in]tt+dt
[in]uInputs at t+dt
[in]pParameters
[in,out]xInput: Continuous states at t; Output: Continuous states at t + dt
[in,out]xdInput: Discrete states at t; Output: Discrete states at t + dt
[in,out]zInput: Constraint states at t; Output: Constraint states at t + dt
[in,out]otherstateOther states: Other states at t; Output: Other states at t + dt
[in,out]mMisc (optimization) variables
[out]errstatError status of the operation
[out]errmsgError message if ErrStat /= ErrID_None