From B-parameters to Y-parameters
In matrix form, the formula is
Y=([000−1]B+[0010])([0100]B+[1000])−1
While for each element, we obtain
Y11Y12Y21Y22=−B12B11=B121=B12B11B22−B12B21=−B12B22
The formulas are obtained with the methods explained here.
The MATLAB implementation can be found in circuitconversions on Gitlab.
Definitions
[V2−I2]=B[V1I1] | [I1I2]=Y[V1V2] |