Integrated Circuits · Signed offset and a relative measurement
NE5532DR: Bias-Current Compensation Can Increase the Absolute Offset
A resistor can cancel the common contribution of two input currents while making an amplifier’s output move farther from zero. Build a switchable return-resistance fixture, retain the sign of every reading, and use an A/B/A sequence to separate the resistor’s relative effect from an assumed linear drift.
An operational amplifier, or op amp, amplifies the voltage difference between two inputs. Negative feedback returns part of its output to the inverting input, keeping that difference small during normal operation. The Texas Instruments (TI) NE5532DR contains two such amplifiers in one integrated circuit (IC). Its small input currents still need direct-current return paths: direct current (DC) means a steady or slowly varying component rather than an alternating waveform.
What is verified here: the delivered Python program has host tests and the plots are calculated examples. The circuit is a proposed local experiment, not a built or measured prototype. No physical measurements, target firmware build, target execution or supply qualification are claimed. You can complete the numerical experiment offline without powering a circuit.
Choose the exact part and resolve the supply discrepancy first
Use the NE5532DR, D package, an eight-pin small-outline integrated circuit (SOIC) package. Identify pin 1 from the actual package marking and use the datasheet’s top view; an adapter board does not change the chip’s pin numbers. The checked manufacturer orderable page lists this exact part as active. A similar name or a different manufacturer is not proof of an interchangeable device.
The current TI datasheet SLOS075K, revised December 2025, contains a material inconsistency. Section 5.3 gives recommended positive and negative supply magnitudes from 5 V through 15 V. Section 5.1 gives absolute supply limits of +18 V and −18 V. Section 7.2 still contains a ±22 V caution. This experiment follows the stricter recommended table, never the conflicting ±22 V sentence. Absolute maximum means a stress limit, not an operating target or a promise of correct operation. The product documents and a focused manufacturer errata search did not expose a separate NE5532 errata document during this check; that is a bounded search result, not proof that no correction can exist.
The proposed dual supply has a midpoint named G0, our zero-volt reference. The +V rail is positive relative to G0; −V is negative. Neither label means a second ground. An example setting is +14.5 V and −14.5 V, provided an independently established total bound of no more than 0.2 V on each rail magnitude includes meter uncertainty, regulation, load changes and excursions. Each magnitude would then stay between 14.3 V and 14.7 V. A nominal 14.5 V source specified only to ±5% could reach 15.225 V and fails this example. A nominal 15 V rail plus a 0.2 V excursion also fails.
The code checks arithmetic on declared bounds; it cannot establish those bounds for your supply. If you cannot establish them, do the offline experiment. Set a suitable regulated dual supply’s current limit to 25 mA as an initial fixture setting; this setting is not a manufacturer guarantee or a substitute for checking wiring and actual rail behavior.
The electrical-characteristic table uses ±15 V supplies and, unless another condition is stated, 25 °C. At those conditions its input-bias-current magnitude has a typical value of 200 nA and a maximum of 800 nA; input-offset-current magnitude is typically 10 nA with a 150 nA maximum; input-offset-voltage magnitude is typically 0.5 mV with a 4 mV maximum. A nanoampere (nA) is one billionth of an ampere; a millivolt (mV) is one thousandth of a volt. Typical values are illustrations, not limits. Bias-current specifications describe an average of the two input currents; do not turn that average-current bound into a guaranteed bound for each individual input.
The table’s common-mode input range, the allowed average input voltage, includes at least −12 V to +12 V under its ±15 V conditions. This fixture intends inputs near G0 and outputs near zero. Those intentions do not transfer the table’s input-range or output-swing guarantees to ±14.5 V. This is not a rail-to-rail amplifier experiment: do not drive either input or the output toward a supply rail. Keep the feedback connected, and stop to diagnose saturation, unexpected supply current, heating or unsettled output rather than treating such readings as bias-current data.
Build a return path that never opens
Input bias current is the small DC current entering or leaving an amplifier input. Its passage through resistance creates a voltage. Input offset voltage represents a small input-referred voltage imbalance needed to explain a nonzero output even when the intended signal is zero. The difference between the two input currents is an input offset current. These are separate error terms.
Use a 100.0 kΩ feedback resistor Rf, a 10.0 kΩ input-to-ground resistor Rin, and a 9.09 kΩ positive-input return resistor Rp; kiloohm (kΩ) means one thousand ohms. Use 0.1% metal-film resistors and record their measured values if available. Rp is 9090 Ω, close to the exact nominal match of 9090.909 Ω. A single-pole single-throw (SPST) switch S1 connects one contact pair. Wire it across Rp: closed is state A, open is state B. Rp stays wired from the positive input to G0 in both states, so operating the switch never intentionally floats the input.

