Calculating input impedance of 3 port network
The 3-port can be described in 3 equations, using

$$\left(\begin{matrix}
V_1 \\
V_2 \\
V_3
\end{matrix}\right) = \left(\begin{matrix}
Z_{11} &amp; Z_{12} &amp; Z_{13} \\
Z_{21} &amp; Z_{22} &amp; Z_{23} \\
Z_{31} &amp; Z_{32} &amp; Z_{33} \end{matrix}\right)\left(\begin{matrix}
I_1 \\
I_2 \\
I_3\end{matrix}\right)$$

I will now load ports 1 and 2, while using port 3 as the input. Adding two loads adds two new equations

$$\begin{align}
V_1 &amp;= -Z_{L1}\cdot I_1 \\
V_2 &amp;= -Z_{L2}\cdot I_2
\end{align}$$

This can be inserted into the matrix notation:

$$\left(\begin{matrix}
Z_{11} &amp; Z_{12} &amp; Z_{13} \\
Z_{21} &amp; Z_{22} &amp; Z_{23} \\
Z_{31} &amp; Z_{32} &amp; Z_{33} \end{matrix}\right)\left(\begin{matrix}
I_1 \\
I_2 \\
I_3\end{matrix}\right) = \left(\begin{matrix}
-Z_{L1}\cdot I_1 \\
-Z_{L2}\cdot I_2 \\
V_3
\end{matrix}\right)$$

Which is the same as

$$\left(\begin{matrix}
Z_{11} + Z_{L1} &amp; Z_{12} &amp; Z_{13} \\
Z_{21} &amp; Z_{22} + Z_{L2} &amp; Z_{23} \\
Z_{31} &amp; Z_{32} &amp; Z_{33} \end{matrix}\right)\left(\begin{matrix}
I_1 \\
I_2 \\
I_3\end{matrix}\right) = \left(\begin{matrix}
0 \\
0 \\
V_3
\end{matrix}\right)$$

Since we want to solve for \$Z_{in} = \frac{V_3}{I_3}\$, we can use Cramer's rule to find

$$
I_3 = \frac{\left|\begin{matrix}
Z_{11} + Z_{L1} &amp; Z_{12} &amp; 0 \\
Z_{21} &amp; Z_{22} + Z_{L_2} &amp; 0 \\
Z_{31} &amp; Z_{32} &amp; V_3
\end{matrix}\right|}{\left|\begin{matrix}
Z_{11} + Z_{L1} &amp; Z_{12} &amp; Z_{13} \\
Z_{21} &amp; Z_{22} + Z_{L2} &amp; Z_{23} \\
Z_{31} &amp; Z_{32} &amp; Z_{33} \end{matrix}\right|}\
$$

Or also

$$
Z_{in} = \frac{V_3}{I_3} = \frac{\left|\begin{matrix}
Z_{11} + Z_{L1} &amp; Z_{12} &amp; Z_{13} \\
Z_{21} &amp; Z_{22} + Z_{L2} &amp; Z_{23} \\
Z_{31} &amp; Z_{32} &amp; Z_{33} \end{matrix}\right|}{\left|\begin{matrix}
Z_{11} + Z_{L1} &amp; Z_{12} &amp; 0 \\
Z_{21} &amp; Z_{22} + Z_{L_2} &amp; 0 \\
Z_{31} &amp; Z_{32} &amp; 1
\end{matrix}\right|}
$$