In [8]:
import numpy as np
import sympy as sy
from sympy import init_printing
init_printing()
import control.matlab as cm
In [20]:
z = sy.symbols('z')
y0, y1 = sy.symbols('y0, y1', real=True)
In [21]:
den = z*z - z -1
num = z*z
Y = num/sy.factor(den)
sy.factor(den)
Out[21]:
In [22]:
sy.factor(Y)
Out[22]:
In [23]:
sy.apart(Y)
Out[23]:
In [24]:
sy.apart( z/den)
Out[24]:
In [25]:
p1 = (1 + sy.sqrt(5))/2
p2 = (1 - sy.sqrt(5))/2
sy.expand((z-p1)*(z-p2))
Out[25]:
In [28]:
Y = z/( (z-p1)*(z-p2))
Y
Out[28]:
In [29]:
sy.apart(Y)
Out[29]:
In [ ]: