文件

C2D.

从持续的离散时间转换模型

句法

SYSD.= C2D(SYS.那TS.的)
SYSD.= C2D(SYS.那TS.那方法的)
SYSD.= C2D(SYS.那TS.那选择的)
[SYSD.那G]= C2D(SYS.那TS.那方法的)
[SYSD,G] = C2D(SYS,TS,OPTS)

Description

SYSD.= C2D(SYS.TS.的)可连续时间动态系统模型SYS.使用zero-order hold on the inputs and a sample time ofTS.seconds.

SYSD.= C2D(SYS.TS.方法的)discretizesSYS.使用the specified discretization method方法

SYSD.= C2D(SYS.TS.选择的)discretizesSYS.使用the option set选择,使用该指定c2doptions.命令。

[SYSD.G] = C2D(SYS.TS.方法的)returns a matrix,Gthat maps the continuous initial conditionsX0.and0.国家空间模型SYS.到离散时间的初始状态矢量X[0.]方法is optional. To specify additional discretization options, use[SYSD.G] = C2D(SYS.TS.选择的)

输入参数

SYS.

Continuous-time动态系统模型(频率响应数据模型除外)。SYS.can represent a SISO or MIMO system, except that the'匹配'离散化方法仅支持SISO系统。万博1manbetx

SYS.can have input/output or internal time delays; however, the'匹配''impulse'那and最小二乘'方法s do not support state-space models with internal time delays.

以下识别的线性系统不能直接离散:

  • idgrey.模特functiontype.is'C'。转换成IDS.第一款。

  • IDProc.楷模。转换成IDTF.oridpoly第一款。

For the syntax[SYSD,G] = C2D(SYS,TS,OPTS)SYS.必须是一个状态空间模型。

TS.

采样时间。

方法

Discretization method, specified as one of the following values:

  • 'zoh'— Zero-order hold (default). Assumes the control inputs are piecewise constant over the sample timeTS.

  • 'foh'- 三角形近似(修改的一阶保持)。假设控制输入在采样时间上是分段线性TS.

  • 'impulse'— Impulse invariant discretization

  • 'tustin'— Bilinear (Tustin) method

  • '匹配'— Zero-pole matching method

  • 'least-squares'— Least-squares method

有关每个算法的信息转换方法,见连续离散转换Methods

选择

离散化选择。创造选择使用c2doptions.

输出参数

SYSD.

与输入系统相同类型的离散时间模型SYS.

WhenSYS.是一个识别的(idlti)模型,SYSD.

  • Includes both measured and noise components ofSYS.。The innovations varianceλof the continuous-time identified modelSYS.,存储在它的noisavariance.property, is interpreted as the intensity of the spectral density of the noise spectrum. The noise variance inSYSD.is thusλ/ ts

  • Does not include the estimated parameter covariance ofSYS.。If you want to translate the covariance while discretizing the model, usetranslatecov

G

Matrix relating continuous-time initial conditionsX0.and0.国家空间模型SYS.到离散时间的初始状态矢量X[0.]那as follows:

X [ 0. ] = G [ X 0. 0. ]

对于具有时间延迟的状态空间模型,C2D.垫矩阵Gwith zeroes to account for additional states introduced by discretizing those delays. See连续离散转换Methodsfor a discussion of modeling time delays in discretized systems.

Examples

collapse all

离散化以下连续时间转移功能:

该系统的输入延迟为0.3秒。使用示例时间的三角形(一阶保持)近似来离散系统TS.=0.。1 s.

H = tf([1 -1],[1 4 5],'inputdelay'那0.。3); Hd = c2d(H,0.1,'foh'的);

Compare the step responses of the continuous-time and discretized systems.

step(H,' - ',高清,' - '的)

Discretize the following delayed transfer function using zero-order hold on the input, and a 10-Hz sampling rate.

H = TF(10,[1 3 10],'iodelay'那0.。25); hd = c2d(h,0.1)
HD = 0.01187 Z ^ 2 + 0.06408 Z + 0.009721 Z ^( -  3)* --------------------------------------  Z ^ 2  -  1.655 Z + 0.7408采样时间:0.1秒离散时间传递函数。

In this example, the discretized model高清延迟三个采样期。离散化算法将残余半期延迟吸收到系数中高清

比较连续时间和离散模型的步骤响应。

step(h,' - ',高清,' - '的)

使用两个状态创建连续时间状态空间模型和输入延迟。

sys = ss(tf([1,2],[1,4,2]));sys.inputdelay = 2.7
sys = a = x1 x2 x1 -4 -2 x2 1 0 b = u1 x1 2 x2 0 c = x1 x2 y1 0.5 1 d = u1 y1 0输入延迟(秒):2.7连续时间 - 空间模型。

Discretize the model using the Tustin discretization method and a Thiran filter to model fractional delays. The sample timeTS.=1 second.

opt = c2doptions('方法''tustin''fractdelay approxorder'那3); sysd1 = c2d(sys,1,opt)
SYSD1 = A = x1 x2 x3 x4 x5 x1 -0.4286 -0.5714-0.00265 0.2857 0.0.7143 -0.001325 0.0.2432 0.143 x3 0 0.1153 x 4 0 0 0.25 0 0 x 5 0 0 0 0.125 0 b = u1 x1 0.115 0 b = u1 x1 0.115 0 b = u1 x1 0.115 0 x 5 0 0 0 0.125 0x2 0.001029 x3 8 x4 0 x 5 0 c = x1 x2 x3 x4 x5 y1 0.2857 0.7143 -0.001325 0.03477 1.143 d = u1 y1 0.001029采样时间:1秒离散时间空间模型。

The discretized model now contains three additional statesX3X4那andX5corresponding to a third-order Thiran filter. Since the time delay divided by the sample time is 2.7, the third-order Thiran filter ('fractdelay approxorder'= 3)可以近似整个时间延迟。

估计连续时间传递函数,并将其离散化。

加载iddata1SYS.1c = tfest(z1,2); sys1d = c2d(sys1c,0.1,'zoh'的);

估计二阶离散时间传递函数。

SYS.2d = tfest(z1,2,'Ts',0.1);

比较离散连续时间传递函数模型的响应,SYS.1d那and the directly estimated discrete-time model,SYS.2d

比较(Z1,SYS1D,SYS2D)

这两个系统几乎相同。

Discretize an identified state-space model to build a one-step ahead predictor of its response.

使用估计数据创建连续时间识别的状态空间模型。

加载iddata2SYSC = SSEST(Z2,4);

预测前方的一步预测响应SYSC.

预测(SYSC,Z2)

Discretize the model.

SYSD.= C2D(SYSC.那0.。1,'zoh'的);

从离散模型构建预测仪模型,SYSD.

[A,B,C,D,K] = idssdata(sysd); Predictor = ss(A-K*C,[K B-K*D],C,[0 D],0.1);

Predictoris a two-input model which uses the measured output and input signals([z1.y z1.u])to compute the 1-step predicted response ofSYSC.

模拟预测仪模型以获得相同的响应predict命令。

lsim(Predictor,[z2.y,z2.u])

The simulation of the predictor model gives the same response as预测(SYSC,Z2)

Tips

  • Use the syntaxSYSD.= C2D(SYS.那TS.那方法的)to discretizeSYS.使用默认选项方法。要指定其他离散化选项,请使用语法SYSD.= C2D(SYS.那TS.那选择的)

  • To specify thetustin频率预警方法(以前称为'prewarp'方法的)那你se the预先验证选择c2doptions.

Algorithms

有关每个算法的信息C2D.转换方法,见连续离散转换Methods

Introduced before R2006a