![]() |
OpenFAST
Wind turbine multiphysics simulator
|
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 |
Control and electrical drive dynamics module for FAST.
|
private |
This routine calculates the electrical power (ElecPwr) after the electrical generator torque (GenTrq) has been calculated.
[in] | gentrq | generator torque computed at t |
[in] | u | Inputs at t |
[in] | p | Parameters |
|
private |
Routine that calculates standard yaw position and rate commands: YawPosCom and YawRateCom.
[in] | t | Current simulation time in seconds |
[in] | u | Inputs at t |
[in] | p | Parameters |
[in,out] | m | Misc (optimization) variables |
[out] | yawposcom | Commanded yaw angle from user-defined routines, rad. |
[out] | yawratecom | Commanded yaw rate from user-defined routines, rad/s. |
[in,out] | yawposcomint | Internal variable that integrates the commanded yaw rate and passes it to YawPosCom |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This routine calculates the drive-train torque (GenTrq, ElecPwr) assuming the generator is on.
[in] | t | Current simulation time in seconds |
[in] | u | Inputs at t |
[in] | p | Parameters |
[in,out] | m | Misc (optimization) variables |
[out] | gentrq | generator torque command |
[out] | elecpwr | electrical power |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This routine calculates jacobians (with respect to uHSS_Spd) of the drive-train torque (GenTrq, ElecPwr) assuming the generator is on.
[in] | t | Current simulation time in seconds |
[in] | u | Inputs at t |
[in] | p | Parameters |
[in,out] | m | Misc (optimization) variables |
[out] | gentrq_du | partial generator torque / partial uHSS_Spd |
[out] | elecpwr_du | partialelectrical power / partial uHSS_Spd |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
Routine for deciding if Bladed-style DLL controller should be called.
[in] | t | Current simulation time in seconds |
[in] | u | Inputs at t |
[in] | p | Parameters |
[in] | x | Continuous states at t |
[in] | xd | Discrete states at t |
[in] | z | Constraint states at t |
[in] | otherstate | Other states at t |
[in,out] | m | Misc (optimization) variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
Routine for computing the pitch output: blade pitch commands.
This routine is used in both loose and tight coupling.
[in] | t | Current simulation time in seconds |
[in] | u | Inputs at t |
[in] | p | Parameters |
[in] | x | Continuous states at t |
[in] | xd | Discrete states at t |
[in] | z | Constraint states at t |
[in] | otherstate | Other states at t |
[in,out] | blpitchcom | pitch outputs computed at t (Input only so that mesh con- nectivity information does not have to be recalculated) |
[in] | elecpwr | Electrical power (watts) |
[in,out] | m | Misc (optimization) variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This routine updates the continuous and other states associated with the pitch controller: BegPitMan, BlPitchI, and TPitManE.
[in] | t | t+dt |
[in] | u | Inputs at t+dt |
[in] | p | Parameters |
[in,out] | x | Input: Continuous states at t; Output: Continuous states at t + dt |
[in,out] | xd | Input: Discrete states at t; Output: Discrete states at t + dt |
[in,out] | z | Input: Constraint states at t; Output: Constraint states at t + dt |
[in,out] | otherstate | Other states: Other states at t; Output: Other states at t + dt |
[in,out] | m | Misc (optimization) variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
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.
[out] | unec | I/O unit for echo file. If > 0, file is open for writing. |
[out] | errstat | Error status |
[in] | initinp | Input data for initialization routine |
[out] | errmsg | Error message |
[in] | outfileroot | The rootname of the echo file, possibly opened in this routine |
[in,out] | inputfiledata | All the data in the ServoDyn input file |
|
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.
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.
[in] | t | Current simulation time in seconds |
[in] | u | Inputs at t |
[in] | p | Parameters |
[in] | x | Continuous states at t |
[in] | xd | Discrete states at t |
[in] | z | Constraint states at t (possibly a guess) |
[in] | otherstate | Other states at t |
[in,out] | m | Misc (optimization) variables |
[out] | z_residual | Residual of the constraint state equations using the input values described above |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
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.
[in] | t | Current simulation time in seconds |
[in] | u | Inputs at t |
[in] | p | Parameters |
[in] | x | Continuous states at t |
[in] | xd | Discrete states at t |
[in] | z | Constraint states at t |
[in] | otherstate | Other states at t |
[in,out] | m | Misc (optimization) variables |
[out] | dxdt | Continuous state derivatives at t |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
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.
[in] | t | Current simulation time in seconds |
[in] | u | Inputs at t |
[in] | p | Parameters |
[in] | x | Continuous states at t |
[in] | xd | Discrete states at t |
[in] | z | Constraint states at t |
[in] | otherstate | Other states at t |
[in,out] | y | Outputs computed at t (Input only so that mesh con- nectivity information does not have to be recalculated) |
[in,out] | m | Misc (optimization) variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
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.
[in,out] | u | System inputs |
[in,out] | p | Parameters |
[in,out] | x | Continuous states |
[in,out] | xd | Discrete states |
[in,out] | z | Constraint states |
[in,out] | otherstate | Other states |
[in,out] | y | System outputs |
[in,out] | m | Initial misc (optimization) variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
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.
[in] | t | Time in seconds at operating point |
[in] | u | Inputs at operating point (may change to inout if a mesh copy is required) |
[in] | p | Parameters |
[in] | x | Continuous states at operating point |
[in] | xd | Discrete states at operating point |
[in] | z | Constraint states at operating point |
[in] | otherstate | Other states at operating point |
[in] | y | Output at operating point |
[in,out] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
[in,out] | u_op | values of linearized inputs |
[in,out] | y_op | values of linearized outputs |
[in,out] | x_op | values of linearized continuous states |
[in,out] | dx_op | values of first time derivatives of linearized continuous states |
[in,out] | xd_op | values of linearized discrete states |
[in,out] | z_op | values of linearized constraint states |
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.
[in] | initinp | Input data for initialization routine |
[out] | u | An initial guess for the input; input mesh must be defined |
[out] | p | Parameters |
[out] | x | Initial continuous states |
[out] | xd | Initial discrete states |
[out] | z | Initial guess of the constraint states |
[out] | otherstate | Initial other states |
[out] | y | Initial system outputs (outputs are not calculated; only the output mesh is initialized) |
[out] | m | Initial misc (optimization) variables |
[in,out] | interval | Coupling 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] | initout | Output for initialization routine |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
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.
[in] | t | Time in seconds at operating point |
[in] | u | Inputs at operating point (may change to inout if a mesh copy is required) |
[in] | p | Parameters |
[in] | x | Continuous states at operating point |
[in] | xd | Discrete states at operating point |
[in] | z | Constraint states at operating point |
[in] | otherstate | Other states at operating point |
[in] | y | Output (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] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
[in,out] | dydz | Partial derivatives of output functions (Y) with respect to the constraint states (z) [intent in to avoid deallocation] |
[in,out] | dxdz | Partial derivatives of continuous state functions (X) with respect to the constraint states (z) [intent in to avoid deallocation] |
[in,out] | dxddz | Partial derivatives of discrete state functions (Xd) with respect to the constraint states (z) [intent in to avoid deallocation] |
[in,out] | dzdz | Partial derivatives of constraint state functions (Z) with respect to the constraint states (z) [intent in to avoid deallocation] |
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.
[in] | t | Time in seconds at operating point |
[in] | u | Inputs at operating point (may change to inout if a mesh copy is required) |
[in] | p | Parameters |
[in] | x | Continuous states at operating point |
[in] | xd | Discrete states at operating point |
[in] | z | Constraint states at operating point |
[in] | otherstate | Other states at operating point |
[in] | y | Output (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] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
[in,out] | dydx | Partial derivatives of output functions (Y) with respect to the continuous states (x) [intent in to avoid deallocation] |
[in,out] | dxdx | Partial derivatives of continuous state functions (X) with respect to the continuous states (x) [intent in to avoid deallocation] |
[in,out] | dxddx | Partial derivatives of discrete state functions (Xd) with respect to the continuous states (x) [intent in to avoid deallocation] |
[in,out] | dzdx | Partial derivatives of constraint state functions (Z) with respect to the continuous states (x) [intent in to avoid deallocation] |
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.
[in] | t | Time in seconds at operating point |
[in] | u | Inputs at operating point (may change to inout if a mesh copy is required) |
[in] | p | Parameters |
[in] | x | Continuous states at operating point |
[in] | xd | Discrete states at operating point |
[in] | z | Constraint states at operating point |
[in] | otherstate | Other states at operating point |
[in] | y | Output (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] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
[in,out] | dydxd | Partial derivatives of output functions (Y) with respect to the discrete states (xd) [intent in to avoid deallocation] |
[in,out] | dxdxd | Partial derivatives of continuous state functions (X) with respect to the discrete states (xd) [intent in to avoid deallocation] |
[in,out] | dxddxd | Partial derivatives of discrete state functions (Xd) with respect to the discrete states (xd) [intent in to avoid deallocation] |
[in,out] | dzdxd | Partial derivatives of constraint state functions (Z) with respect to the discrete states (xd) [intent in to avoid deallocation] |
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.
[in] | t | Time in seconds at operating point |
[in] | u | Inputs at operating point (may change to inout if a mesh copy is required) |
[in] | p | Parameters |
[in] | x | Continuous states at operating point |
[in] | xd | Discrete states at operating point |
[in] | z | Constraint states at operating point |
[in] | otherstate | Other states at operating point |
[in] | y | Output (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] | m | Misc/optimization variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
[in,out] | dydu | Partial derivatives of output functions (Y) with respect to the inputs (u) [intent in to avoid deallocation] |
[in,out] | dxdu | Partial derivatives of continuous state functions (X) with respect to inputs (u) [intent in to avoid deallocation] |
[in,out] | dxddu | Partial derivatives of discrete state functions (Xd) with respect to inputs (u) [intent in to avoid deallocation] |
[in,out] | dzdu | Partial 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 \)
|
private |
This subroutine reads the input file and stores all the data in the SrvD_InputFile structure.
It does not perform data validation.
[in] | initinp | Input data for initialization routine |
[in] | default_dt | The default DT (from glue code) |
[in] | outfileroot | The rootname of all the output files written by this routine. |
[out] | inputfiledata | Data stored in the module's input file |
[out] | errstat | The error status code |
[out] | errmsg | The error message, if an error occurred |
|
private |
This subroutine sets the parameters, based on the data stored in InputFileData.
[in,out] | inputfiledata | Data stored in the module's input file (intent OUT for MOVE_ALLOC) |
[in,out] | p | The module's parameter data |
[out] | errstat | The error status code |
[out] | errmsg | The error message, if an error occurred |
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.
[in] | t | Current simulation time in seconds |
[in] | u | Inputs at t |
[in] | p | Parameters |
[in] | x | Continuous states at t |
[in,out] | xd | Input: Discrete states at t; Output: Discrete states at t + Interval |
[in] | z | Constraint states at t |
[in] | otherstate | Other states at t |
[in,out] | m | Misc (optimization) variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
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.
[in] | t | Current simulation time in seconds |
[in] | n | Current step of the simulation: t = n*Interval |
[in,out] | inputs | Inputs at InputTimes (output only for mesh record-keeping in ExtrapInterp routine) |
[in] | inputtimes | Times in seconds associated with Inputs |
[in] | p | Parameters |
[in,out] | x | Input: Continuous states at t; Output: Continuous states at t + Interval |
[in,out] | xd | Input: Discrete states at t; Output: Discrete states at t + Interval |
[in,out] | z | Input: Constraint states at t; Output: Constraint states at t + Interval |
[in,out] | otherstate | Other states: Other states at t; Output: Other states at t + Interval |
[in,out] | m | Misc (optimization) variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
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.)
[in] | t | Current time |
[in] | brakend | Time at which brakes are fully deployed |
[in] | brakstrt | Time at which brakes are first deployed |
|
private |
Routine for computing the tip-brake output: TBDrCon.
This routine is used in both loose and tight coupling.
[in] | t | Current simulation time in seconds |
[in] | u | Inputs at t |
[in] | p | Parameters |
[in] | x | Continuous states at t |
[in] | xd | Discrete states at t |
[in] | z | Constraint states at t |
[in] | otherstate | Other states at t |
[in,out] | y | Outputs computed at t (Input only so that mesh con- nectivity information does not have to be recalculated) |
[in,out] | m | Misc (optimization) variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This routine updates the other states of the tip brakes: BegTpBr, TTpBrDp, and TTpBrFl.
[in] | t | t+dt |
[in] | u | Inputs at t+dt |
[in] | p | Parameters |
[in,out] | x | Input: Continuous states at t; Output: Continuous states at t + dt |
[in,out] | xd | Input: Discrete states at t; Output: Discrete states at t + dt |
[in,out] | z | Input: Constraint states at t; Output: Constraint states at t + dt |
[in,out] | otherstate | Other states: Other states at t; Output: Other states at t + dt |
[in,out] | m | Misc (optimization) variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This routine calculates the drive-train torque outputs: GenTrq, ElecPwr, and HSSBrTrqC.
[in] | t | Current simulation time in seconds |
[in] | u | Inputs at t |
[in] | p | Parameters |
[in] | x | Continuous states at t |
[in] | xd | Discrete states at t |
[in] | z | Constraint states at t |
[in] | otherstate | Other states at t |
[in,out] | y | Outputs computed at t (Input only so that mesh con- nectivity information does not have to be recalculated) |
[in,out] | m | Misc (optimization) variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This routine calculates the partials with respect to inputs of the drive-train torque outputs: GenTrq and ElecPwr.
[in] | t | Current simulation time in seconds |
[in] | u | Inputs at t |
[in] | p | Parameters |
[in] | x | Continuous states at t |
[in] | xd | Discrete states at t |
[in] | z | Constraint states at t |
[in] | otherstate | Other states at t |
[in,out] | m | Misc (optimization) variables |
[out] | gentrq_du | partial derivative of generator torque output with respect to HSS_Spd input |
[out] | elecpwr_du | partial derivative of electrical power output with respect to HSS_Spd input |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This routine updates the other states of the torque control: GenOnLine, and Off4Good.
[in] | t | t+dt |
[in] | u | Inputs at t+dt |
[in] | p | Parameters |
[in,out] | x | Input: Continuous states at t; Output: Continuous states at t + dt |
[in,out] | xd | Input: Discrete states at t; Output: Discrete states at t + dt |
[in,out] | z | Input: Constraint states at t; Output: Constraint states at t + dt |
[in,out] | otherstate | Other states: Other states at t; Output: Other states at t + dt |
[in,out] | m | Misc (optimization) variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This routine validates the inputs from the primary input file.
[in] | initinp | Input data for initialization routine |
[in] | inputfiledata | All the data in the ServoDyn input file |
[out] | errstat | Error status |
[out] | errmsg | Error message |
|
private |
Routine for computing the yaw output: a yaw moment.
This routine is used in both loose and tight coupling.
[in] | t | Current simulation time in seconds |
[in] | u | Inputs at t |
[in] | p | Parameters |
[in] | x | Continuous states at t |
[in] | xd | Discrete states at t |
[in] | z | Constraint states at t |
[in] | otherstate | Other states at t |
[in,out] | y | Outputs computed at t (Input only so that mesh con- nectivity information does not have to be recalculated) |
[in,out] | m | Misc (optimization) variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |
|
private |
This routine updates the other states associated with the yaw controller: BegYawMan, NacYawI, and TYawManE.
[in] | t | t+dt |
[in] | u | Inputs at t+dt |
[in] | p | Parameters |
[in,out] | x | Input: Continuous states at t; Output: Continuous states at t + dt |
[in,out] | xd | Input: Discrete states at t; Output: Discrete states at t + dt |
[in,out] | z | Input: Constraint states at t; Output: Constraint states at t + dt |
[in,out] | otherstate | Other states: Other states at t; Output: Other states at t + dt |
[in,out] | m | Misc (optimization) variables |
[out] | errstat | Error status of the operation |
[out] | errmsg | Error message if ErrStat /= ErrID_None |