A digital multimeter (DMM) converts a measured electrical quantity into a numerical reading. Choose a DC voltage range with input resistance of at least 10 MΩ, where megaohm (MΩ) means one million ohms; verify that property for the actual range. Its positive lead goes only to OUT1, pin 1, and its negative lead only to G0. Preserve the sign of the displayed reading. A meter on the positive input would change its return resistance and therefore the experiment.
| Pin or component | Exact connection and purpose |
|---|---|
| 1, OUT1 | Channel-A output: Rf to pin 2 and DMM positive lead. |
| 2, IN1− | Inverting input: Rf to pin 1; Rin directly to G0. No signal generator. |
| 3, IN1+ | Noninverting input: permanent Rp to G0; S1 in parallel with Rp. |
| 8, VCC+ | Positive supply +V; C1 of 100 nF from this rail to G0. |
| 4, VCC− | Negative supply −V; C2 of 100 nF from G0 to this rail. Pin 4 is not G0. |
| 5, IN2+ | Unused channel’s noninverting input directly to G0. |
| 6, IN2−; 7, OUT2 | Connect directly together as a follower, which returns its whole output to its inverting input. Leave pin 7 otherwise unloaded. |
| C1 and C2 | 100 nF, 50 V ceramic capacitors close to the supply pins. A nanofarad (nF) is one billionth of a farad. These local bypass capacitors supply short current changes and reduce supply impedance near the IC. |
Both channels share pins 8 and 4; the second triangle is not a separately powered IC. Follow the manufacturer’s short-connection and local-bypass guidance in sections 7.2 and 7.3. Keep switch and input-node wiring compact and clean. Leakage is an unintended current through contamination or insulation; it can be significant compared with the currents being inferred. A correctly mapped SOIC-to-prototyping adapter is useful, but no unspecified adapter layout is qualified here.
The DMM’s output loading is deliberately light. At 20 mV and 10 MΩ it draws 2 nA from the output. That is not a 10 MΩ divider across Rp: the amplifier output supplies the meter current, while feedback helps maintain the voltage. Finite output impedance and real feedback behavior still exist, so keep the meter and its range unchanged between states.
Retain the signs in the model
Define I+ and I− as positive when flowing into the noninverting and inverting inputs. A negative value represents current flowing out. Define the model’s signed offset Vos by Vout = Aopen × (Vplus − Vminus + Vos), where Aopen is the amplifier’s open-loop gain before feedback. This additive Vos convention is opposite the sign of an externally applied voltage that would null the output. The datasheet’s magnitude values alone do not determine these three signs.
Let Rg = Rin + Rsource, where Rsource is any extra DC resistance between Rin and G0. Here Rin connects directly to G0, so the intended Rsource is zero. Define noise gain, NG = 1 + Rf/Rg, as the closed-loop multiplier for a small input-referred imbalance such as Vos. Its name does not make this a noise-performance prediction. With high loop gain and normal linear operation, Vminus ≈ Vplus + Vos. Current through Rp gives Vplus = −Rp I+. Summing currents at the inverting input then gives:
Vout ≈ Rf I− − NG Rp I+ + NG Vos
The three terms are the inverting-input current contribution, the noninverting-input current contribution, and the offset-voltage contribution. The plus-input term has a minus sign because positive I+ pulls Vplus below G0. Setting NG Rp = Rf makes equal input-current contributions cancel. Thus the ideal matching value is the parallel resistance of Rg and Rf:
Rp,match = Rf/NG = (Rg × Rf)/(Rg + Rf)
At 10.0 kΩ and 100.0 kΩ, NG = 11 and Rp,match = 100000/11 Ω ≈ 9090.909 Ω. With the selected 9090 Ω and equal +200 nA currents, the remaining shared-current contribution is (100000 − 11 × 9090) Ω × 200 nA = +2 microvolts. A microvolt is one millionth of a volt. That numerical residue is not a claim about achievable accuracy: resistor tolerance, current mismatch, Vos, drift and the meter remain. Adding 50 Ω of actual source resistance changes the ideal match to approximately 9132.213 Ω; matching the wrong return resistance defeats the premise.
At the exact match, Vout ≈ Rf × (I− − I+) + NG Vos. Equal currents disappear from this equation; unequal currents and Vos do not. The general resistance-matching principle is also explained on page 11 of TI application report SLOA163. That report concerns the OPA836: its supply voltages and component recommendations are not NE5532 specifications.
Why a larger absolute reading can be the correct result
Use constructed, signed model values I+ = I− = +200 nA. With Vos = +0.5 mV, state A with ideal zero bypass resistance produces +25.5 mV; the exact matching resistance produces +5.5 mV. For that choice of signs, compensation reduces the absolute output.
Now choose Vos = −2 mV. State A is +20 mV −22 mV = −2 mV. The exact matching resistance removes the +20 mV common-current contribution and leaves −22 mV. The absolute reading grows from 2 mV to 22 mV. At the actual nominal Rp of 9090 Ω, state B is −21.998 mV. The smaller A reading was a cancellation between two errors, not proof that the bias-current error was already absent. These signed examples are not measured currents or offsets, and none of the ±15 V table values is extrapolated into a ±14.5 V guarantee.

