# Analysis of an Op-amp circuit

I saw this circuit and I want to find the relation between Vin and Vout. Assuming ideal Op-Amps, If VB>0 then the diode will be ON and A2 acts as a buffer so VB must be equal to the voltage of Virtual short circuit of A1 and then VB=0.

If VB<0 then the transistor and diode will be OFF and there is no way from Vin to VB.

If VB=0 there will be no relation between Vin and Vout and I think this can't be the answer.

What is the true method of analyzing this circuit? (I can find the relation of VB and Vout. my problem is in finding the relation of Vin and VB)

• This looks like a log amp, perhaps a temperature compensated one ? – efox29 Aug 9 '15 at 11:39
• Are you sure about that circuit? I1 doesn't do anything since it's connected to the output of the op-amp OA1, nor do Q2 and R4. – Spehro Pefhany Aug 9 '15 at 11:52
• I'm sure about the part between Vin and VB, But I'm not sure about direction of Q2. My question concerns the first part. – SMA.D Aug 9 '15 at 16:17

The way this is drawn we can ignore I1, Q2 and R4 and write:

Vout = $V_B(1+\frac {R_3}{R_2})$

$V_B = -V_T ln(\frac {Vin}{R_1 I_S})$, if Vin > 0 and 0 if Vin < 0

Where Is ~= 0.026V at room temperature and Is is saturation current of the transistor. This follows directly from the Ebers-Moll model equation Ic $\approx I_S e^{\frac {V_{BE}}{V_T}}$

For example, suppose R1 = 10K, Vin = 5V, Vt = 0.026V, Is = 6.73fA , then Vb = -.651V.

• Thank you for answering, Do you omit A2 in your analysis? We should have VB>0.7 for Q1 to be ON, but in that case A2 acts as a buffer (since D2 will be On) and the collector and emitter of Q1 will have the same voltage so Vce<0.2 – SMA.D Aug 9 '15 at 16:27
• Do you mean A3? – SMA.D Aug 9 '15 at 16:56
• Ah, sorry A2 is responsible for the right-hand side of equation 2 (0 if Vin < 0). – Spehro Pefhany Aug 9 '15 at 16:58
• Just another question: What will happen if the diode (D2) is upside down? (changing its direction) – SMA.D Aug 10 '15 at 7:13