Class UnitDataSet
The data for a porition of a process, containg only one output and one or multiple inputs that influence it
Inherited Members
Namespace: TimeSeriesAnalysis.Dynamic
Assembly: TimeSeriesAnalysis.dll
Syntax
public class UnitDataSet
Constructors
| Edit this page View SourceUnitDataSet(string)
Constructor for data set without inputs - for "autonomous" processes such as sinusoids, rand walks or other disturbancs.
Declaration
public UnitDataSet(string name = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | optional internal name of dataset |
UnitDataSet((double[], DateTime[]), (double[], DateTime[]), string)
Create a dataset for single-input system from two signals that have separate but overlapping time-series(each given as value-date tuples)
Declaration
public UnitDataSet((double[], DateTime[]) u, (double[], DateTime[]) y_meas, string name = null)
Parameters
Type | Name | Description |
---|---|---|
(double[], DateTime[]) | u | tuple of values and dates describing u |
(double[], DateTime[]) | y_meas | tuple of values and dates describing y |
string | name | name of dataset |
UnitDataSet(UnitDataSet)
Create a copy of an existing data set
Declaration
public UnitDataSet(UnitDataSet otherDataSet)
Parameters
Type | Name | Description |
---|---|---|
UnitDataSet | otherDataSet |
UnitDataSet(UnitDataSet, int)
Create a downsampled copy of an existing data set
Declaration
public UnitDataSet(UnitDataSet originalDataSet, int downsampleFactor)
Parameters
Type | Name | Description |
---|---|---|
UnitDataSet | originalDataSet | |
int | downsampleFactor | factor by which to downsample the original dataset |
Fields
| Edit this page View SourceIndicesToIgnore
Indices that are ignored in Y during fitting.
Declaration
public List<int> IndicesToIgnore
Field Value
Type | Description |
---|---|
List<int> |
Properties
| Edit this page View SourceBadDataID
Some systems for storing data do not support "NaN", but instead some other magic value is reserved for indicating that a value is bad or missing.
Declaration
public double BadDataID { get; set; }
Property Value
Type | Description |
---|---|
double |
D
Additve output disturbance D (Y = X+ D)
Declaration
public double[] D { get; set; }
Property Value
Type | Description |
---|---|
double[] |
ProcessName
Name
Declaration
public string ProcessName { get; }
Property Value
Type | Description |
---|---|
string |
Times
Timestamps
Declaration
public DateTime[] Times { get; set; }
Property Value
Type | Description |
---|---|
DateTime[] |
U
Input U (given)
Declaration
public double[,] U { get; set; }
Property Value
Type | Description |
---|---|
double[,] |
U_sim
Input U(simulated) - in the case of PID-control
Declaration
public double[,] U_sim { get; set; }
Property Value
Type | Description |
---|---|
double[,] |
Warnings
list of warings during identification
Declaration
public List<UnitWarnings> Warnings { get; set; }
Property Value
Type | Description |
---|---|
List<UnitWarnings> |
Y_meas
Output Y (measured)
Declaration
public double[] Y_meas { get; set; }
Property Value
Type | Description |
---|---|
double[] |
Y_setpoint
Setpoint - (if sub-process includes a PID-controller)
Declaration
public double[] Y_setpoint { get; set; }
Property Value
Type | Description |
---|---|
double[] |
Y_sim
Output Y (simulated)
Declaration
public double[] Y_sim { get; set; }
Property Value
Type | Description |
---|---|
double[] |
Methods
| Edit this page View SourceConcat(UnitDataSet)
Appends/concatenate another dataset to the end of this one
Declaration
public bool Concat(UnitDataSet otherDataSet)
Parameters
Type | Name | Description |
---|---|---|
UnitDataSet | otherDataSet |
Returns
Type | Description |
---|---|
bool |
CreateTimeStamps(double, DateTime?)
If data is already given to object, this method will fill out the timstamps member
Declaration
public void CreateTimeStamps(double timeBase_s, DateTime? t0 = null)
Parameters
Type | Name | Description |
---|---|---|
double | timeBase_s | the time in seconds bewteen time samples |
DateTime? | t0 | the date of the first datapoint in the dataset |
DetermineIndicesToIgnore(FittingSpecs)
Tags indices to be removed if either of the output is outside the range defined by [Y_min,Y_max], an input is outside [u_min, umax] or if any data matches badDataId
Results are stored in "IndicesToIgnore", not outputted.
Declaration
public void DetermineIndicesToIgnore(FittingSpecs fittingSpecs)
Parameters
Type | Name | Description |
---|---|---|
FittingSpecs | fittingSpecs |
GetAverageU()
Get the average value of each input in the dataset. This is useful when defining model local around a working point.
Declaration
public double[] GetAverageU()
Returns
Type | Description |
---|---|
double[] | an array of averages, each corrsponding to one column of U. Returns null if it was not possible to calculate averages |
GetNumDataPoints()
Returns the number of datapoints in the dataset
Declaration
public int GetNumDataPoints()
Returns
Type | Description |
---|---|
int |
GetTimeBase()
Gets the time between samples in seconds, returns zero if times are not set
Declaration
public double GetTimeBase()
Returns
Type | Description |
---|---|
double |
GetTimeSpan()
Get the time spanned by the dataset
Declaration
public TimeSpan GetTimeSpan()
Returns
Type | Description |
---|---|
TimeSpan | The time spanned by the dataset, or null if times are not set |
SetU(double[], double[], double[], double[], double[], double[])
Helper to set column of U to uValues.
Declaration
public bool SetU(double[] uValues1, double[] uValues2 = null, double[] uValues3 = null, double[] uValues4 = null, double[] uValues5 = null, double[] uValues6 = null)
Parameters
Type | Name | Description |
---|---|---|
double[] | uValues1 | first input array |
double[] | uValues2 | second input array(can be null) |
double[] | uValues3 | third input array(can be null) |
double[] | uValues4 | third input array(can be null) |
double[] | uValues5 | third input array(can be null) |
double[] | uValues6 | third input array(can be null) |
Returns
Type | Description |
---|---|
bool | true if succesful, otherwise false |
SubsetInd(int, int)
Create a copy of the data set that is a subset with given start/end indices
Declaration
public UnitDataSet SubsetInd(int startInd, int endInd)
Parameters
Type | Name | Description |
---|---|---|
int | startInd | |
int | endInd |
Returns
Type | Description |
---|---|
UnitDataSet |
SubsetPrc(double, double)
Create a subset of the dataset that is defined in terms of percentages
Declaration
public UnitDataSet SubsetPrc(double startPrc, double endPrc)
Parameters
Type | Name | Description |
---|---|---|
double | startPrc | A value 0-100%. Should be a value smaller than endPrc |
double | endPrc | A value 0-100%. Should be a value bigger than startPrc |
Returns
Type | Description |
---|---|
UnitDataSet |