```python
import sympy
from phasor.utilities.ipynb.displays import *
from phasor.utilities.ipynb.ipy_sympy import *
```

    Populating the interactive namespace from numpy and matplotlib
    Sympy version:  1.0



```python
Z_11 = sympy.var('Z_11')
Z_22 = sympy.var('Z_22')
Z_12 = sympy.var('Z_12')
Z_21 = sympy.var('Z_21')
Z = sympy.Matrix([[Z_11, Z_12], [Z_21, Z_22]])
Z = sympy.Matrix([[Z_11, Z_12], [Z_21, Z_22]])
Z
Y = Z**-1
Y.simplify()
Y
Y = sympy.Matrix([[0, 1/Z_11], [1/Z_11, 0]])
```


```python
B_I = sympy.Matrix([[1,0],[-1,0],[0,1],[0,-1]])
B_V = sympy.Matrix([[1,0],[1,0],[0,1],[0,1]])
B_X = sympy.Matrix([[-1,0],[1,0],[0,1],[0,1]])
B_I.transpose()
```


```python
Z4 = B_I * Z * (B_I.transpose())
Z4
Y4 = sympy.Matrix([[1/Z_11,-1/Z_11,1/Z_12,-1/Z_12],[-1/Z_11,1/Z_11,-1/Z_12,1/Z_12],[1/Z_21,-1/Z_21,1/Z_22,-1/Z_22],[-1/Z_21,1/Z_21,-1/Z_22,1/Z_22]])
Y4

```


```python
I4 = sympy.eye(4)
Z_c = sympy.var('Z_c')
Y_c = sympy.var('Y_c')
y_c = sympy.sqrt(Y_c) * I4
z_c = sympy.sqrt(Z_c) * I4
z_c = 1/sympy.sqrt(Y_c) * I4
S = ((y_c * Z4  * y_c - I4) * (y_c * Z4  * y_c + I4)**(-1))
S = (I4 - z_c * Y4  * z_c ) * (I4 + z_c * Y4  * z_c)**(-1)
S.simplify()
display(S)
```


```python
print(S[0,0] == S[1,1])
print(S[1,0] == S[0,1])
print(S[2,0] == -S[2,1])
print(S[2,0] == -S[3,0])
print(S[2,0] == S[3,1])
print(S[3,0] == S[2,1])
```

    True
    True
    True
    True
    True
    True



```python

A = sympy.var('A')
Z_11 = sympy.var('Z_11')
Z_22 = sympy.var('Z_22')
Z_12 = sympy.var('Z_12')
Z_21 = sympy.var('Z_21')
Z = sympy.Matrix([[Z_12, -Z_12], [-Z_12, Z_12]])
Y = sympy.Matrix([[1/Z_12, -1/Z_12], [-1/Z_12, 1/Z_12]])

I2 = sympy.eye(2)
Z_c = sympy.var('Z_c')
Y_c = sympy.var('Y_c')
y_c = sympy.sqrt(Y_c) * I2
z_c = sympy.sqrt(Z_c) * I2
z_c = 1/sympy.sqrt(Y_c) * I2
S = ((y_c * Z  * y_c - I2) * (y_c * Z  * y_c + I2)**(-1))
S = (I2 - z_c * Y  * z_c ) * (I2 + z_c * Y  * z_c)**(-1)
S.simplify()
display(S)
display(sympy.limit(S[0,0], A, sympy.oo))
display(sympy.limit(S[0,1], A, sympy.oo))
```


```python

```

4788c00fee39bb8bd75ac988dc82f3aaf8e0c7fe
ipynb
Jupyter Notebook
phasor/derivations/Z-to-S-matrix.ipynb
mccullerlp/phasor-doc
d4255d015023c51b762340e51c15dde609715212
Apache-2.0
phasor/derivations/Z-to-S-matrix.ipynb
mccullerlp/phasor-doc
d4255d015023c51b762340e51c15dde609715212
Apache-2.0
phasor/derivations/Z-to-S-matrix.ipynb
mccullerlp/phasor-doc
d4255d015023c51b762340e51c15dde609715212
Apache-2.0
Qwen/Qwen-72B
1. YES
2. YES