Skip to content

Instantly share code, notes, and snippets.

@drvinceknight
Created October 23, 2015 13:08
Show Gist options
  • Save drvinceknight/0c91130639a6bcc9e085 to your computer and use it in GitHub Desktop.
Save drvinceknight/0c91130639a6bcc9e085 to your computer and use it in GitHub Desktop.
Calculate steady state
from sympy import Matrix
Q = [[-2, 1, 1],[3, -5, 2], [1, 1, -2]]
M = Matrix(Q)
pi = M.transpose().nullspace()[0]
pi = list(pi / sum(pi))
print pi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment