def TransresistanceAmplifierTwoPort(G, Zi, Zo, Z0=50.0):
    """TransresistanceAmplifierTwoPort
    Two port transresistance amplifier
    @param G float transresistance gain
    @param Zi float or complex input impedance
    @param Zo float or complex output impedance
    @param Z0 (optional) float reference impedance (defaults to 50 ohms)
    @return list of list s-parameter matrix for a transresistance amplifier
    @remark
    The two port transresistance amplifier is the same as the three port transresistance amplifier with
    port 3 grounded.

    The current sense element senses the current entering port 1
    with a series resistance in the current sense path of Zi.

    The voltage generated by the amplifier is at port 2 referenced to ground 
    with Zo in series with the output.

     """
    return [[(Zi - Z0) / (Zi + Z0), 0.0], [2.0 * G * Z0 / ((Zi + Z0) * (Zo +
        Z0)), (Zo - Z0) / (Zo + Z0)]]