Use A/B/A as a conditional relative experiment
Drift is a gradual change of a reading with time even when the intended setting stays fixed. Take an A1 reading with S1 closed, a B reading with S1 open, then an A2 reading after closing S1 again. Record a timestamp for each settled reading. Linear interpolation estimates a value between two points by assuming a straight-line change. Under that assumption, estimate the A-state output at the time of B:
α = (tB − tA1)/(tA2 − tA1)
AatB = A1 + α × (A2 − A1)
I+,estimate = (AatB − B)/(NG × Rp)
The symbol α, alpha, is the fraction of elapsed A1-to-A2 time at which B occurs. The denominator NG × Rp converts a voltage difference to a signed current. This estimate assumes negligible switch-bypass resistance, stable input currents, Vos, resistor values, load and temperature apart from approximately linear output drift. Three readings cannot establish that drift is linear. They also cannot separately identify I−, current mismatch and Vos. A stable-looking output is not proof of those assumptions.
The supplied synthetic case uses times 0, 10 and 30 seconds and invents output drift of +0.1 mV per second. These times illustrate interpolation, not a specified settling time. A1 is −2 mV; B is −20.998 mV; A2 is +1 mV. Here α = 1/3, so AatB = −1 mV. The difference is 19.998 mV and NG × Rp = 99990 Ω, giving +200 nA. Averaging the A endpoints gives −0.5 mV instead and an estimate of about +205.0005 nA. That endpoint mean would be the appropriate interpolation only if B were halfway in time under the same straight-line assumption.
The code separately reports endpoint drift A2 − A1 and total span. Its default caller-selected limits are 1 mV and 300 seconds; neither is a datasheet acceptance limit. The synthetic endpoint drift is 3 mV, so the result includes a warning and within_declared_policies: false even though the constructed linear-drift estimate equals its invented 200 nA input. A passing policy check still leaves drift_linearity_verified: false.
- With power off, trace the exact pin mapping, Rp’s permanent return, S1’s parallel bypass, feedback, unused channel and both bypass capacitors. Check supply polarity and G0. Establish the rail budget before powering.
- Use the actual instrument warm-up instructions. Select and record the meter range, its input resistance and resolution. Before collecting results, choose a repeatable settling rule, such as a stated maximum change over a stated observation interval; choose values your meter can resolve. Record the rule rather than inventing a universal delay.
- Power with S1 closed. Check both rails relative to G0 under the real load. If output or current is unexpected, remove power and diagnose; do not continue the calculation on a saturated or unstable circuit.
- Record settled A1, open S1 and record settled B, then close it and record settled A2. Keep the same meter/load/range and record elapsed times for the readings. Do not touch input nodes with a probe.
- Repeat complete sequences while keeping temperature and handling consistent. Compare the relative shifts, drift and warning flags. Changing settling criteria, switch contact resistance, leakage or temperature can change the result. The blank worksheet records these conditions; it contains no measurements.
Record broad observations in the blank bench worksheet. For the analyzer, export exactly three rows with header state,t_s,vout_v, states A1,B,A2, seconds and volts. Preserve signed readings and strictly increasing timestamps; an arbitrary time origin is allowed. The parser does not sort, fill blanks or skip bad rows.
Run the complete offline program
Use Python 3.9 or later with its standard library; no third-party installation or microcontroller is needed. Run commands from the extracted reader directory. The command-line interface (CLI) is the set of terminal commands below. The generated data are explicitly synthetic. Choose a new demo output directory; an existing directory is refused to avoid overwriting observations.
python3 -m unittest discover -s code -p 'test_*.py'
python3 code/bias_matching.py model --rplus-ohm 0 --vos-mv -2
python3 code/bias_matching.py model --rplus-ohm 9090 --vos-mv -2
python3 code/bias_matching.py demo my-synthetic-run
python3 code/bias_matching.py aba my-synthetic-run/synthetic-aba.csv
python3 code/bias_matching.py rails --positive-v 14.5 --negative-magnitude-v 14.5 --positive-bound-v 0.2 --negative-bound-v 0.2
Comma-separated values (CSV) store a table as text cells separated by commas. The model and analyzer print JavaScript Object Notation (JSON), a structured text format whose named fields preserve each signed term, assumption and warning. The model command with Rp zero returns −0.002 V; the 9090 Ω command returns approximately −0.021998 V. The A/B/A command returns approximately 200 nA and the endpoint-drift warning. All are calculations.
The program refuses nonfinite values, invalid resistance ranges, wrong state order, nonincreasing timestamps, missing cells and more than three data rows. CSV decoding errors and detectable arithmetic range failures produce a controlled refusal. Nonzero decimal literals that convert to floating-point zero are refused. Multiplication or division that loses a nonzero result to zero is also refused. This is rounded binary floating-point arithmetic, not an arbitrary-precision solver: it does not detect every loss of significance or quantify measurement uncertainty. The current estimate and the caller’s warning thresholds cannot certify a device or a supply.
The rail command prints declared intervals and supply_measured_or_verified: false; it exits with code 2 if those intervals leave the recommended range. A drift warning in a valid A/B/A file retains the conditional estimate and exits normally, allowing a worksheet to inspect the diagnostic result. Malformed input exits with code 2. The program controls no instruments.
The complete bias_matching.py is below. The reader also includes the executable tests, generated example tables and the original figure generator.
#!/usr/bin/env python3
"""Signed bias-current model, relative A/B/A analysis and declared rail budgets.
Python3.9+, standard library only. No hardware control or NE5532 simulation.
The model parameters are constructed examples, not measured device properties.
"""
import argparse
import csv
from decimal import Decimal,InvalidOperation
import json
import math
from pathlib import Path
def number(value,name,minimum=None,strict=False):
if isinstance(value,bool) or not isinstance(value,(int,float)):
raise ValueError(name+' must be numeric')
try:
value=float(value)
except OverflowError:
raise ValueError(name+' is outside floating-point range') from None
if not math.isfinite(value):
raise ValueError(name+' must be finite')
if minimum is not None and (value<minimum or (strict and value==minimum)):
raise ValueError(name+' is below its allowed range')
return value
def checked(value,nonzero=False):
if not math.isfinite(value) or (nonzero and value==0):
raise ValueError('Calculation is outside floating-point range')
return value
def mul(a,b):return checked(a*b,a!=0 and b!=0)
def div(a,b):
if b==0:raise ValueError('Zero denominator/sensitivity')
return checked(a/b,a!=0)
def total(values):
try:return checked(math.fsum(values))
except OverflowError:raise ValueError('Sum is outside floating-point range') from None
def literal(text):
try:
value=float(text)
if value==0 and Decimal(str(text))!=0:
raise ValueError('Nonzero literal is outside floating-point range')
except (InvalidOperation,OverflowError):
raise ValueError('Numeric literal is outside floating-point range') from None
return value
def network(rin,rf,rsource):
rin=number(rin,'Rin',0,True);rf=number(rf,'Rf',0,True)
rsource=number(rsource,'source resistance',0)
rg=total([rin,rsource]);ng=total([1,div(rf,rg)])
return rg,ng,div(rf,ng)
def model(rin=10000.0,rf=100000.0,rsource=0.0,rplus=9090.0,
i_minus=200e-9,i_plus=200e-9,vos=-.002):
"""Both input currents positive INTO amplifier; signed Vos adds at plus input.
Vout ≈ Rf*Iminus - NG*Rp*Iplus + NG*Vos, ideal high loop gain.
Vos here is the additive model voltage, not the externally applied nulling sign.
"""
rg,ng,match=network(rin,rf,rsource)
rplus=number(rplus,'positive-input return resistance',0)
i_minus=number(i_minus,'Iminus');i_plus=number(i_plus,'Iplus');vos=number(vos,'Vos')
vp=-mul(rplus,i_plus)
minus_term=mul(rf,i_minus);plus_term=mul(ng,vp);offset_term=mul(ng,vos)
return {'rg_ohm':rg,'noise_gain':ng,'match_ohm':match,'rplus_ohm':rplus,
'vplus_v':vp,'minus_current_term_v':minus_term,'plus_current_term_v':plus_term,
'offset_voltage_term_v':offset_term,'vout_v':total([minus_term,plus_term,offset_term]),
'scope':'Constructed signed ideal high-loop-gain DC model; not a measured or validated NE5532 macromodel.'}
def read_aba(stream):
reader=csv.reader(stream,strict=True)
if next(reader,None)!=['state','t_s','vout_v']:
raise ValueError('CSV header must be exactly state,t_s,vout_v (seconds, volts)')
rows=[]
for index,row in enumerate(reader,2):
if len(row)!=3:raise ValueError('CSV row '+str(index)+' needs exactly three cells')
try:rows.append((row[0],literal(row[1]),literal(row[2])))
except ValueError as exc:raise ValueError('CSV row '+str(index)+': '+str(exc)) from None
if len(rows)>3:raise ValueError('Exactly three data rows are allowed; fourth row refused')
return rows
def analyze_aba(rows,rin=10000.0,rf=100000.0,rsource=0.0,rplus=9090.0,
drift_limit_v=.001,span_limit_s=300.0):
"""Estimate Iplus from interpolated A minus B, assuming approximately linear drift."""
_,ng,_=network(rin,rf,rsource)
rplus=number(rplus,'B return resistance',0,True)
drift_limit_v=number(drift_limit_v,'caller drift limit',0)
span_limit_s=number(span_limit_s,'caller span limit',0,True)
if len(rows)!=3 or any(len(row)!=3 for row in rows):
raise ValueError('Exactly three A1,B,A2 rows required')
if [row[0]for row in rows]!=['A1','B','A2']:
raise ValueError('State order must be exactly A1,B,A2; rows are not sorted')
times=[number(row[1],'timestamp')for row in rows]
values=[number(row[2],'output voltage')for row in rows]
if not times[0]<times[1]<times[2]:
raise ValueError('A1,B,A2 timestamps must be strictly increasing')
span=checked(times[2]-times[0]);dt=checked(times[1]-times[0])
alpha=div(dt,span)
drift=checked(values[2]-values[0])
interpolated=total([values[0],mul(alpha,drift)])
endpoint_mean=div(total([values[0],values[2]]),2)
sensitivity=mul(ng,rplus)
delta=checked(interpolated-values[1]);mean_delta=checked(endpoint_mean-values[1])
estimate=div(delta,sensitivity);mean_estimate=div(mean_delta,sensitivity)
warnings=[]
if abs(drift)>drift_limit_v:
warnings.append('Endpoint drift exceeds the caller limit; treat the estimate as diagnostic.')
if span>span_limit_s:
warnings.append('Record span exceeds the caller limit; conditions may have changed.')
return {'alpha':alpha,'span_s':span,'noise_gain':ng,'sensitivity_ohm':sensitivity,
'a_interpolated_v':interpolated,'a_endpoint_mean_v':endpoint_mean,
'b_v':values[1],'a2_minus_a1_v':drift,'signed_a_minus_b_v':delta,
'estimated_i_plus_a':estimate,'estimated_i_plus_na':mul(estimate,1e9),
'endpoint_mean_estimate_na':mul(mean_estimate,1e9),
'caller_drift_limit_v':drift_limit_v,'caller_span_limit_s':span_limit_s,
'within_declared_policies':not warnings,'warnings':warnings,
'drift_linearity_verified':False,
'assumption':'Parameters/load/temperature remain stable except approximately linear output drift between A readings; A bypass resistance is ideal zero.',
'limits':'Three rows do not establish drift linearity or separately identify Iminus, current mismatch and Vos. No physical measurement is certified.'}
def rail_budget(positive_mag=14.5,negative_mag=14.5,positive_bound=.2,negative_bound=.2):
"""Only arithmetic on separately established bounds, not a supply qualification."""
positive_mag=number(positive_mag,'positive magnitude',0,True)
negative_mag=number(negative_mag,'negative magnitude',0,True)
positive_bound=number(positive_bound,'positive total bound',0)
negative_bound=number(negative_bound,'negative total bound',0)
pl=checked(positive_mag-positive_bound);ph=total([positive_mag,positive_bound])
nl=checked(negative_mag-negative_bound);nh=total([negative_mag,negative_bound])
return {'positive_range_v':[pl,ph],'negative_range_v':[-nh,-nl],
'inside_recommended_by_declared_bounds':pl>=5 and ph<=15 and nl>=5 and nh<=15,
'supply_measured_or_verified':False,
'limits':'Bounds must include meter uncertainty, regulation/load variation and excursions. This checks declared values only and does not transfer the ±15V electrical-table guarantees to other rails.'}
def synthetic_aba():
"""Constructed nominal model plus0.1mV/s drift; decimal-rounded, not measured."""
a=model(rplus=0)['vout_v'];b=model(rplus=9090)['vout_v']
return [('A1',0.0,round(a,9)),('B',10.0,round(b+.001,9)),('A2',30.0,round(a+.003,9))]
def circuit_options(parser):
parser.add_argument('--rin-ohm',default='10000');parser.add_argument('--rf-ohm',default='100000')
parser.add_argument('--source-r-ohm',default='0');parser.add_argument('--rplus-ohm',default='9090')
def main():
parser=argparse.ArgumentParser(description=__doc__);sub=parser.add_subparsers(dest='command',required=True)
m=sub.add_parser('model',help='constructed signed term calculation');circuit_options(m)
m.add_argument('--i-minus-na',default='200');m.add_argument('--i-plus-na',default='200');m.add_argument('--vos-mv',default='-2')
a=sub.add_parser('aba',help='relative analysis of three signed readings');circuit_options(a)
a.add_argument('csv_path',type=Path);a.add_argument('--drift-limit-v',default='0.001');a.add_argument('--span-limit-s',default='300')
r=sub.add_parser('rails',help='arithmetic on declared total rail budgets')
r.add_argument('--positive-v',default='14.5');r.add_argument('--negative-magnitude-v',default='14.5')
r.add_argument('--positive-bound-v',default='0.2');r.add_argument('--negative-bound-v',default='0.2')
d=sub.add_parser('demo',help='write two synthetic files in a NEW directory');d.add_argument('output_directory',type=Path)
args=parser.parse_args()
try:
if args.command in('model','aba'):
settings={'rin':literal(args.rin_ohm),'rf':literal(args.rf_ohm),'rsource':literal(args.source_r_ohm),'rplus':literal(args.rplus_ohm)}
if args.command=='model':
result=model(**settings,i_minus=mul(literal(args.i_minus_na),1e-9),i_plus=mul(literal(args.i_plus_na),1e-9),vos=mul(literal(args.vos_mv),.001))
else:
with args.csv_path.open(newline='')as stream:rows=read_aba(stream)
result=analyze_aba(rows,**settings,drift_limit_v=literal(args.drift_limit_v),span_limit_s=literal(args.span_limit_s))
elif args.command=='rails':
result=rail_budget(literal(args.positive_v),literal(args.negative_magnitude_v),literal(args.positive_bound_v),literal(args.negative_bound_v))
else:
args.output_directory.mkdir(parents=True,exist_ok=False)
with (args.output_directory/'synthetic-aba.csv').open('x',newline='')as stream:
writer=csv.writer(stream,lineterminator='\n');writer.writerow(['state','t_s','vout_v']);writer.writerows(synthetic_aba())
with (args.output_directory/'synthetic-model-curves.csv').open('x',newline='')as stream:
writer=csv.writer(stream,lineterminator='\n');writer.writerow(['rplus_ohm','vout_vos_minus2mv_v','vout_vos_plus0p5mv_v'])
for rp in sorted(set(list(range(0,12001,200))+[9090])):
writer.writerow([rp,model(rplus=rp,vos=-.002)['vout_v'],model(rplus=rp,vos=.0005)['vout_v']])
print('Wrote two explicitly synthetic files; no physical measurements.');return 0
print(json.dumps(result,indent=2,allow_nan=False))
if args.command=='rails'and not result['inside_recommended_by_declared_bounds']:
parser.exit(2,'Experiment refused: declared rail interval leaves recommended ±5..±15V range.\n')
except (ValueError,OSError,csv.Error,OverflowError,ZeroDivisionError)as exc:
parser.exit(2,'Experiment refused: '+str(exc)+'\n')
return 0
if __name__=='__main__':raise SystemExit(main())
Try a signed-current challenge
Keep Rin = 10 kΩ and Rf = 100 kΩ, use the exact match Rp = 100000/11 Ω, and set constructed values I− = +210 nA, I+ = +190 nA and Vos = −0.5 mV. Predict A, B and A − B. Does the relative change reveal the 20 nA current mismatch?
Answer and interpretation
A = 100 kΩ × 210 nA + 11 × (−0.5 mV) = +15.5 mV. At exact matching, B = 100 kΩ × (210 −190) nA −5.5 mV = −3.5 mV. Thus A − B = +19 mV, and dividing by NG Rp = 100 kΩ gives I+ = +190 nA. The relative difference isolates I+ only under the declared assumptions; it does not isolate the current mismatch or Vos. You need additional independent information to separate those terms.
Reproduce the files and keep the limits visible
The host suite exercises signed current terms, offset cancellation and worsening, exact and rounded matching, source resistance, equal and unequal timestamp spacing, shifted time origins, negative estimates, warning boundaries, early fourth-row refusal, malformed CSV, numeric range errors, rail budgets and the actual CLI. A deliberately reversed compensation sign is checked against that same suite. Host tests validate this delivered numerical implementation; they do not validate a physical NE5532DR, contact resistance, stability, noise or a meter’s uncertainty.
Start with reader contents and reproduction instructions. The editable figures are Scalable Vector Graphics (SVG), an editable text-based drawing format; the displayed copies are Portable Network Graphics (PNG) images. Both are original teaching diagrams generated from the supplied constructed data, not photographs or test captures. General background is available through Learn and the project’s Circuitpedia.
Primary references: TI exact NE5532DR orderable information; SLOS075K, especially Figure 4-1 and sections 5.1, 5.3, 5.5, 7.2 and 7.3; current manufacturer document listing; and SLOA163 page 11 for the general resistance-matching principle only. Recheck the exact manufacturer documents before a later physical build.