Search Results for

    Show / Hide Table of Contents

    Class UnitModel

    Simulatable "default" process model.

    This is a model that can be either dynamic or static, have one or multiple inputs and can be either linear in inputs or have inputs nonlinearity described by a second-order polynominal. Dynamics can be either 1. order time-constant, time-delay or both. The model also supports "additive" signals added to its output (intended for modeling disturbances).

    The model is designed to lend itself well to identification from industrial time-series datasets, and is supported by the accompanying identification method UnitIdentifier.

    This model is also intended to be co-simulated with PidModel by PlantSimulator to study process control feedback loops.

    It is assumed that most unit processes in industrial process control systems can be described sufficiently by this model, and thus that larger plants can be modeled by connecting unit models based on this model structure.

    It would be possible to extend this model to also describe second-order dynamics along the same principles by the introduction of one additional parameter in future work.

    See also: UnitParameters
    Inheritance
    object
    ModelBaseClass
    UnitModel
    Implements
    ISimulatableModel
    Inherited Members
    ModelBaseClass.ID
    ModelBaseClass.ModelInputIDs
    ModelBaseClass.additiveInputIDs
    ModelBaseClass.outputID
    ModelBaseClass.outputIdentID
    ModelBaseClass.processModelType
    ModelBaseClass.comment
    ModelBaseClass.x
    ModelBaseClass.y
    ModelBaseClass.color
    ModelBaseClass.GetID()
    ModelBaseClass.SetID(string)
    ModelBaseClass.SetProcessModelType(ModelType)
    ModelBaseClass.GetProcessModelType()
    ModelBaseClass.SetInputIDs(string[], int?)
    ModelBaseClass.AddSignalToOutput(string)
    ModelBaseClass.GetModelInputIDs()
    ModelBaseClass.GetAdditiveInputIDs()
    ModelBaseClass.GetBothKindsOfInputIDs()
    ModelBaseClass.SetOutputID(string)
    ModelBaseClass.GetOutputID()
    ModelBaseClass.GetOutputIdentID()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: TimeSeriesAnalysis.Dynamic
    Assembly: TimeSeriesAnalysis.dll
    Syntax
    public class UnitModel : ModelBaseClass, ISimulatableModel

    Constructors

    | Edit this page View Source

    UnitModel()

    Empty constructor

    Declaration
    public UnitModel()
    | Edit this page View Source

    UnitModel(UnitParameters, string)

    Constructor

    Declaration
    [JsonConstructor]
    public UnitModel(UnitParameters modelParameters, string ID = "not_named")
    Parameters
    Type Name Description
    UnitParameters modelParameters

    model parameter object

    string ID

    a unique string that identifies this model in larger process models

    | Edit this page View Source

    UnitModel(UnitParameters, UnitDataSet, string)

    Initalizer of model that for the given dataSet also creates the resulting y_sim.

    Declaration
    public UnitModel(UnitParameters modelParameters, UnitDataSet dataSet, string ID = "not_named")
    Parameters
    Type Name Description
    UnitParameters modelParameters
    UnitDataSet dataSet
    string ID

    a unique string that identifies this model in larger process models

    Fields

    | Edit this page View Source

    modelParameters

    The parameters of the UnitModel.

    Declaration
    public UnitParameters modelParameters
    Field Value
    Type Description
    UnitParameters

    Methods

    | Edit this page View Source

    Clone(string)

    Create a deep copy of itself

    Declaration
    public ISimulatableModel Clone(string IDexternal = null)
    Parameters
    Type Name Description
    string IDexternal
    Returns
    Type Description
    ISimulatableModel

    deep copy

    | Edit this page View Source

    GetFittedDataSet()

    Returns a copy of the dataset against which the model was fitted.

    Declaration
    public UnitDataSet GetFittedDataSet()
    Returns
    Type Description
    UnitDataSet
    | Edit this page View Source

    GetLengthOfInputVector()

    Returns the number of external inputs U of the model. Note that this model may have a disturbance signal added to the output in addition to the other signals.

    Declaration
    public override int GetLengthOfInputVector()
    Returns
    Type Description
    int
    Overrides
    ModelBaseClass.GetLengthOfInputVector()
    | Edit this page View Source

    GetModelParameters()

    Get the object of model parameters contained in the model.

    Declaration
    public UnitParameters GetModelParameters()
    Returns
    Type Description
    UnitParameters

    Model parameter object

    | Edit this page View Source

    GetOutputSignalType()

    Get the type of output signal.

    Declaration
    public override SignalType GetOutputSignalType()
    Returns
    Type Description
    SignalType
    Overrides
    ModelBaseClass.GetOutputSignalType()
    | Edit this page View Source

    GetSteadyStateInput(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
    double[] givenInputs
    Returns
    Type Description
    double?
    | Edit this page View Source

    GetSteadyStateOutput(double[], double)

    Get the steady state output y for a given input (including additive terms).

    Declaration
    public double? GetSteadyStateOutput(double[] u, double badDataID = -9999)
    Parameters
    Type Name Description
    double[] u

    vector of input values

    double badDataID
    Returns
    Type Description
    double?
    | Edit this page View Source

    InitSim(UnitParameters)

    Initalize the process model with a sampling time.

    Declaration
    public void InitSim(UnitParameters modelParameters)
    Parameters
    Type Name Description
    UnitParameters modelParameters

    model parameters object

    | Edit this page View Source

    IsModelSimulatable(out string)

    Answers if the model can be simulated with the inputs provided.

    Declaration
    public bool IsModelSimulatable(out string explainStr)
    Parameters
    Type Name Description
    string explainStr

    a string that explains why the model cannot be simulated if that is the case

    Returns
    Type Description
    bool
    | Edit this page View Source

    IsModelStatic()

    Is the model static or dynamic?

    Declaration
    public bool IsModelStatic()
    Returns
    Type Description
    bool

    Returns true if the model is static(no time constant or time delay terms),otherwise false.

    | Edit this page View Source

    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

    the time in seconds between samples

    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 U values have been given yet. If some data points in U inputs are NaN or equal to badValueIndicator, the last good value is returned

    | Edit this page View Source

    RemoveAdditiveInputs()

    Removes the addtive inputs.

    Declaration
    public void RemoveAdditiveInputs()
    | Edit this page View Source

    SetFittedDataSet(UnitDataSet)

    Store the fitted dataset.

    Declaration
    public void SetFittedDataSet(UnitDataSet dataset)
    Parameters
    Type Name Description
    UnitDataSet dataset
    | Edit this page View Source

    SetModelParameters(UnitParameters)

    Update the parameter object of the model.

    Declaration
    public void SetModelParameters(UnitParameters parameters)
    Parameters
    Type Name Description
    UnitParameters parameters
    | Edit this page View Source

    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
    object.ToString()
    | Edit this page View Source

    WarmStart(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

    Implements

    ISimulatableModel
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX