Op-amp

An op-amp with a gain-bandwidth product, a slew rate, an output that stops short of its rails, and a current limit. Pick a model, or set the numbers yourself.

Two inputs and an output. Between them sits a voltage-controlled voltage source with the model's open-loop gain and one dominant pole, so the gain falls at 20 dB a decade and reaches one at the gain-bandwidth product. Behind it is the model's output resistance. The output cannot get closer to either rail than the model's headroom, cannot move faster than its slew rate, and cannot source or sink more than its short-circuit current. The inputs draw no current at all.

Pins

Pin What it does
IN+ The non-inverting input. Draws no current.
IN- The inverting input. Draws no current.
OUT The amplified, rail-limited output.
V+ The positive supply.
GND The 0 V reference the output is clamped against.

Models

model picks the numbers. Each part number's come from the typical column of its datasheet.

model open-loop gain gain-bandwidth slew rate headroom, top / bottom short circuit output resistance
rail-to-rail (default) 100 000 10 MHz none 0 / 0 V 25 mA 100 Ω
741 200 000 1 MHz 0.5 V/µs 1.5 / 1.5 V 25 mA 75 Ω
TL072 200 000 3 MHz 13 V/µs 1.5 / 1.5 V 40 mA 100 Ω
LM358 100 000 0.7 MHz 0.3 V/µs 1.5 / 0.005 V 40 mA 100 Ω

rail-to-rail is not a part number. It is the ideal op-amp this part used to be (the same gain and output resistance), with a 10 MHz gain-bandwidth product and a 25 mA output limit added, so a circuit saved before the models existed behaves the way it did to within a fraction of a percent.

Properties

Every number property below except offset and negative means "the model's value" at 0, the way a diode's forward does. A part placed from the picker carries its model's numbers without the panel repeating them, and any other number you type wins over the model.

model: rail-to-rail, 741, TL072 or LM358, from the table above.

gain: the open-loop DC gain in volts per volt.

gbw: the gain-bandwidth product in megahertz: 1 for a 741, 3 for a TL072.

slew: the slew rate in volts per microsecond, the unit every datasheet uses. Read the section on slew rates before you rely on it.

headroom: how many volts short of each rail the output stops. A number here sets both sides. For no headroom at all, pick rail-to-rail.

offset: the input offset voltage in millivolts, 0 by default, either sign. It is added to the difference between the inputs, so the circuit's noise gain multiplies it: 5 mV into a gain of 11 is 55 mV at the output with the input grounded.

ilimit: the output short-circuit current in milliamps.

negative: how many volts below the GND pin the output may swing, 0 by default. Leave it alone and this is a single-supply op-amp. Set it to 9 and a textbook inverting amplifier about ground works the way the page you are copying from draws it.

What the model gets right

Gain-bandwidth. An amplifier's bandwidth is the gain-bandwidth product divided by its noise gain. A 741 in a non-inverting gain of 11 is 3 dB down at 90.85 kHz in the engine's frequency response, against 90.91 kHz for GBW / 11 (the small gap is the output resistance working into the feedback network). As a unity-gain buffer the same part is 3 dB down at 1.000 MHz. The transient sees the same pole: a small sine at that corner comes out at 0.707 of the pass-band gain, within 1%. In Frequency response, an active filter now rolls off where its op-amp runs out of gain, not only where its capacitors say.

Slew rate. A 741 buffer stepped from 0 to 10 V takes 16.0 µs to go from 10% to 90%, which is 8 V at 0.5 V/µs. With the slew rate off the same edge is set by the pole instead, about 0.35 µs.

Swing. A 741 on a single 5 V supply gets no higher than 3.5 V and no lower than 1.5 V. An LM358 on the same supply reaches ground but still stops at 3.5 V. The clip is exact: a gain of 11 on 15 V clips at 13.5 V behind the output resistance.

Current limit. A buffer asked for 5 V into 50 Ω gives 25 mA, which is 1.25 V, and holds its 5 V again into 1 kΩ.

