Skip to content
\n

Numerator: {[0 0 0 -4]}
\nDenominator: {[1000000 30000 300 1]}

\n

tf2 =

\n
0\n
\n

Numerator: {[0 0 0]}
\nDenominator: {[5600 150 1]}

\n

tf3 =

\n
          0.75\n  --------------------\n  5600 s^2 + 150 s + 1\n
\n

Numerator: {[0 0 0.7500]}
\nDenominator: {[5600 150 1]}

\n

MatlabCode:

\n
sys=[tf1,tf2;tf3,0];\nsys_ss=ss(sys);
\n

the output is:

\n
sys_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\n
\n

In Python,I use control.ss:

\n
import 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 )
\n

Then I got different StateSpace,
\n\"屏幕截图

\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"}}}
Discussion options

You must be logged in to vote

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".

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@oHeHeHou
Comment options

@murrayrm
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by oHeHeHou
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants