```python
import sympy as sy
import numpy as np
```


```python
w, a, b = sy.symbols('w, a, b', real=True, positive=True)
s = sy.symbols('s', real=False)
Kd, Kp, Ki = sy.symbols('Kd, Kp, Ki', real=True, positive=True)

```


```python
p1 = -w
p2 = -np.sqrt(2)/2*w + sy.I*np.sqrt(2)/2*w
p3 = -np.sqrt(2)/2*w - sy.I*np.sqrt(2)/2*w
```


```python
sy.simplify(sy.expand((s-p2)*(s-p3)))
```




    s**2 + 1.4142135623731*s*w + 1.0*w**2




```python
Ac = sy.simplify(sy.expand((s-p1)*(s-p2)*(s-p3)))
```




    s**3 + 2.41421356237309*s**2*w + 2.4142135623731*s*w**2 + 1.0*w**3




```python
A = s**2 + a*s -w*w
B = b
R = s
S = Kd*s**2 + Kp*s + Ki
LHS = sy.collect(sy.expand(A*R+B*S), s)
print LHS
```

    Ki*b + s**3 + s**2*(Kd*b + a) + s*(Kp*b - w**2)



```python

```

5e6ec1a5bce17496beaadf29b76b72db07f65e64
ipynb
Jupyter Notebook
notebooks/PID-control-inverted-pendulum.ipynb
alfkjartan/ingenieria-de-control
f9d9aa927376894dea1c9ae57de810342aa74e4d
MIT
notebooks/PID-control-inverted-pendulum.ipynb
alfkjartan/ingenieria-de-control
f9d9aa927376894dea1c9ae57de810342aa74e4d
MIT
notebooks/PID-control-inverted-pendulum.ipynb
alfkjartan/ingenieria-de-control
f9d9aa927376894dea1c9ae57de810342aa74e4d
MIT
Qwen/Qwen-72B
1. YES
2. YES