```python
from sympy import diag, var, simplify, collect, expand, solve, sin, cos, Matrix, eye, diff, Function, expand_power_base, exp
from sympy.physics.mechanics import mlatex, mechanics_printing
mechanics_printing()
```


```python
var("s t")
```


```python
A = Matrix([[2, 0, 0], [-1, 5, 1], [1, 1, 5]])
```


```python
exp(A*t)
```


```python
P = Matrix([[-2, 0, 0], [-1, 1, -1], [1, 1, 1]])
Ā = P.inv()*A*P
```


```python
P, P.inv(), Ā
```


```python
P*exp(Ā*t)*P.inv()
```


```python
exp(Ā*t)
```


```python
simplify(expand((s*eye(3) - A).inv()))
```


```python
eye(3), A, A**2
```


```python
Matrix([[1, 2, 4], [1, 4, 16], [1, 6, 36]]).inv()*8
```


```python
A = diag(1, 2, 3, 1, 2, 3, 4)
```


```python
((Matrix([[1, 2, 3, -1, 5, 1, 1]])*(s*eye(7) - A).inv()*Matrix([[1, -1, 1, -1, 1, -1, 1]]).T)[0]).factor().simplify()
```


```python
from numpy import array, matrix, kron, eye, zeros, vstack, hstack, linspace
from scipy.linalg import expm
```


```python
%precision 1
```




    '%.1f'




```python
A = matrix([[-9, 0, 1], [5, -7, 9], [-2, -5, -6]])
```


```python
Q = eye(3)
```


```python
matrix(-Q.flatten("F")).T
```




    matrix([[-1.],
            [-0.],
            [-0.],
            [-0.],
            [-1.],
            [-0.],
            [-0.],
            [-0.],
            [-1.]])




```python
kron(eye(3), A.T) + kron(A.T, eye(3)).I
```




    matrix([[ -9.1e+00,   5.0e+00,  -2.0e+00,  -1.5e-02,   0.0e+00,   0.0e+00,
               4.7e-02,   0.0e+00,   0.0e+00],
            [  0.0e+00,  -7.1e+00,  -5.0e+00,   0.0e+00,  -1.5e-02,   0.0e+00,
               0.0e+00,   4.7e-02,   0.0e+00],
            [  1.0e+00,   9.0e+00,  -6.1e+00,   0.0e+00,   0.0e+00,  -1.5e-02,
               0.0e+00,   0.0e+00,   4.7e-02],
            [  6.1e-03,   0.0e+00,   0.0e+00,  -9.1e+00,   5.0e+00,  -2.0e+00,
               5.5e-02,   0.0e+00,   0.0e+00],
            [  0.0e+00,   6.1e-03,   0.0e+00,   0.0e+00,  -7.1e+00,  -5.0e+00,
               0.0e+00,   5.5e-02,   0.0e+00],
            [  0.0e+00,   0.0e+00,   6.1e-03,   1.0e+00,   9.0e+00,  -6.1e+00,
               0.0e+00,   0.0e+00,   5.5e-02],
            [ -8.5e-03,   0.0e+00,   0.0e+00,  -1.0e-01,   0.0e+00,   0.0e+00,
              -9.1e+00,   5.0e+00,  -2.0e+00],
            [  0.0e+00,  -8.5e-03,   0.0e+00,   0.0e+00,  -1.0e-01,   0.0e+00,
               0.0e+00,  -7.1e+00,  -5.0e+00],
            [  0.0e+00,   0.0e+00,  -8.5e-03,   0.0e+00,   0.0e+00,  -1.0e-01,
               1.0e+00,   9.0e+00,  -6.1e+00]])




```python
(kron(eye(3), A.T) + kron(A.T, eye(3)).I)*(matrix(-Q.flatten("F")).T)
```




    matrix([[ 9.1],
            [ 0. ],
            [-1. ],
            [-5. ],
            [ 7.1],
            [-9.1],
            [ 2. ],
            [ 5.1],
            [ 6.1]])




```python

```

2f9e5ccc46a09805e90e063f4a6a15437d3e3eb6
ipynb
Jupyter Notebook
IPythonNotebooks/Sistemas lineales/Tarea 7.ipynb
robblack007/DCA
0ea5f8b613e2dabe1127b857c7bfe9be64c52d20
MIT
IPythonNotebooks/Sistemas lineales/Tarea 7.ipynb
robblack007/DCA
0ea5f8b613e2dabe1127b857c7bfe9be64c52d20
MIT
IPythonNotebooks/Sistemas lineales/Tarea 7.ipynb
robblack007/DCA
0ea5f8b613e2dabe1127b857c7bfe9be64c52d20
MIT
2021-03-20T12:44:13.000Z
2021-03-20T12:44:13.000Z
Qwen/Qwen-72B
1. YES
2. YES