# Apollo Lunar Module


```python
import numpy as np
import sympy as sy
sy.init_printing()
```


```python
!pip install sympy
```

    Collecting sympy
      Downloading sympy-1.9-py3-none-any.whl (6.2 MB)
    [K     |████████████████████████████████| 6.2 MB 522 kB/s eta 0:00:01
    [?25hCollecting mpmath>=0.19
      Downloading mpmath-1.2.1-py3-none-any.whl (532 kB)
    [K     |████████████████████████████████| 532 kB 222 kB/s eta 0:00:01
    [?25hInstalling collected packages: mpmath, sympy
    Successfully installed mpmath-1.2.1 sympy-1.9
    [33mWARNING: You are using pip version 21.2.4; however, version 21.3 is available.
    You should consider upgrading via the '/home/kjartan/.pyenv/versions/3.8.11/envs/tug/bin/python3.8 -m pip install --upgrade pip' command.[0m



```python
s = sy.symbols('s', real=False)
k1, k2 = sy.symbols('k_1, k_2')
k1
```


```python
A = sy.Matrix([[0,0,0],[1,0,0],[0,k2,0]])
B = sy.Matrix([[k1],[0],[0]])
A
```


```python
l0, l1, l2, l3 = sy.symbols('l_0, l_1, l_2, l_3') 
L = sy.Matrix([[l1, l2, l3]])
L
```


```python
M = s*sy.eye(3) - (A-B*L)
M
```


```python
char_pol = sy.poly(sy.det(M), s)
```

## Desired closed-loop poles


```python
p1 = -np.sqrt(2)
p2 = complex(-1,1)
p3 = complex(-1, -1)
p3
```




    (-1-1j)




```python
char_pol_des = sy.poly((s-p1)*(s-p2)*(s-p3), s)
```


```python
char_pol_des
```


```python
eqns = [c_ - cd_ for c_, cd_ in zip(char_pol.coeffs(), char_pol_des.coeffs())]
eqns
```


```python
sol = sy.solve(eqns, [l1, l2, l3])
```


```python
sol
```


```python

```

eaf3a1239a7fbef80d465fb2e097a5f169f2bbae
ipynb
Jupyter Notebook
modern-control/notebooks/.ipynb_checkpoints/Apollo-lunar-module-feedback-design-checkpoint.ipynb
kjartan-at-tec/mr2025
88c28aa76e84890c25d252167e5bbcd25318463e
MIT
modern-control/notebooks/.ipynb_checkpoints/Apollo-lunar-module-feedback-design-checkpoint.ipynb
kjartan-at-tec/mr2025
88c28aa76e84890c25d252167e5bbcd25318463e
MIT
modern-control/notebooks/.ipynb_checkpoints/Apollo-lunar-module-feedback-design-checkpoint.ipynb
kjartan-at-tec/mr2025
88c28aa76e84890c25d252167e5bbcd25318463e
MIT
Qwen/Qwen-72B
1. YES
2. YES