Convert model from discrete to continuous time
sysc = d2c(sysd)
sysc = d2c(sysd,method)
sysc = d2c(sysd,opts)
[sysc,G] = d2c(sysd,method,opts)
Discrete-time dynamic system model
You cannot directly use an
Discrete-to-continuous time conversion method, specified as one of the following values:
Discrete-to-continuous time conversion options, created using
Continuous-time model of the same type as the input system
Matrix mapping the states
Given an initial condition
Create the following discrete-time transfer function:
H = tf([1 -1],[1 1 0.3],0.1);
The sample time of the model is .
Derive a continuous-time, zero-order-hold equivalent model.
Hc = d2c(H)
Hc = 121.7 s + 2.162e-13 --------------------- s^2 + 12.04 s + 776.7 Continuous-time transfer function.
Discretize the resulting model,
Hc, with the default zero-order hold method and sample time 0.1s to return the original discrete model,
ans = z - 1 ------------- z^2 + z + 0.3 Sample time: 0.1 seconds Discrete-time transfer function.
Use the Tustin approximation method to convert
H to a continuous time model.
Hc2 = d2c(H,'tustin');
Discretize the resulting model, Hc2, to get back the original discrete-time model,
Estimate a discrete-time transfer function model, and convert it to a continuous-time model.
load iddata1 sys1d = tfest(z1,2,'Ts',0.1); sys1c = d2c(sys1d,'zoh');
Estimate a continuous-time transfer function model.
sys2c = tfest(z1,2);
Compare the response of
sys1c and the directly estimated continuous-time model,
The two systems are almost identical.
Convert an identified discrete-time transfer function model to continuous-time.
load iddata1 sysd = tfest(z1,2,'Ts',0.1); sysc = d2c(sysd,'zoh');
sys1c has no covariance information. The
d2c operation leads to loss of covariance data of identified models.
Regenerate the covariance information using a zero iteration update with the same estimation command and estimation data.
opt = tfestOptions; opt.SearchOption.MaxIter = 0; sys1c = tfest(z1,sysc,opt);
Analyze the effect on frequency-response uncertainty.
h = bodeplot(sysd,sys1c); showConfidence(h,3)
The uncertainties of
sysd are comparable up to the Nyquist frequency. However,
sys1c exhibits large uncertainty in the frequency range for which the estimation data does not provide any information.
If you do not have access to the estimation data, use the
translatecov command which is a Gauss-approximation formula based translation of covariance across model type conversion operations.
The Tustin approximation is not defined for systems with poles at z = –1 and is ill-conditioned for systems with poles near z = –1.
The zero-order hold method cannot handle systems with poles
at z = 0. In
'zoh' conversion increases the model
order for systems with negative
real poles, . The model order increases because the matrix logarithm
maps real negative poles to complex poles. Single complex poles are
not physically meaningful because of their complex time response.
Instead, to ensure that all complex poles of the continuous
model come in conjugate pairs,
d2c replaces negative
real poles z = –α with
a pair of complex conjugate poles near –α.
The conversion then yields a continuous model with higher order. For
example, to convert the discrete-time transfer function
Ts = 0.1 % sample time 0.1 s H = zpk(-0.2,-0.5,1,Ts) * tf(1,[1 1 0.4],Ts) Hc = d2c(H)
These commands produce the following result.
Warning: System order was increased to handle real negative poles. Zero/pole/gain: -33.6556 (s-6.273) (s^2 + 28.29s + 1041) -------------------------------------------- (s^2 + 9.163s + 637.3) (s^2 + 13.86s + 1035)
Hc back to discrete time, type:
Zero/pole/gain: (z+0.5) (z+0.2) ------------------------- (z+0.5)^2 (z^2 + z + 0.4) Sample time: 0.1
This discrete model coincides with H(z) after canceling the pole/zero pair at z = –0.5.
Use the syntax
sysc = d2c(sysd,'method') to
sysd using the default options for
tustin conversion with a frequency prewarp
'prewarp' method), use the syntax
= d2c(sysd,opts). See the
d2cOptions reference page for more
d2c performs the
in state space, and relies on the matrix logarithm (see
the MATLAB® documentation).
See Continuous-Discrete Conversion Methods for more details on the conversion methods.
 Franklin, G.F., Powell,D.J., and Workman, M.L., Digital Control of Dynamic Systems (3rd Edition), Prentice Hall, 1997..
 Kollár, I., G.F. Franklin, and R. Pintelon, "On the Equivalence of z-domain and s-domain Models in System Identification," Proceedings of the IEEE® Instrumentation and Measurement Technology Conference, Brussels, Belgium, June, 1996, Vol. 1, pp. 14-19.