```python
import numpy as np
import matplotlib.pyplot as plt
import sympy as senpai
from sympy import print_latex
```


```python
# Definiujemy obiekty biblioteki SymPy
t, y, s, w, j = senpai.symbols('t y s w j')
```


```python
Ks = senpai.Matrix([[1,2,3], [4,5,6],[7,8,9]])
print_latex(Ks)
print("K(s)=")
Ks
```

    \left[\begin{matrix}1 & 2 & 3\\4 & 5 & 6\\7 & 8 & 9\end{matrix}\right]
    K(s)=





$\displaystyle \left[\begin{matrix}1 & 2 & 3\\4 & 5 & 6\\7 & 8 & 9\end{matrix}\right]$




```python
a = senpai.Matrix([[1,2,0], [4,5,1]])
print_latex(a)
print("a=")
a
```

    \left[\begin{matrix}1 & 2 & 0\\4 & 5 & 1\end{matrix}\right]
    a=





$\displaystyle \left[\begin{matrix}1 & 2 & 0\\4 & 5 & 1\end{matrix}\right]$




```python
a*Ks
```




$\displaystyle \left[\begin{matrix}9 & 12 & 15\\31 & 41 & 51\end{matrix}\right]$




```python
K = s**4 + 2*s**3 + 3*s**2 + 10*s + 8
K 
```




$\displaystyle s^{4} + 2 s^{3} + 3 s^{2} + 10 s + 8$




```python
senpai.factor(K)
```




$\displaystyle \left(s + 1\right) \left(s + 2\right) \left(s^{2} - s + 4\right)$




```python
print_latex(senpai.solve(K,s))
```

    \left[ -2, \  -1, \  \frac{1}{2} - \frac{\sqrt{15} i}{2}, \  \frac{1}{2} + \frac{\sqrt{15} i}{2}\right]


$\left[ -2, \  -1, \  \frac{1}{2} - \frac{\sqrt{15} i}{2}, \  \frac{1}{2} + \frac{\sqrt{15} i}{2}\right]$


```python
plt.scatter([-2, -1, 0.5, 0.5], [0, 0, -np.sqrt(15)/5, np.sqrt(15)/5])
# plt.grid(True)
plt.axes()
# plt.axes(rect, projection=None, polar=False, **kwargs)
# plt.axes(ax)
plt.show()
```


```python
type(senpai.Float(senpai.re(im)))
```




    sympy.core.numbers.Float




```python

```




$\displaystyle k$




```python
-np.sqrt(15)/5
```




    -0.7745966692414834



571eb8e44a88da726023da5fbe3223202ee2b7db
ipynb
Jupyter Notebook
CW/CW6/boze.ipynb
John15321/TR
82dd73425dde3a5f3f50411b2ee03be88e8bf65e
MIT
2021-02-04T10:39:41.000Z
2021-04-15T13:32:46.000Z
CW/CW6/boze.ipynb
John15321/TR
82dd73425dde3a5f3f50411b2ee03be88e8bf65e
MIT
CW/CW6/boze.ipynb
John15321/TR
82dd73425dde3a5f3f50411b2ee03be88e8bf65e
MIT
Qwen/Qwen-72B
1. YES
2. YES