Class GainSchedModel
Simulatable gain-scheduled model.
A model for systems that cannot be adequately modelled by UnitModel,because they either have time constants or gains or both that vary
signficantly depending on the value of one of the inputs.
One input is selected as the "scheduling varible" and one ore more thresholds are given for this scheduling variable. The thresholds can be set indepently for time-contant and linear gain.
Remember that with more thresholds defined, the higher the requirement for information content in data will be if the model is to be identified from it.
This should not be confused with "gain-scheduled" PID-control, which is a similar concept but applied to PID-control parameters.
See also: GainSchedParametersImplements
Inherited Members
Namespace: TimeSeriesAnalysis.Dynamic
Assembly: TimeSeriesAnalysis.dll
Syntax
public class GainSchedModel : ModelBaseClass, ISimulatableModel
Constructors
| Edit this page View SourceGainSchedModel()
Empty constructor
Declaration
public GainSchedModel()
GainSchedModel(GainSchedParameters, string)
Constructor
Declaration
[JsonConstructor]
public GainSchedModel(GainSchedParameters modelParameters, string ID = "not_named")
Parameters
Type | Name | Description |
---|---|---|
GainSchedParameters | modelParameters | model parameter object |
string | ID | a unique string that identifies this model in larger process models |
Fields
| Edit this page View SourcemodelParameters
Model parameters
Declaration
public GainSchedParameters modelParameters
Field Value
Type | Description |
---|---|
GainSchedParameters |
Methods
| Edit this page View SourceClone(string)
Create deep copy/clone
Declaration
public ISimulatableModel Clone(string IDexternal = null)
Parameters
Type | Name | Description |
---|---|---|
string | IDexternal |
Returns
Type | Description |
---|---|
ISimulatableModel |
GetFittedDataSet()
Returns the fitted dataset
Declaration
public UnitDataSet GetFittedDataSet()
Returns
Type | Description |
---|---|
UnitDataSet |
GetLengthOfInputVector()
Returns the number of external inputs U of the model. Note that this model may have an disturbance signal added to the output in addition to the other signals.
Declaration
public override int GetLengthOfInputVector()
Returns
Type | Description |
---|---|
int |
Overrides
| Edit this page View SourceGetModelParameters()
Get the objet of model paramters contained in the model
Declaration
public GainSchedParameters GetModelParameters()
Returns
Type | Description |
---|---|
GainSchedParameters | Model paramter object |
GetOutputSignalType()
Get the type of output signal
Declaration
public override SignalType GetOutputSignalType()
Returns
Type | Description |
---|---|
SignalType |
Overrides
| Edit this page View SourceGetSteadyStateInput(double, int, double[])
Calcuate the steady-state input if the output and all-but-one input are known
Declaration
public double? GetSteadyStateInput(double x0, int inputIdx = 0, double[] givenInputs = null)
Parameters
Type | Name | Description |
---|---|---|
double | x0 | If no additive inputs y=x, otherwise subtract additive inputs from y to get x |
int | inputIdx | the index of the input |
double[] | givenInputs |
Returns
Type | Description |
---|---|
double? |
GetSteadyStateOutput(double[], double)
Get the steady state output y for a given input(including additive terms)
Declaration
public double? GetSteadyStateOutput(double[] u0, double badDataID = -9999)
Parameters
Type | Name | Description |
---|---|---|
double[] | u0 | |
double | badDataID | optional special value that indicates "Nan" |
Returns
Type | Description |
---|---|
double? |
IsModelSimulatable(out string)
Answers if model is simulatable, i.e. has given inputs that are sensible and sufficent.
Declaration
public bool IsModelSimulatable(out string explainStr)
Parameters
Type | Name | Description |
---|---|---|
string | explainStr |
Returns
Type | Description |
---|---|
bool |
Iterate(double[], double, double)
Iterates the process model state one time step, based on the inputs given
Declaration
public double[] Iterate(double[] inputs, double timeBase_s, double badValueIndicator = -9999)
Parameters
Type | Name | Description |
---|---|---|
double[] | inputs | vector of inputs U. Optionally the output disturbance D can be added as the last value. |
double | timeBase_s | vector of inputs U.Optionally the output disturbance D can be added as the last value. |
double | badValueIndicator | value in U that is to be treated as NaN |
Returns
Type | Description |
---|---|
double[] | the updated process model state(x) - the output without any output noise or disturbance.
NaN is returned if model was not able to be identfied, or if no good values U values yet have been given.
If some data points in U inputsU are NaN or equal to |
SetFittedDataSet(UnitDataSet)
Sets the fitted dataset
Declaration
public void SetFittedDataSet(UnitDataSet dataset)
Parameters
Type | Name | Description |
---|---|---|
UnitDataSet | dataset |
SetModelParameters(GainSchedParameters)
Update the paramter object of the model
Declaration
public void SetModelParameters(GainSchedParameters parameters)
Parameters
Type | Name | Description |
---|---|---|
GainSchedParameters | parameters |
ToString()
Create a nice human-readable summary of all the important data contained in the model object. This is especially useful for unit-testing and development.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |
Overrides
| Edit this page View SourceWarmStart(double[], double)
Warm-starting
Declaration
public void WarmStart(double[] inputs = null, double output = 0)
Parameters
Type | Name | Description |
---|---|---|
double[] | inputs | not used, leave as null |
double | output | not used, leave as null |