```
from sympy import *
```


```
n_u, n_b, m_p, m_r = symbols("n_u n_b m_p m_r")
F = MatrixSymbol("F", n_u, n_u)
M = MatrixSymbol("M", n_b, n_b)
C = MatrixSymbol("C", n_b, n_u)
B = MatrixSymbol("B", m_p, n_u)
D = MatrixSymbol("D", m_r, n_b)
```


```
B.T.shape
```




    (n_u, m_p)




```
A = BlockMatrix([[F,B.T,C.T,ZeroMatrix(n_u,m_r)],
                 [B,ZeroMatrix(m_p,m_p),ZeroMatrix(m_p,n_b),ZeroMatrix(m_p,m_r)],
                 [-C,ZeroMatrix(n_b,m_p),M,D.T],
                 [ZeroMatrix(m_r,n_u),ZeroMatrix(m_r,m_p),D,ZeroMatrix(m_r,m_r)]])
A
```




    [     F, B', C',  0]
    [     B,  0,  0,  0]
    [(-1)*C,  0,  M, D']
    [     0,  0,  D,  0]




```
n_u, n_b, m_p, m_r = symbols("n_u n_b m_p m_r")
F = Symbol("F")
M = Symbol("M")
C = Symbol("C")
Ct = Symbol("Ct")
B = Symbol("B")
Bt = Symbol("Bt")
D = Symbol("D")
Dt = Symbol("Dt")

```


```
A = Matrix([[F,Bt,Ct,0],[B,0,0,0],[-C,0,M,Dt],[0,0,D,0]])
A
```




    [ F, Bt, Ct,  0]
    [ B,  0,  0,  0]
    [-C,  0,  M, Dt]
    [ 0,  0,  D,  0]




```
A.LUdecomposition()
```




    ([   1,    0,   0, 0]
    [ B/F,    1,   0, 0]
    [-C/F, -C/B,   1, 0]
    [   0,    0, D/M, 1],
     [F,      Bt,      Ct,       0]
    [0, -B*Bt/F, -B*Ct/F,       0]
    [0,       0,       M,      Dt]
    [0,       0,       0, -D*Dt/M],
     [])



8070cd66ae8365f66866e11281912df6599655fd
ipynb
Jupyter Notebook
MHD/BLKdecomps/Untitled0.ipynb
wathen/PhD
35524f40028541a4d611d8c78574e4cf9ddc3278
MIT
2020-10-25T13:30:20.000Z
2021-08-10T21:27:30.000Z
MHD/BLKdecomps/Untitled0.ipynb
wathen/PhD
35524f40028541a4d611d8c78574e4cf9ddc3278
MIT
MHD/BLKdecomps/Untitled0.ipynb
wathen/PhD
35524f40028541a4d611d8c78574e4cf9ddc3278
MIT
2019-10-28T16:12:13.000Z
2020-01-13T13:59:44.000Z
Qwen/Qwen-72B
1. YES
2. YES