ToDiscreteTimeModel[lsys,τ]
gives the discrete-time approximation, with sampling period τ, of the continuous-time systems models lsys.
ToDiscreteTimeModel[tfm,τ,z]
specifies the transform variable z.
ToDiscreteTimeModel
ToDiscreteTimeModel[lsys,τ]
gives the discrete-time approximation, with sampling period τ, of the continuous-time systems models lsys.
ToDiscreteTimeModel[tfm,τ,z]
specifies the transform variable z.
Details and Options
- ToDiscreteTimeModel is also known as sampling.
- The systems model lsys can be a TransferFunctionModel or a StateSpaceModel.
- For a TransferFunctionModel object sys, ToDiscreteTimeModel[sys,τ] uses z as the Z-transform variable.
- ToDiscreteTimeModel accepts a Method option that can be used to specify the approximation method.
- The settings for Method are the same as for ToContinuousTimeModel.
- The setting Method->{m,"StateSpaceConversion"->Automatic} computes the approximation using the transfer-function representation, except for the "ZeroOrderHold" and "FirstOrderHold" methods.
Examples
open all close allBasic Examples (1)
Scope (6)
Convert a continuous-time transfer-function model to the discrete-time domain:
ToDiscreteTimeModel[TransferFunctionModel[{{{a}}, a + s}, s], 1, z]Convert a continuous-time state-space model to discrete time:
ToDiscreteTimeModel[StateSpaceModel[{{{0, 1}, {0, -1}}, {{0}, {1}}, {{1, 0}}, {{0}}}, SamplingPeriod -> None,
SystemsModelLabels -> None], τ, z]Convert a multiple-input, multiple-output system to discrete time:
ToDiscreteTimeModel[TransferFunctionModel[{{{1., s}, {1, 2}},
{{1 + s, 1 + 10*s}, {(1 + s)*(1 + 10*s),
1 + 2*s}}}, s], 1, z]ToDiscreteTimeModel[TransferFunctionModel[{{{a + s}}, b + s},
s], τ, z]Convert a time-delay TransferFunctionModel:
ToDiscreteTimeModel[TransferFunctionModel[{{{s/E^(3*s)}},
1 - 2*s + s^2}, s], 1]Convert a singular descriptor StateSpaceModel:
ToDiscreteTimeModel[StateSpaceModel[{{{1, 0, 0}, {0, 1, 0}, {0, 0, -7}}, {{0}, {1}, {1}}, {{-1, 16, 12}}, {{0}},
{{0, 1, 0}, {0, 0, 0}, {0, 0, 1}}}, SamplingPeriod -> None, SystemsModelLabels -> None], 1 / 2]Options (5)
Method (5)
By default, the approximation is based on the bilinear transformation:
ToDiscreteTimeModel[TransferFunctionModel[{{{10}}, 1 + s}, s], 1, z]Specify the desired approximation method:
ToDiscreteTimeModel[TransferFunctionModel[{{{0.5*(4 + 2.*s + s^2)}},
s*(1 + 10*s)}, s], 1, z, Method -> "ForwardRectangularRule"]Compare the various approximation methods:
tfm = TransferFunctionModel[{{{s}}, 1 + s + s^2}, s];Grid[tfmd = Table[{m, ToDiscreteTimeModel[tfm, 0.4, z, Method -> m]}, {m, {"ForwardRectangularRule", "BackwardRectangularRule", "BilinearTransform", "ZeroOrderHold", "FirstOrderHold"}}], Frame -> All]BodePlot[Join[{Tooltip[tfm]}, Apply[Tooltip, Reverse[#]]& /@ tfmd], {0.05, (π/0.4)}]An approximation that preserves the transmission at the specified frequency:
tfm = TransferFunctionModel[{{{s}}, 6 + s}, s];tfmd = ToDiscreteTimeModel[tfm, 2, z, Method -> {"BilinearTransform", "CriticalFrequency" -> 0.5}]pts = Point[{#}]& /@ Through@{{Log10[0.5], 20 Log10@Abs[#]}&, {Log10[0.5], (Arg[#]/Degree)}&}@tfm[I 0.5][[1, 1]];BodePlot[{tfm, tfmd}, {0.3, 0.7}, Epilog -> pts]The bilinear and backward Euler methods may add states to descriptor state-space models:
ToDiscreteTimeModel[StateSpaceModel[{{{-1, 1}, {0, 1}}, {{1/2}, {2}}, {{1, 0}}, {{0}}, {{-1, 1}, {0, 1}}},
SamplingPeriod -> None, SystemsModelLabels -> None], 1, Method -> "BackwardRectangularRule"]Applications (1)
Various approximations to a fourth-order Butterworth lowpass filter:
tfmbw4 = TransferFunctionModel[{{{625}}, (25 + 3.8268*s + s^2)*
(25 + 9.2387*s + s^2)}, s];methods = {"ForwardRectangularRule", "BackwardRectangularRule", "BilinearTransform", {"BilinearTransform", "CriticalFrequency" -> 2.8}, "ZeroOrderHold", "FirstOrderHold"};Grid[tfmbw4d = Table[{m, ToDiscreteTimeModel[tfmbw4, 1, z, Method -> m]//TransferFunctionExpand}, {m, methods}], Frame -> All]BodePlot[Join[{Tooltip[tfmbw4]}, Apply[Tooltip, Reverse[#]]& /@ tfmbw4d], {2, 2π}]Properties & Relations (5)
A stable transfer-function model:
tfm = TransferFunctionModel[{{{5 + s}}, (0.5 + s)*(6 + s)},
s];The "ForwardRectangularRule" method may not give a stable approximation:
ToDiscreteTimeModel[tfm, 1, Method -> "ForwardRectangularRule"];TransferFunctionPoles[%]The stability of the "BilinearTransform" approximation depends on the critical frequency:
ToDiscreteTimeModel[tfm, 1, Method -> {"BilinearTransform", "CriticalFrequency" -> 0.5 π}];Critical frequencies less than the Nyquist frequency give stable approximations:
TransferFunctionPoles[%]When the critical frequency is more than the Nyquist frequency, the approximation is unstable:
ToDiscreteTimeModel[tfm, 1, Method -> {"BilinearTransform", "CriticalFrequency" -> 3.5 π}];TransferFunctionPoles[%]All other approximations give a stable system if the continuous-time system is stable:
Table[ToDiscreteTimeModel[TransferFunctionModel[{{{1}}, s + λ}, s], τ, Method -> m], {m, {"BackwardRectangularRule", "ZeroPoleMapping", "ZeroOrderHold", "FirstOrderHold"}}];Flatten[Simplify[TransferFunctionPoles[#]]& /@ %]Map[Refine[Abs[#] < 1, τ > 0 && λ > 0]&, %]ToContinuousTimeModel is essentially the inverse of ToDiscreteTimeModel:
c2d2c[sys_, τ_, method_] := ToContinuousTimeModel[ToDiscreteTimeModel[sys, τ, Method -> method], Method -> method]Table[c2d2c[TransferFunctionModel[{{{s}}, 1 + s}, s], 1, method], {method, {"ForwardRectangularRule", "BackwardRectangularRule", "BilinearTransform", "ZeroOrderHold", "FirstOrderHold"}}]Time delays
in the resulting system are given relative to the sampling period
:
ToDiscreteTimeModel[StateSpaceModel[{{{-SystemsModelDelay[Τ]}}, {{1}}, {{1}}, {{0}}},
SamplingPeriod -> None, SystemsModelLabels -> None], τ]SystemsModelDelayToDiscreteTimeModel may add states to systems with neutral time delays:
ToDiscreteTimeModel[StateSpaceModel[{{{-2, 0}, {0, 0}}, {{0}, {1}}, {{2, 0}}, {{0}},
{{1, 0}, {0, 1 - SystemsModelDelay[2]}}}, SamplingPeriod -> None, SystemsModelLabels -> None], 1]History
Text
Wolfram Research (2010), ToDiscreteTimeModel, Wolfram Language function, https://reference.wolfram.com/language/ref/ToDiscreteTimeModel.html.
CMS
Wolfram Language. 2010. "ToDiscreteTimeModel." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ToDiscreteTimeModel.html.
APA
Wolfram Language. (2010). ToDiscreteTimeModel. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ToDiscreteTimeModel.html
BibTeX
@misc{reference.wolfram_2026_todiscretetimemodel, author="Wolfram Research", title="{ToDiscreteTimeModel}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/ToDiscreteTimeModel.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_todiscretetimemodel, organization={Wolfram Research}, title={ToDiscreteTimeModel}, year={2010}, url={https://reference.wolfram.com/language/ref/ToDiscreteTimeModel.html}, note=[Accessed: 13-June-2026]}