From aa3674c7bffbebb25e2aebf42a3d82d3c7c9b889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steinar=20Elgs=C3=A6ter?= Date: Fri, 22 Nov 2024 16:24:48 +0100 Subject: [PATCH] - change the order of UnitParameters and PidParameters to make the most important ones show up highest --- Dynamic/SimulatableModels/PidParameters.cs | 34 +++++++----- Dynamic/SimulatableModels/UnitParameters.cs | 59 ++++++++++----------- TimeSeriesAnalysis.csproj | 2 +- 3 files changed, 50 insertions(+), 45 deletions(-) diff --git a/Dynamic/SimulatableModels/PidParameters.cs b/Dynamic/SimulatableModels/PidParameters.cs index 4c9217e..2ff8ae4 100644 --- a/Dynamic/SimulatableModels/PidParameters.cs +++ b/Dynamic/SimulatableModels/PidParameters.cs @@ -51,10 +51,7 @@ public PidParameters(PidParameters existingParam) } - /// - /// If true, the model will set u[k] based on the error term e[k-1], if false it will be set from e[k] - /// - public bool DelayOutputOneSample = false; + /// /// Proportional gain of controller @@ -70,15 +67,17 @@ public PidParameters(PidParameters existingParam) /// public double Td_s { get; set; } = 0; + + /// - /// Output value when e=0, used only for P-only controllers, u = Kp*e + u0 + /// PID-scaling object. This is optional, set to null to use unscaled PID. /// - public double u0 { get; set; } = 50; + public PidScaling Scaling { get; set; } /// - /// If the PID-controller is to be protected from a specific value that is used to identify bad or missing data, specify here + /// PID-filtering object. This is optional /// - public double NanValue { get; set; } = -9999; + public PidFilterParams Filtering { get; set; } /// /// Gain-scheduling object. This is optional, set to null gain-scheduling is not in use. @@ -90,20 +89,27 @@ public PidParameters(PidParameters existingParam) /// public PidFeedForward FeedForward { get; set; } = null; + /// - /// PID-scaling object. This is optional, set to null to use unscaled PID. + /// PID anti-surge parameters object. This is optional, set to null if not anti-surge PID /// - public PidScaling Scaling { get; set; } + public PidAntiSurgeParams AntiSurgeParams { get; set; } = null; /// - /// PID-filtering object. This is optional + /// If true, the model will set u[k] based on the error term e[k-1], if false it will be set from e[k] /// - public PidFilterParams Filtering { get; set; } + public bool DelayOutputOneSample = false; /// - /// PID anti-surge parameters object. This is optional, set to null if not anti-surge PID + /// Output value when e=0, used only for P-only controllers, u = Kp*e + u0 /// - public PidAntiSurgeParams AntiSurgeParams { get; set; } = null; + public double u0 { get; set; } = 50; + + /// + /// If the PID-controller is to be protected from a specific value that is used to identify bad or missing data, specify here + /// + public double NanValue { get; set; } = -9999; + /// /// Store a warning that arouse during identification diff --git a/Dynamic/SimulatableModels/UnitParameters.cs b/Dynamic/SimulatableModels/UnitParameters.cs index bb7a368..1c8e6cf 100644 --- a/Dynamic/SimulatableModels/UnitParameters.cs +++ b/Dynamic/SimulatableModels/UnitParameters.cs @@ -10,21 +10,27 @@ namespace TimeSeriesAnalysis.Dynamic /// public class UnitParameters : ModelParametersBaseClass { + /// + /// An array of gains that determine how much in the steady state each input change affects the output(multiplied with (u-u0)) + /// + public double[] LinearGains { get; set; } = null; /// - /// The minimum allowed output value(if set to NaN, no minimum is applied) + /// An array of 95% uncertatinty in the linear gains (u-u0)) /// - public double Y_min = double.NaN; + public double[] LinearGainUnc { get; set; } = null; + /// - /// the maximum allowed output value(if set to NaN, no maximum is applied) + /// The nonlinear curvature of the process gain, this paramter is multiplied + Curvatures*((u-u0)/Unorm)^2. + /// If value is nullc> then no curvatures are added to the model /// - public double Y_max = double.NaN; + public double[] Curvatures { get; set; } = null; /// - /// User-specified inputs to model fitting process such as minima,maxima and working point + /// The unceratainties of the curvature term of the process gains /// - public FittingSpecs FittingSpecs = new FittingSpecs(); + public double[] CurvatureUnc { get; set; } = null; /// /// A time constant in seconds, the time a 1. order linear system requires to do 63% of a step response. @@ -32,13 +38,6 @@ public class UnitParameters : ModelParametersBaseClass /// public double TimeConstant_s { get; set; } = 0; - /// - /// Damping (second-order) values between ~0.3-0.99 will cause step response with a single visibl overshoot. ) - /// Set to zero to disable damping. - /// As values less than 0.3 approach zero, the step response will become more and more oscillatory. - /// - public double DampingRatio { get; set; } = 0; - /// /// The uncertinty of the time constant estimate /// @@ -49,28 +48,23 @@ public class UnitParameters : ModelParametersBaseClass /// Set to zero to turn of time delay in model. /// public double TimeDelay_s { get; set; } = 0; - /// - /// An array of gains that determine how much in the steady state each input change affects the output(multiplied with (u-u0)) - /// - public double[] LinearGains { get; set; } = null; /// - /// An array of 95% uncertatinty in the linear gains (u-u0)) + /// Damping (second-order) values between ~0.3-0.99 will cause step response with a single visibl overshoot. ) + /// Set to zero to disable damping. + /// As values less than 0.3 approach zero, the step response will become more and more oscillatory. /// - public double[] LinearGainUnc { get; set; } = null; - + public double DampingRatio { get; set; } = 0; /// - /// The nonlinear curvature of the process gain, this paramter is multiplied + Curvatures*((u-u0)/Unorm)^2. - /// If value is nullc> then no curvatures are added to the model + /// The constant bias that is added so that models and dataset match on average, this value will depend on U0 and other parameters. /// - public double[] Curvatures { get; set; } = null; + public double Bias { get; set; } = 0; /// - /// The unceratainties of the curvature term of the process gains + /// The 95% uncertainty of the bias /// - public double[] CurvatureUnc { get; set; } = null; - + public double? BiasUnc { get; set; } = null; /// /// The working point of the model, the value of each U around which the model is localized. @@ -85,14 +79,19 @@ public class UnitParameters : ModelParametersBaseClass public double[] UNorm { get; set; } = null; /// - /// The constant bias that is added so that models and dataset match on average, this value will depend on U0 and other parameters. + /// The minimum allowed output value(if set to NaN, no minimum is applied) /// - public double Bias { get; set; } = 0; + public double Y_min = double.NaN; /// - /// The 95% uncertainty of the bias + /// the maximum allowed output value(if set to NaN, no maximum is applied) /// - public double? BiasUnc { get; set; } = null; + public double Y_max = double.NaN; + + /// + /// User-specified inputs to model fitting process such as minima,maxima and working point + /// + public FittingSpecs FittingSpecs = new FittingSpecs(); private List errorsAndWarningMessages; diff --git a/TimeSeriesAnalysis.csproj b/TimeSeriesAnalysis.csproj index 3f4f1e4..6d336de 100644 --- a/TimeSeriesAnalysis.csproj +++ b/TimeSeriesAnalysis.csproj @@ -14,7 +14,7 @@ False https://github.com/equinor/TimeSeriesAnalysis.git readme.md - 1.3.32 + 1.3.33 Equinor Equinor true