op amp gain
op_amp_gainCalculate voltage gain and output for operational amplifier circuits in inverting, non-inverting, and differential configurations. For inverting: Av = -Rf/Ri with input impedance equal to Ri. For non-inverting: Av = 1 + Rf/Rg with very high input impedance. For differential: Av = Rf/Ri applied to (V1 - V2). Reports gain in linear and dB, output voltage when input is provided, input impedance, and phase inversion status. Ideal op-amp assumptions (infinite open-loop gain, zero input bias current). Chain from ohms_law for power budgeting or resistor_color_code for component selection.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vin_v | No | Input voltage in volts (optional). When provided, computes actual output voltage. For differential topology, this is V1 (non-inverting input). | |
| rf_ohm | Yes | Feedback resistor Rf in ohms. Sets gain magnitude in all topologies. | |
| ri_ohm | Yes | Input/gain resistor in ohms. For inverting: input resistor Ri. For non-inverting: ground resistor Rg. For differential: input resistor on both channels. | |
| vin2_v | No | Second input voltage in volts (differential topology only). This is V2 (inverting input). | |
| topology | Yes | Op-amp circuit topology. 'inverting' uses Rf/Ri feedback with input to inverting terminal. 'non_inverting' applies input to non-inverting terminal with Rf/Rg feedback. 'differential' amplifies the voltage difference between two inputs. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gain | Yes | Voltage gain (Av). Negative for inverting topology. | |
| rf_ohm | Yes | Feedback resistor value used in ohms. | |
| ri_ohm | Yes | Input/gain resistor value used in ohms. | |
| vout_v | Yes | Output voltage in volts (null if no input voltage provided). | |
| gain_db | Yes | Gain in decibels: 20 * log10(|Av|). | |
| gain_abs | Yes | Absolute value of voltage gain. | |
| topology | Yes | Op-amp topology used. | |
| phase_inversion | Yes | True if the output is phase-inverted relative to the input. | |
| input_impedance_ohm | Yes | Input impedance in ohms. Inverting: Ri. Non-inverting: very high (returned as 1e12). Differential: Ri. |