Solving an inverting opamp with stability compensation

I am trying to calculate the transfer function of this circuit with a non-ideal opamp (Vopamp = -A*V-), but I don't have enough equations to solve it... I found 4 individual loops for 2 nodes (I output opamp is not useful, and I think I can still consider the bias current to be zero, but I am not sure?) so 6+1=7 equations, but I think there are 9 unknowns: Vi, Vo, V-, Vk (output of opamp), Ii, If, Ic, Io, Il. simulate this circuit – Schematic created using CircuitLab

What am I doing wrong?

This circuit can be solved in many ways but I will use the Extra-Element Theorem or EET described here but also here with the Fast Analytical Techniques. The principle consists of identifying an element that bothers you in the calculation of the transfer function - the extra element - and you calculate a reference gain $G_{ref}$ when this element is either set to 0 or open-circuited. I choose to remove $R_f$ for the first gain calculation. The schematic is below: The gain in this configuration has been determined in the second link and is equal to:

$G_{ref}=-\frac{R_c}{R_i}\frac{1}{\frac{\frac{R_c}{R_i}+1}{A_{OL}}+1}\frac{R_L}{R_L+R_o}\approx -\frac{R_c}{R_i}\frac{R_L}{R_L+R_o}$

Ok, we have our reference gain. Now, let's calculate the resistance $R_d$ "seen" from $R_f$'s terminals when the excitation $V_{in}$ is set to 0 V (replaced by a sort circuit). The circuit is below: If you do the maths correctly, you should find:

$R_d=\frac{R_cR_i(R_L+R_o+A_{OL}R_L)}{(R_L+R_o)(R_c+R_i+A_{OL}R_i)}+R_L||R_o\approx \frac{R_cR_iR_L}{(R_L+R_o)R_i}+R_L||R_o$

For the final lap, we need to determine the resistance $R_n$ "seen" from $R_f$'s terminals when the response $V_{out}$ is a null or equal to 0 V when the excitation is back. Let's see the below schematic: Solving this circuit is easy (I used a Thévenin circuit) and you should find a resistance equal to: $R_n=-\frac{(R_L||R_o)(R_L+R_o)}{A_{OL}R_L}\approx 0 \;\Omega$

We can now apply the EET formula defined as:

$G=G_{ref}\frac{1+\frac{R_n}{R_f}}{1+\frac{R_d}{R_f}}$ which gives (considering an infinite open-loop gain):

$G=-\frac{R_cR_L}{R_i(R_L+R_o)}\frac{1}{1+\frac{\frac{R_cR_iR_L}{(R_L+R_o)R_i}+R_L||R_o}{R_f}}$

If you bias this circuit input with a 1-V dc source, the output is calculated to -0.884 V, confirmed by the below simulation: The Mathcad file below confirms this number: If you now replace $R_L$ by a capacitor impedance, you can plot the frequency response of the circuit: New Edit:

I realize that the above formula was correct however, when $Z_L$ is a capacitor, it is clearly a high-entropy expression. It is better to select $Z_L$ as a capacitor as all the other elements will be resistors. As such, the above formula does not tell you where the pole is located when you load the circuit with a capacitor. To derive a low-entropy formula, we will first determine the dc gain when $Z_L$ is removed. The circuit is shown below: The gain in this mode for a perfect op amp is: $G_0=-\frac{R_cR_f}{R_cR_i+R_fR_i+R_iR_o}$

Now, install a test current source $I_T$ across $Z_L$'s terminals and determine the resistance "seen" from these terminals. The sketch is below: The resistance is: $R_d=\frac{R_fR_iR_o}{R_cR_i+R_fR_i+R_iR_o}$ The time constant is equal to: $\tau_1=C_1\frac{R_fR_iR_o}{R_cR_i+R_fR_i+R_iR_o}$

The final transfer function is thus: $G(s)=G_0\frac{1}{1+\frac{s}{\omega_p}}$ with $\omega_p=\frac{1}{\tau_1}$.

The below Mathcad files confirm these results which match the ones previously found. In the latest case however, you can express the pole position in a clear manner.  Knowing all the currents is fine, or knowing all the voltages is fine. Either fully define the behavior and are computable from the other.

Maybe I'm the one missing something, but two of your unknowns, Vo and Vi need not to be solved beforehand.

Vo should be expressed as a function of Vi, so once you solve all the other unknowns you'd have Vo(Vi) = Vi * CONST_EXPR

You test for some Vi (say, a particular sine signal) and get a Vo