Linear ODE (grey-box model) with identifiable parameters
sys = idgrey(odefun,parameters,fcn_type)
sys = idgrey(odefun,parameters,fcn_type,optional_args)
sys = idgrey(odefun,parameters,fcn_type,optional_args,Ts)
sys = idgrey(odefun,parameters,fcn_type,optional_args,Ts,Name,Value)
creates
a linear grey-box model with identifiable parameters, sys
= idgrey(odefun
,parameters
,fcn_type
)sys
. odefun
specifies
the user-defined function that relates the model parameters, parameters
,
to its state-space representation.
creates
a linear grey-box model with identifiable parameters using the optional
arguments required by sys
= idgrey(odefun
,parameters
,fcn_type
,optional_args
)odefun
.
creates
a linear grey-box model with identifiable parameters with the specified
sample time, sys
= idgrey(odefun
,parameters
,fcn_type
,optional_args
,Ts
)Ts
.
creates
a linear grey-box model with identifiable parameters with additional
options specified by one or more sys
= idgrey(odefun
,parameters
,fcn_type
,optional_args
,Ts
,Name,Value
)Name,Value
pair
arguments.
An idgrey
model represents a system as
a continuous-time or discrete-time state-space model with identifiable
(estimable) coefficients.
A state-space model of a system with input vector, u, output vector, y, and disturbance, e, takes the following form in continuous time:
In discrete time, the state-space model takes the form:
For idgrey
models, the state-space matrices A, B, C,
and D are expressed as a function of user-defined
parameters using a MATLAB® function. You access estimated parameters
using sys.Structures.Parameters
, where sys
is
an idgrey
model.
Use an idgrey
model when you know the system
of equations governing the system dynamics explicitly. You should
be able to express these dynamics in the form of ordinary differential
or difference equations. You specify complex relationships and constraints
among the parameters that cannot be done through structured state-space
models (idss
).
You can create an idgrey
model using the idgrey
command.
To do so, write a MATLAB function that returns the A, B, C,
and D matrices for given values of the estimable
parameters and sample time. The MATLAB function can also return
the K matrix and accept optional input arguments.
The matrices returned may represent a continuous-time or discrete-time
model, as indicated by the sample time.
Use the estimating functions pem
or greyest
to
obtain estimated values for the unknown parameters of an idgrey
model.
You can convert an idgrey
model into other
dynamic systems, such as idpoly
, idss
, tf
, ss
etc.
You cannot convert a dynamic system into an idgrey
model.
|
MATLAB function that relates the model parameters to its state-space representation.
If the function is not on the MATLAB path, then specify the full file name, including the path. The syntax for [A,B,C,D] = odefun(par1,par2,...,parN,Ts,optional_arg1,optional_arg2,...) The function outputs describe the model in the following linear state-space innovations form: In discrete time xn(t)=x(t+Ts) and in continuous time, .
The disturbance matrix, K, and the initial
state values, x0, are not parametrized. Instead,
these values are determined separately, using the A good choice for achieving the best simulation results is
to set the (Optional) Parameterizing Disturbance: [A,B,C,D,K] = odefun(par1,par2,...,parN,Ts,optional_arg1,optional_arg2,...) If (Optional) Parameterizing Initial State Values: To make the
model initial states, X0, dependent on the model
parameters, use the following syntax for [A,B,C,D,K,X0] = odefun(par1,par2,...,parN,Ts,optional_arg1,optional_arg2,...) If |
|
Initial values of the parameters required by Specify You may also specify parameter names using an N-by-2 cell array, where N is the number of parameters. The first column specifies the names, and the second column specifies the values of the parameters. For example: parameters = {'mass',par1;'stiffness',par2;'damping',par3} |
|
Indicates whether the model is parameterized in continuous-time, discrete-time, or both.
|
|
Optional input arguments required by Specify If |
|
Model sample time. If
|
|
Specify optional comma-separated pairs of Use |
idgrey
object properties include:
|
Values of state-space matrices.
The values |
|
Value of state disturbance matrix, K
To create an estimation option set for |
|
State names, specified as one of the following:
Default: |
|
State units, specified as one of the following:
Use Default: |
|
Information about the estimable parameters of the
|
|
The variance (covariance matrix) of the model innovations, e. An identified model includes a white, Gaussian noise component, e(t). For SISO models, |
|
Summary report that contains information about the estimation
options and results when the grey-box model is obtained using the
The contents of odefun = 'motorDynamics'; m = idgrey(odefun,1,'cd',0.25,0); m.Report.OptionsUsed ans = [] If you obtain the grey-box model using estimation commands,
the fields of load(fullfile(matlabroot,'toolbox','ident','iddemos','data','dcmotordata')); data = iddata(y,u,0.1,'Name','DC-motor'); odefun = 'motorDynamics'; init_sys = idgrey('motorDynamics',1,'cd',0.25,0); m = greyest(data,init_sys); m.Report.OptionsUsed InitialState: 'auto' DisturbanceModel: 'auto' Focus: 'prediction' EstimateCovariance: 1 Display: 'off' InputOffset: [] OutputOffset: [] Regularization: [1x1 struct] OutputWeight: [] SearchMethod: 'auto' SearchOptions: [1x1 idoptions.search.identsolver] Advanced: [1x1 struct]
For more information on this property and how to use it, see the Output Arguments section of the corresponding estimation command reference page and Estimation Report. |
|
Input delay for each input channel, specified as a scalar value
or numeric vector. For continuous-time systems, specify input delays
in the time unit stored in the For a system with You can also set Default: 0 |
|
Output delays. For identified systems, like |
|
Sample time. For continuous-time models, Changing this property does not discretize or resample the model. For |
|
Units for the time variable, the sample time
Changing this property has no effect on other properties, and
therefore changes the overall system behavior. Use Default: |
|
Input channel names, specified as one of the following:
Alternatively, use automatic vector expansion to assign input
names for multi-input models. For example, if sys.InputName = 'controls'; The input names automatically expand to When you estimate a model using an You can use the shorthand notation Input channel names have several uses, including:
Default: |
|
Input channel units, specified as one of the following:
Use Default: |
|
Input channel groups. The sys.InputGroup.controls = [1 2]; sys.InputGroup.noise = [3 5]; creates input groups named sys(:,'controls') Default: Struct with no fields |
|
Output channel names, specified as one of the following:
Alternatively, use automatic vector expansion to assign output
names for multi-output models. For example, if sys.OutputName = 'measurements'; The output names automatically expand to When you estimate a model using an You can use the shorthand notation Output channel names have several uses, including:
Default: |
|
Output channel units, specified as one of the following:
Use Default: |
|
Output channel groups. The sys.OutputGroup.temperature = [1]; sys.InputGroup.measurement = [3 5]; creates output groups named sys('measurement',:) Default: Struct with no fields |
|
System name, specified as a character vector. For example, Default: |
|
Any text that you want to associate with the system, stored as a string or a cell array of
character vectors. The property stores whichever data type you
provide. For instance, if sys1.Notes = "sys1 has a string."; sys2.Notes = 'sys2 has a character vector.'; sys1.Notes sys2.Notes ans = "sys1 has a string." ans = 'sys2 has a character vector.' Default: |
|
Any type of data you want to associate with system, specified as any MATLAB data type. Default: |
|
Sampling grid for model arrays, specified as a data structure. For arrays of identified linear (IDLTI) models that are derived by sampling one or more independent variables, this property tracks the variable values associated with each model. This information appears when you display or plot the model array. Use this information to trace results back to the independent variables. Set the field names of the data structure to the names of the sampling variables. Set the field values to the sampled variable values associated with each model in the array. All sampling variables should be numeric and scalar valued, and all arrays of sampled values should match the dimensions of the model array. For example, if you collect data at various operating points of a system, you can identify a model for each operating point separately and then stack the results together into a single system array. You can tag the individual models in the array with information regarding the operating point: nominal_engine_rpm = [1000 5000 10000];
sys.SamplingGrid = struct('rpm', nominal_engine_rpm) where For model arrays generated by linearizing a Simulink® model
at multiple parameter values or operating points, the software populates Default: |