functioninitialResponse
Calculate the initial time response of a discrete transfer function
Extends from Modelica_LinearSystems2.Internal.timeResponseMask_tf_discrete (Declares the common structure for the set of discrete response functions).
Information
Syntax
(y, t, x) = DiscreteTransferFunction.Analysis.initialResponse(x0, dtf, tSpan)
Description
First, the discrete transfer function representation is transformed into discrete state space representation which is given to DiscreteStateSpace.Analysis.timeResponse and the initial response of the discrete state space system for initial state x0 is calculated. The type of the time response is defined by the input responseType, i.e. in this case
Initial "Initial response",
The outputs y and x of the discrete state space systrem are calculated for each time step t=k*dt.
Example
DiscreteTransferFunction z = Modelica_LinearSystems2.DiscreteTransferFunction.z();
Modelica_LinearSystems2.DiscreteTransferFunction dtf=(0.0023753*z^2 + 0.00475059*z + 0.0023753)/(z^2 - 1.89549*z + 0.904988);
Real tSpan= 0.4;
Real x0[1]={1,2};
Real y[5,1,1];
Real t[5];
Real x[5,1,1]
algorithm
dtf.Ts:=0.1;
(y,t,x):=Modelica_LinearSystems2.DiscreteTransferFunction.Analysis.initialResponse(x0,dtf,tSpan,response,x0);
// y[:,1,1] = {0.0187315575967189, 0.0271552102903869, 0.0345205091861731, 0.0408580313775029, 0.0462052138701078}
// t = {0, 0.1, 0.2, 0.3, 0.4}
// x[:,1,1] = {1.0, 2.0, 2.88598574821853, 3.66037203581564, 4.3264045475288}
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real[:] | x0 | fill(0, 0) | Initial state vector |
| Modelica_LinearSystems2.DiscreteTransferFunction | dtf (from timeResponseMask_tf_discrete) | ||
| Real | tSpan (from timeResponseMask_tf_discrete) | 0 | Simulation time span [s] |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real[:,1,1] | y (from timeResponseMask_tf_discrete) | Output response: (number of samples) x (number of outputs) x (number of inputs) | |
| Real[:] | t (from timeResponseMask_tf_discrete) | Time vector: (number of samples) | |
| Real[:,Modelica_LinearSystems2.DiscreteTransferFunction.Analysis.denominatorDegree(dtf),1] | x_discrete (from timeResponseMask_tf_discrete) | State trajectories: (number of samples) x (number of states) x (number of inputs) |