Numerator: {[0 0 0 -4]}
\nDenominator: {[1000000 30000 300 1]}
tf2 =
\n0\nNumerator: {[0 0 0]}
\nDenominator: {[5600 150 1]}
tf3 =
\n 0.75\n --------------------\n 5600 s^2 + 150 s + 1\nNumerator: {[0 0 0.7500]}
\nDenominator: {[5600 150 1]}
MatlabCode:
\nsys=[tf1,tf2;tf3,0];\nsys_ss=ss(sys);the output is:
\nsys_ss =\n \n A = \n x1 x2 x3 x4 x5\n x1 -0.03 -0.0192 -0.008192 0 0\n x2 0.01562 0 0 0 0\n x3 0 0.007812 0 0 0\n x4 0 0 0 -0.02679 -0.01143\n x5 0 0 0 0.01562 0\n \n B = \n u1 u2\n x1 0.25 0\n x2 0 0\n x3 0 0\n x4 0.125 0\n x5 0 0\n \n C = \n x1 x2 x3 x4 x5\n y1 0 0 -0.1311 0 0\n y2 0 0 0 0 0.06857\n \n D = \n u1 u2\n y1 0 0\n y2 0 0\nIn Python,I use control.ss:
\nimport control\n\nnum11 = [0,0,0,-4]\nnum12 = [0,0,0]\nnum21 = [0,0,0.7500]\nnum22 = [0]\n\nrow1 = [num11, num12]\nrow2 = [num21, num22]\nnumerator = [row1, row2]\ndenominator = [\n [[1000000, 30000, 300,1], [5600,150,1]],\n [[5600,150,1], [1]]\n ]\nG = control.tf(numerator,\n denominator)\ncontrol.ss(G )Then I got different StateSpace,
\n
What am I missing here? How can I fix to get the exact same results?
","upvoteCount":1,"answerCount":2,"acceptedAnswer":{"@type":"Answer","text":"A little problem is given by the very little values in the state matrix (...*e-17): I also found that python control doesn't approximate these values to \"0\".
","upvoteCount":1,"url":"https://github.com/python-control/python-control/discussions/1077#discussioncomment-11486012"}}}-
Beta Was this translation helpful? Give feedback.
-
|
Different results are normal, this is not an error! Try to cast again to tf to see the result. (Sorry, I can't check it because I don't have Matlab anymore!) For the same tf (or tf's) there are infinity possible state-space representations, depending on the chosen state variables! |
Beta Was this translation helpful? Give feedback.
-
|
A little problem is given by the very little values in the state matrix (...*e-17): I also found that python control doesn't approximate these values to "0". |
Beta Was this translation helpful? Give feedback.
A little problem is given by the very little values in the state matrix (...*e-17): I also found that python control doesn't approximate these values to "0".