d2c

Method of mss.

Convert a discrete-time MTI system to a continuous-time MTI system.

Source: src/model/@mss/d2c.m

Syntax

sysc = d2c(sysd, Ts)
sysc = d2c(sysd, Ts, method)

Description

d2c is the inverse of c2d: it reconstructs a continuous-time model from the discrete-time explicit model

xk+1=f(xk,uk),yk=g(xk,uk). x_{k+1} = f(x_k,u_k), \qquad y_k = g(x_k,u_k).

The model must be discrete (timeStepSize ~= 0), otherwise the call errors with “The mss model is already continuous.”

method Rule Result
"forward" (default) Forward Euler inverted, ẋ=(f(x,u)x)/Ts\dot x = (f(x,u) - x)/T_s mss — stays explicit
"backward" Backward Euler mdss — implicit, warns
"tustin" Trapezoidal mdss — implicit, warns

As in c2d, only forward Euler preserves explicitness; "backward" and "tustin" convert with mss2mdss and delegate to d2c of the mdss class after warning about the changed return type. In this case, if the mtiBase of sysc was the literal base, the model base is not preserved because the mdss class does not yet support literal base models.

How forward Euler is inverted

Undoing xk+1=xk+Tsf(xk,uk)x_{k+1} = x_k + T_s f(x_k,u_k) means subtracting the identity term and dividing by the sample time. As in c2d this is done on the CPN matrices: one monomial column per state is appended and the state parameter block becomes [ΦFI]/Ts[\,\Phi_F\ \ -I\,]/T_s, the output block staying [ΦG0][\,\Phi_G\ \ 0\,]:

Sc=[S[I0]],Φc=[ΦF/TsI/TsΦG0], S_c = \big[\,S\ \ \big[\begin{smallmatrix}I\\0\end{smallmatrix}\big]\,\big], \qquad \Phi_c = \begin{bmatrix} \Phi_F/T_s & -I/T_s \\ \Phi_G & 0 \end{bmatrix},

i.e. ẋ=(f(x,u)x)/Ts\dot x = \big(f(x,u) - x\big)/T_s and y=g(x,u)y = g(x,u). Signal names are carried over and the result is cleaned up with trivialReduction.

There is no TTTensor path — a tensor-train model raises “No TT implemented Yet”.

Input arguments

Argument Description
sysd Discrete-time mss model (timeStepSize ~= 0).
Ts Sample time that was used for the discretization, Ts > 0.
method (optional) "forward" (default), "backward" or "tustin".

Output arguments

Output Description
msys Continuous-time model: an mss for "forward", an mdss for "backward" / "tustin".

Example

sysc = rmss(3,1,1,4);            % continuous-time model
sysd = c2d(sysc, 0.01);          % discretize

sysr = d2c(sysd, 0.01);          % reconstruct
sysr.timeStepSize = 0;           % mark it continuous again (see note above)

See also

c2d · mss · msim · trivialReduction · mss2mdss · d2c


MyToolbox Documentation | Generated automatically by CI/CD pipeline