Table of Contents

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: GainSchedParameters
public 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

modelParameters GainSchedParameters

model parameter object

ID string

a unique string that identifies this model in larger process models

Fields

modelParameters

Model parameters

public GainSchedParameters modelParameters

Field Value

GainSchedParameters

Methods

Clone(string)

Create deep copy/clone

public ISimulatableModel Clone(string IDexternal = null)

Parameters

IDexternal string

Returns

ISimulatableModel

GetFittedDataSet()

Returns the fitted dataset

public UnitDataSet GetFittedDataSet()

Returns

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.

public override int GetLengthOfInputVector()

Returns

int

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

SignalType

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

x0 double

If no additive inputs y=x, otherwise subtract additive inputs from y to get x

inputIdx int

the index of the input

givenInputs double[]

Returns

double?

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

u0 double[]
badDataID double

optional special value that indicates "Nan"

Returns

double?

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

explainStr string

Returns

bool

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

inputs double[]

vector of inputs U. Optionally the output disturbance D can be added as the last value.

timeBase_s double

vector of inputs U.Optionally the output disturbance D can be added as the last value.

badValueIndicator double

value 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

dataset UnitDataSet

SetModelParameters(GainSchedParameters)

Update the paramter object of the model

public void SetModelParameters(GainSchedParameters parameters)

Parameters

parameters GainSchedParameters

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

string

WarmStart(double[], double)

Warm-starting

public void WarmStart(double[] inputs = null, double output = 0)

Parameters

inputs double[]

not used, leave as null

output double

not used, leave as null