Stability. The pole is integrated in a way that cannot ring (backward Euler, see how parts are modeled), and the step controller watches it. A gain-of-11 amplifier on a 1 kHz sine tracks 11 vin to within 0.06 V over twenty cycles with nothing forced.

The rail clamp is also checked against ngspice 42 on the same numbers, written there as a table-limited E source: a 10 k / 22 k inverting amplifier about ground on ±9 V gives -4.39986 V from 2 V in, and clips at -8.94747 V from 5 V in, and this part agrees within 1%. The exported SPICE deck carries the whole macromodel as a subcircuit; see saving.

V- is a property, not a pin

There are five pins (IN+, IN-, OUT, V+, GND) and no V-, and there will not be one: adding a pin would change the part's shape for every circuit already saved with it.

What was actually missing was not the pin but the swing, and that is what negative is. What it models, exactly, is a split supply whose midpoint is the GND pin. The current the output sinks while it is below ground returns through the GND pin, because there is nowhere else for it to go, so a meter in the ground leg of a Mokxi op-amp reads a current a real split-supply circuit would find in its V- leg. Nothing else in a circuit can tell the difference, since nothing else is connected to that rail, but a circuit that needs a negative rail for something other than the op-amp's own output still cannot be built here. The headroom applies at the bottom of that swing too: a 741 with negative at 15 gets down to -13.5 V.

What a slew rate can and cannot show

A slew rate is a limit on how far the output moves in one integration step, which is the only place a speed lives in a transient. It can therefore only bind while the step is short enough to see it, and at the simulator's own ceiling of two milliseconds a 0.5 V/µs part would cross a thousand volts in one step.

So an op-amp whose model has a slew rate (or whose slew is set) holds its island to a step of about ten microseconds, two hundred times finer than the ceiling. That costs events, and it is why the default model has no slew rate.

The floor on that is a real limit on the model, and here it is plainly: a part that would cross its own swing in less than one of those steps is not rate limited at all. On a 5 V supply that is anything above about half a volt a microsecond. A 741's 0.5 V/µs is modeled and an LM358's 0.3 is; a TL072's 13 V/µs is not. Its edges are set by its 3 MHz pole instead, which is still a finite speed but a faster one than the real part manages on a big step. The pole has no such floor: it is a state the step controller watches, so it is drawn at whatever step its own time constant asks for.

What it does not model

No input bias or offset current, no differential input resistance, no common-mode range (the inputs work right up to and past both rails), no phase reversal, no second pole (so no phase margin to lose), no noise, no power-supply rejection figure and no supply current. The headroom is one number at any load, where a real part's swing shrinks as its output current grows, and the current limit is the same either way, where a real LM358 sinks less than it sources.

Common mistakes

Using a 741 on 5 V. With 1.5 V of headroom each side it has two volts of swing left, from 1.5 to 3.5 V, and that is what the real part does too. Pick LM358 or rail-to-rail for a 5 V circuit.

Forgetting the bias divider on a single-supply AC circuit. With negative at zero an op-amp here cannot swing its output below GND any more than a real single-supply part can, so a signal that should swing negative just clips flat at the rail. Set negative instead, if what you meant was a split supply.

Expecting a high-gain stage to keep its bandwidth. A gain of 100 on a 741 is 3 dB down at 10 kHz. Split the gain across two stages if you need both.

Choosing a slow model on a circuit that does not need it, and then wondering why the simulation crawls. A slew rate is a hundred thousand steps a simulated second.

See it in action

Dark detector uses an op-amp as a comparator against an LDR divider. The op-amp low pass on the bench template sweeps an active filter: set its op-amp to 741 and sweep again, and the corner moves from 1985 Hz down to 1950 Hz because the loop runs out of gain. See both at /templates, and read how faithfully a part behaves for what the canvas's op-amp leaves out, and SPICE netlists for running a transistor-level op-amp as a deck.

The op-amp comparator page turns a knob past a 2.5 V reference and then adds hysteresis, and the non-inverting amplifier page puts a sine through a gain of 3 on the scope until it clips.