# How to implement an improper discrete-time transfer function into Simulink

I am trying to model a discrete-time control system in Simulink. The control system contains an inner loop that utilizes the inverse of the plant model. The plant in question takes the form of:

$P(s) = \frac{3.332\times s + 4.679}{s^2+30.97\times s+45.5}$

s = tf('s');
P = (3.332*s + 4.679)/(s^2+30.97*s+45.5);


I inverted the plant, $P(s)^{-1}$:

P_inv = inv(P);


Now I have an inverted model however you cannot explicitly implement an improper function into Simulink. I followed this discussion that has been referred to multiple times scattered throughout forums.

[r,p,k]=residue(P_inv.num{1},P_inv.den{1});
sys1 = tf(r(1),[1,-p(1)]);
sysk1 = k(1)*s;
sysk2 = k(2);


Once the improper function is broken down, I discretized each component separately.

Ts = 0.005;
d_sys1 = c2d(sys1,Ts)
d_sysk1 = c2d(sysk1,Ts,'matched') % <--- problem


A problem now exists in d_sysk1. It results in yet another improper function taking the form of:

d_sysk1 =
59.99 z - 59.99
Sample time: 0.005 seconds
Discrete-time transfer function.


In my simulation I want to implement a discretized improper transfer function, P(s). Is there something I did incorrectly?