```python
import matplotlib as mpl
mpl.rcParams.update({
    'font.size' : 9.0,
    'mathtext.fontset' : 'stix',
    'font.family': 'STIXGeneral',
    'text.usetex': True
})
import matplotlib.pyplot as plt
import numpy as np
%matplotlib widget
```


```python
import sympy as sym
from sympy.abc import s,t,x,y,z
from sympy.integrals import laplace_transform
from sympy.integrals import inverse_laplace_transform

# Laplace transform (t->s)
U = laplace_transform(5*t, t, s)
print('U')
print(U[0])
# Result: 5/s**2

# Inverse Laplace transform (s->t)
X = inverse_laplace_transform(U[0],s,t)
print('X')
print(X)
# Result: 5*t*Heaviside(t)

# Function
F = 5*(s+1)/(s+3)**2
print('F')
print(F)
# Result: (5*s + 5)/(s + 3)**2

# Partial fraction decomposition
G = sym.apart(F)
print('G')
print(G)
# Result: 5/(s + 3) - 10/(s + 3)**2

# denominator of transfer function
d1 = (s+1)*(s+3)*(s**2+3*s+1)

# expand polynomial
d2 = sym.expand(d1)
print('d2')
print(d2)
# Result: s**4 + 7*s**3 + 16*s**2 + 13*s + 3

# find roots
print(sym.roots(d2))
# Result: {-1: 1, -3: 1, -3/2 - sqrt(5)/2: 1, -3/2 + sqrt(5)/2: 1}
```

    U
    5/s**2
    X
    5*t*Heaviside(t)
    F
    (5*s + 5)/(s + 3)**2
    G
    5/(s + 3) - 10/(s + 3)**2
    d2
    s**4 + 7*s**3 + 16*s**2 + 13*s + 3
    {-1: 1, -3: 1, -3/2 - sqrt(5)/2: 1, -3/2 + sqrt(5)/2: 1}



```python

```

3b648bcdce6fba0b308ce772337568de10d7eba3
ipynb
Jupyter Notebook
python/matplotlib/vector/basic/Untitled.ipynb
karng87/nasm_game
a97fdb09459efffc561d2122058c348c93f1dc87
MIT
python/matplotlib/vector/basic/Untitled.ipynb
karng87/nasm_game
a97fdb09459efffc561d2122058c348c93f1dc87
MIT
python/matplotlib/vector/basic/Untitled.ipynb
karng87/nasm_game
a97fdb09459efffc561d2122058c348c93f1dc87
MIT
Qwen/Qwen-72B
1. YES
2. YES