Class GainSchedModel
- Namespace
- TimeSeriesAnalysis.Dynamic
- Assembly
- TimeSeriesAnalysis.dll
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: GainSchedParameterspublic class GainSchedModel : ModelBaseClass, ISimulatableModel
- Inheritance
-
GainSchedModel
- Implements
- Inherited Members
Constructors
GainSchedModel()
Empty constructor
public GainSchedModel()
GainSchedModel(GainSchedParameters, string)
Constructor
[JsonConstructor]
public GainSchedModel(GainSchedParameters modelParameters, string ID = "not_named")
Parameters
modelParametersGainSchedParametersmodel parameter object
IDstringa unique string that identifies this model in larger process models
Fields
modelParameters
Model parameters
public GainSchedParameters modelParameters
Field Value
Methods
Clone(string)
Create deep copy/clone
public ISimulatableModel Clone(string IDexternal = null)
Parameters
IDexternalstring
Returns
GetFittedDataSet()
Returns the fitted dataset
public UnitDataSet GetFittedDataSet()
Returns
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.
public override int GetLengthOfInputVector()
Returns
GetModelParameters()
Get the objet of model paramters contained in the model
public GainSchedParameters GetModelParameters()
Returns
- GainSchedParameters
Model paramter object
GetOutputSignalType()
Get the type of output signal
public override SignalType GetOutputSignalType()
Returns
GetSteadyStateInput(double, int, double[])
Calcuate the steady-state input if the output and all-but-one input are known
public double? GetSteadyStateInput(double x0, int inputIdx = 0, double[] givenInputs = null)
Parameters
x0doubleIf no additive inputs y=x, otherwise subtract additive inputs from y to get x
inputIdxintthe index of the input
givenInputsdouble[]
Returns
GetSteadyStateOutput(double[], double)
Get the steady state output y for a given input(including additive terms)
public double? GetSteadyStateOutput(double[] u0, double badDataID = -9999)
Parameters
Returns
IsModelSimulatable(out string)
Answers if model is simulatable, i.e. has given inputs that are sensible and sufficent.
public bool IsModelSimulatable(out string explainStr)
Parameters
explainStrstring
Returns
Iterate(double[], double, double)
Iterates the process model state one time step, based on the inputs given
public double[] Iterate(double[] inputs, double timeBase_s, double badValueIndicator = -9999)
Parameters
inputsdouble[]vector of inputs U. Optionally the output disturbance D can be added as the last value.
timeBase_sdoublevector of inputs U.Optionally the output disturbance D can be added as the last value.
badValueIndicatordoublevalue in U that is to be treated as NaN
Returns
- 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
badValueIndicator, the last good value is returned
SetFittedDataSet(UnitDataSet)
Sets the fitted dataset
public void SetFittedDataSet(UnitDataSet dataset)
Parameters
datasetUnitDataSet
SetModelParameters(GainSchedParameters)
Update the paramter object of the model
public void SetModelParameters(GainSchedParameters parameters)
Parameters
parametersGainSchedParameters
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.
public override string ToString()
Returns
WarmStart(double[], double)
Warm-starting
public void WarmStart(double[] inputs = null, double output = 0)