# Simulink Treating Discrete-Time State-Space as Continuous-Time?

I have a MATLAB script wherein I take a second-order ODE on $$\mathbb{R}^3$$ (vector field on the phase space), then, at a critical point, take the Jacobian matrix $$A$$, use a "fully-actuated" input matrix $$B = I_6$$, convert the continuous-time state-space system to a discrete-time state-space system via $$[G\ H;\ 0\ I] = \text{expm}(T_s[A\ B;\ 0\ 0])$$ (where $$T_s = 0.1 s$$), then find a gain matrix $$K = \text{place}(G,H,\text{zeros}(6,1))$$ so the closed-loop discrete-time state-space system, $$G-HK$$, has all its eigenvalues at 0 http://airvigilante194.sdf.org/Scripts/deadbeat.m. This is supposed to implement deadbeat control.

Here are the $$A$$ and $$B$$ matrices and the eigenvalues of $$A$$. Here are the $$G$$, $$H$$, and $$K$$ matrices Here is $$G-HK$$ and its eigenvalues However, when I go to implement it in Simulink http://airvigilante194.sdf.org/Scripts/deadbeatJeff03.slx, Simulink appears to treat the system as a continuous-time system and sort-of passes straight through the unit step inputs.

(The other 3 scopes are just the derivatives of the first three scopes, so zero with the unit step passed straight through.)

Strangely, when I implement the system in Simulink using $$G, B,$$ and $$K$$, the eigenvalues of $$G-BK = G-IK = G-K$$ all have real part between -8.4 and -9.6, so this does function as a sort-of deadbeat control, keeping the system at or very near the set-point of 0 http://airvigilante194.sdf.org/Scripts/deadbeatJeff02.slx.

Here is $$G-K$$ and its eigenvalues Here is the system without the feedback loop and $$K$$ http://airvigilante194.sdf.org/Scripts/deadbeatJeff01.slx.

You can see, in continuous time, it has one negative real part eigenvalue, which just grows linearly with the unit step, one positive real part eigenvalue, which grows exponentially, and one purely imaginary eigenvalue (really, two) that oscillates (The other three scopes are just the derivatives of these scopes, with the same linear growth from the unit step from the first). Here are the eigenvalues of $$G$$ and their moduli ("moduluses") You can see it has two with modulus $$>1$$, two with modulus $$<1$$ and two with modulus $$=1$$, so it is displaying the correct behavior for discrete time.

Would someone help me puzzle out how to implement deadbeat control in deadbeatJeff03.slx, so the systems returns to the set-point of 0 in $$\le 0.6 s$$? I suspect and hope it's something simple I'm missing. Thanks in advance.

Edit: When I use $$0 = G-HK$$ for the $$G$$ matrix, $$I$$ for the $$H$$ matrix, and no feedback loop in the discrete-time block diagram, it does indeed display deadbeat control. http://airvigilante194.sdf.org/Scripts/deadbeatJeff04.slx Something about putting in the feedback loop with the gain matrix $$K$$ appears to make Simulink treat the system as a continuous-time system. If someone understands that phenomenon and can instruct me as to how to put a feedback loop on a discrete-time system and make it still discrete-time in Simulink, "that'd be great"; otherwise, I can just do this kluge.

• 1 Can you add a screenshot of the block diagram (and that of relevant subsystems)? Simulink provides facility to take screenshots. Few people will follow links to files and even fewer would have appropriate version of Simulink installed. 2 Why do you think that Simulink treats the system as continuous time system ? Can you post some input and output plots ? 3 What is the logic behind placing poles at origin creating a dead beat control ? Do you have a source / reference for that ? 4 How did you arrive at the numbers -8.4, -9.6 ? Using Simulinks' inbuilt lineariser ?
– AJN
Jan 14 at 12:13
• 1 I added the screenshots. 2 I think it is treating it like a continuous system because it appears to be using negative real part eigenvalues as stable instead of modulus $< 1$ eigenvalues as stable. 3 The logic behind putting the eigenvalues at 0 is that, in the Riemann sphere, with the exponential function, 0 is the image of $\Re(\alpha)=-\infty$, so the system is "infinitely dampened"; see smile.amazon.com/Discrete-Time-Control-Systems-Katsuhiko-Ogata/… 4 I have screenshots for the matrices and eigenvalues Jan 14 at 14:15
• I don't have simulink with me now; but a few things 1. There is an amplitude quantisation block, but no sample and hold block. 2. Where in the diagram have you specified the sampling interval? Is it inside the $x_{n+1}=Ax_n + \dots$ block? I haven't gone through the edite question in detail though.
– AJN
Jan 14 at 15:31
• First off, thanks for responding; I should have said that in the first comment. Second, 1 I don't have a zero-order hold because I was getting bizarre results and I wanted to keep it in the discrete-time domain; I guess I should add those now that I know what's going on a little more now. 2 The sampling time of 0.1s is specified in the quantization block; it should get propagated to the $x_{n+1} = Ax_n + \ldots$ state-space and other blocks. Thanks again Jan 14 at 16:02

Continuous time matrices 