MATLAB: Conversion between state space and transfer function

state-spacetransfer function

these are the state space variables:
A=[-1 -1;6.5 0], B=[1 1;1 0], C=[1 0;0 1], D=[0 0;0 0]
when i convert them to transfer function, it works fine but, when i convert them back to state space then i dont get the same matrices. please help me out.

Best Answer

An infinite number of state space realizations correspond to a single transfer function. From a transfer function, the Control System Toolbox function ss() computes a realization that it believes has some desirable properties. You have some control, but not much, over what ss() returns. See the doc page for ss for more details.
Once you convert your original state space realization to a transfer function, CST doesn't really care, nor know, about the original state space realization from which you generated the transfer function. So, when it converts that tf back to ss, it just returns what it thinks is best.
However, the state space realization that you start with and the one that you end with after the two-step conversion will still have the same input/output dynamics, e.g., step responses and Bode plots should match (to within numerical precision).