VIEW THIS AS

Auto mode follows the Route Engine until you choose a viewpoint.

YOU ARE HERE

ROUTE CHECK

CONNECTED TO

WHAT NEXT

Use the canonical route for this room, or HELP if you are unsure.

Why Mathematics? | Lock-In Amplifiers, Phase-Sensitive Detection and Signal Recovery

Three students in school uniforms work through open books at a classroom table, with textbooks and stationery nearby and study notes on the whiteboard behind them.

Why is mathematics important in a lock-in amplifier? Because a weak periodic signal can be buried under noise that looks much larger on an oscilloscope. A lock-in amplifier uses a known reference frequency and phase to ask a very specific question: how much of the measured waveform matches this reference? Multiplication, trigonometry, complex numbers and low-pass filtering turn that question into a measurement.

This is an educational guide, not an instrument manual. Real work must respect input limits, grounding, electrical safety, calibration, bandwidth and the manufacturer’s validated procedures. Averaging cannot recover a clipped signal or make an unverified setup traceable.


Quick Reading Route


The Core Idea: Correlate With a Reference

Let the desired signal be s(t)=A cos(ωt+φ). The measured input is v(t)=s(t)+n(t), where n(t) contains noise and interference. The lock-in also receives a reference at frequency ω. It multiplies the input by reference cosine and sine waves, then averages or low-pass filters the products.

Components unrelated to the reference oscillate positive and negative and tend to average toward zero over suitable time. The component at the reference frequency produces a constant term related to amplitude and phase. This is coherent detection: the reference supplies timing information that ordinary amplitude averaging lacks.

NIST describes lock-in use in diamond NV-centre magnetometry and in a differential magnetometer, where a referenced oscillatory response is separated into amplitude and phase. These are examples of the broader principle, not a claim that every measurement uses the same settings.

Did You Know? Noise can be larger than the wanted signal

The relevant comparison is not always instantaneous amplitude. If the signal is phase-coherent with the reference while noise is not, long enough correlation can estimate the coherent component even when individual samples are visually dominated by noise.


Why Multiplication Moves the Signal to DC

Multiply A cos(ωt+φ) by cos(ωt). The identity cos α cos β = ½[cos(α−β)+cos(α+β)] gives:

A cos(ωt+φ)cos(ωt)=A/2[cosφ+cos(2ωt+φ)].

The product contains a constant A cosφ/2 and a component at twice the frequency. A low-pass filter removes most of the 2ω term, leaving the phase-dependent constant.

Reference scaling

Some instruments multiply by 2 or use RMS conventions so the displayed X corresponds directly to peak or RMS amplitude. Therefore A/2 is a derivation convention, not a universal display rule. Always document reference amplitude and output scaling.

Orthogonality

Over an integer number of cycles, different Fourier components are orthogonal: their product averages to zero under ideal sampling. If an interferer is close in frequency, the finite averaging window may not fully reject it. Spectral resolution is controlled by observation time and filter shape.

Frequency mismatch

If the signal frequency is ω+Δω while the reference is ω, multiplication produces a difference-frequency term at Δω rather than a constant. The output beats slowly. A drifting source can therefore appear as a rotating phase or fluctuating amplitude.


Quadrature: X, Y, Amplitude and Phase

One reference channel cannot distinguish small amplitude from a 90° phase offset, because cos90°=0. Lock-ins use two references in quadrature. After scaling, ideal outputs can be written X=A cosφ and Y=A sinφ.

Amplitude R=√(X²+Y²). Phase φ=atan2(Y,X). The two-argument atan2 preserves the quadrant, unlike arctan(Y/X). If X=−3 μV and Y=4 μV, R=5 μV and phase is about 126.9°, not −53.1°.

Rotation of coordinates

Changing reference phase rotates the X–Y axes. If the phase is chosen so the signal lies on X, Y can serve as an error indicator. This does not change R under an ideal rotation.

NIST’s phase-adjustment note shows how measured real and imaginary susceptibility components rotate with phase error. The lesson is general: phase calibration mixes quadrature components predictably.

Phase near zero amplitude

When X and Y are both near zero, tiny noise changes can swing atan2 widely. A phase value without sufficient amplitude or uncertainty is unstable. Software should avoid presenting a confident phase merely because a function returns a number.


Modulation Moves the Measurement

Many experiments deliberately modulate a source—chopping light, reversing a field or varying temperature—at a chosen frequency. The desired response moves away from very low-frequency drift and 1/f noise into a cleaner band. The lock-in then selects that band.

NIST’s photovoltaic characterisation laboratory describes a monochromator system with a chopper and lock-in amplifiers for spectral-responsivity measurement. Its purpose is not “make any signal visible”; it is a controlled measurement chain with sources, filters, reference timing and standard-condition corrections.

Harmonics

A nonlinear response may contain 2ω, 3ω and higher harmonics. Detecting the second harmonic requires referencing 2ω. A harmonic output answers a different question from the fundamental; adding them without a model confuses mechanisms.

Duty cycle and waveform shape

A square-wave modulation contains odd harmonics. Reference waveform, phase and instrument demodulation settings affect scaling. Fourier series explains why the same peak-to-peak modulation can produce different fundamental components.


Worked Example: Recovering a Microvolt-Scale Signal

Suppose a fictional input contains a 7.0 μV peak sinusoid at 137 Hz with phase 35°, plus broadband noise. Assume an ideal scaled lock-in where X=Acosφ and Y=Asinφ.

X=7.0cos35°≈5.734 μV.

Y=7.0sin35°≈4.015 μV.

Reconstruction gives R=√(5.734²+4.015²)=7.000 μV and atan2(4.015,5.734)=35°.

Add a phase-setting error

If the reference axes are rotated by +10° relative to the chosen convention, displayed phase becomes about 25° or 45° depending on which frame is defined as positive. Write the transformation matrix rather than relying on verbal intuition. Amplitude remains 7 μV ideally.

Add an interfering tone

Let a 100 μV tone sit at 200 Hz. After mixing with 137 Hz it produces components at 63 Hz and 337 Hz. A sufficiently narrow low-pass rejects them. However, if the front end saturates at 50 μV before mixing, the large tone distorts the input and mathematical rejection cannot undo clipping.

Finite averaging

A rectangular average of duration T has a sinc-shaped frequency response with zeros at offsets k/T. Increasing T narrows the response but slows tracking. A one-second average resolves close frequencies better than a 0.01 s average, while responding much more slowly to a changing signal.


Time Constant, Bandwidth and Uncertainty

A first-order low-pass obeys τdy/dt+x relationships and responds to a step as y(t)=y_final[1−exp(−t/τ)]. After one time constant it reaches about 63.2%; after five it reaches about 99.3%. Higher-order filters have different settling and equivalent-noise bandwidth.

Bandwidth trade-off

Narrower bandwidth reduces integrated noise but loses rapid changes. Signal-to-noise improvement is not free; it exchanges time resolution for frequency selectivity. Report both time constant and filter slope/order.

Noise scaling

For white noise with spectral density e_n in V/√Hz, RMS noise roughly scales with e_n√B for equivalent noise bandwidth B. Halving bandwidth reduces white-noise RMS by √2, not by two. Coloured noise or interference requires its actual spectrum.

Calibration

NIST’s Josephson waveform reference work for lock-in calibration notes that measurement uncertainty can be dominated by lock-in resolution in the described system. Calibration examines gain, phase, linearity, frequency dependence and range, not just one amplitude point.

Uncertainty propagation

For R=√(X²+Y²), small independent uncertainties give an approximate variance weighted by X/R and Y/R. For phase, sensitivities include −Y/R² and X/R², revealing the divergence as R approaches zero. Correlation between X and Y may matter.


Sampling and Digital Lock-Ins

A digital instrument samples input and reference. Sample rate must be sufficient for the signal, harmonics and anti-alias filter. Aliasing maps high-frequency content into the analysed band and cannot be removed afterward without extra information.

Window and record length

If a record does not contain an integer number of cycles, a rectangular window leaks energy across frequencies. A demodulator referenced sample-by-sample can handle continuous data, yet finite records, filter transients and phase resets remain important.

Numerical range

Quantisation, ADC full scale and front-end gain affect weak-signal resolution. Choosing too little gain wastes digital levels; too much clips peaks. “Dynamic reserve” describes the ability to measure a signal in larger interference under specified conditions, not infinite immunity.

Timestamp integrity

If reference and input use misaligned clocks, phase drifts. At 1 kHz, a 1 μs timing error corresponds to 0.36°. At 100 kHz it corresponds to 36°. Time uncertainty becomes phase uncertainty through φ=2πfΔt.


What a Lock-In Amplifier Cannot Do

It cannot invent coherence

A non-periodic or phase-random event may not correlate with the chosen reference. A zero output can mean no coherent component, not no physical signal.

It cannot repair overload

Clipping, slew-rate limits or front-end saturation create nonlinear products that contaminate the band. Filter later cannot restore lost waveform information.

It cannot choose the right reference automatically

Wrong frequency, harmonic or phase can suppress or reinterpret the signal. Reference provenance belongs in the report.

It cannot make systematic error vanish by averaging

Offset, pickup synchronous with the reference, ground loops and crosstalk can average beautifully. Control measurements and reversal tests are essential.

It cannot replace a physical model

X, Y, R and phase describe a coherent response. Converting that response to temperature, field, displacement or concentration requires calibrated sensitivity and a valid model.


Learning Pathways for Students

Lock-in detection connects trigonometric identities, vectors, complex numbers, integration, exponential response, probability and Fourier thinking. Students can simulate it with synthetic signals before touching laboratory electronics.

Four-week plan

  • Week 1: sinusoid amplitude, frequency, phase and trig identities;
  • Week 2: in-phase and quadrature multiplication with averages;
  • Week 3: low-pass response, bandwidth, noise and sampling;
  • Week 4: calibration, uncertainty, systematic controls and a reproducible report.

Parents can ask, “What makes the desired signal different from the noise?” If the answer is “it follows this reference frequency and phase,” the student has understood the central idea.


Frequently Asked Questions

Why is it called lock-in?

The detector locks its measurement to a reference frequency and phase relationship, rejecting much unrelated content.

Is it just a very narrow filter?

It behaves like a narrow, reference-centred detector, but the mixing and phase information distinguish it from a simple fixed band-pass filter.

What are X and Y?

They are in-phase and quadrature components of the signal relative to the reference, subject to the instrument’s scaling convention.

Why use atan2?

It identifies the correct phase quadrant and handles X=0 more sensibly than arctan(Y/X).

Does longer averaging always help?

It reduces some random noise but slows response and may fail against drift or coherent interference. The signal must remain stable over the averaging period.

What is the time constant?

It is a filter-response parameter. For a first-order step it marks about 63.2% of the final response, but filter order changes settling details.

Can it measure DC?

Classic lock-in detection targets a periodic component. A DC quantity can be modulated into an AC response if the experiment supports that transformation.

Why does phase drift?

Frequency mismatch, clock error, changing path delay and physical response changes can all rotate phase.

What is synchronous pickup?

It is unwanted interference correlated with the reference, so the lock-in preserves it. Shielding, controls and reversals are needed.

Is R unbiased at low signal?

Not necessarily. Because R is non-negative, noise can produce positive magnitude even when true signal is zero. Low-SNR amplitude needs careful statistics.

Which school mathematics matters most?

Trigonometry and vectors reveal the mechanism; calculus, complex numbers and statistics deepen filter and uncertainty analysis.

What is the transferable lesson?

Knowing a pattern lets mathematics ask a targeted question of noisy data, but only a controlled experiment makes the answer meaningful.


Useful Next Reading

Read Why Mathematics? | Strain Gauges, Wheatstone Bridges and Measurement Sensitivity for another weak-signal chain. Why Mathematics? | Streaming Audio, LUFS, Loudness Normalisation and True Peak develops signal windows and levels. Why Mathematics? | Comparing Percentages Fairly supports calibrated comparisons.

Lock-in mathematics is a hopeful example of precision: a signal need not dominate every instant to become measurable. It needs a trustworthy reference, a transparent model and enough disciplined observation.


A Practical Investigation Studio

These activities use synthetic or openly released teaching data. They are designed to make every assumption visible. For each investigation, begin with a labelled diagram or data dictionary, keep unrounded intermediate values, and finish with a short limitation statement. The goal is not to imitate a professional instrument with a spreadsheet; it is to understand which mathematical operation gives the instrument its meaning.

Investigation 1: Reference projection

Multiply a noisy sinusoid by an in-phase reference and average over whole cycles. Show that the matched component retains a non-zero mean while unrelated oscillations tend to cancel. Include one graph or table, one dimensional or limiting-case check, and one paragraph separating the calculated result from the real-world conclusion. Change one input across a sensible range to test sensitivity. If the result changes sharply, report the instability instead of hiding it with extra decimal places. Preserve the original data and record every correction so a classmate can audit the route from measurement to claim. Before calculating, predict the direction of change and explain the physical reason. After calculating, compare the prediction with the result and investigate any disagreement. Repeat the analysis with one deliberately flawed input—wrong unit, reversed sign, missing sample or premature rounding—and describe how the error appears. This makes the activity an error-detection exercise rather than a search for one polished answer. Finish by naming which quantities were observed, which were assumed, which were fitted and which were derived. State the domain over which the model is credible and one condition that would require a richer model. A strong submission includes the raw synthetic data, formulas or code, labelled axes, units, intermediate checks, final result, uncertainty note and a concise explanation suitable for a younger student. Do not claim professional validation from a classroom simulation.

Investigation 2: Quadrature channel

Repeat with a cosine and sine reference to calculate X and Y. Recover amplitude with sqrt(X squared plus Y squared) and phase with atan2. Include one graph or table, one dimensional or limiting-case check, and one paragraph separating the calculated result from the real-world conclusion. Change one input across a sensible range to test sensitivity. If the result changes sharply, report the instability instead of hiding it with extra decimal places. Preserve the original data and record every correction so a classmate can audit the route from measurement to claim. Before calculating, predict the direction of change and explain the physical reason. After calculating, compare the prediction with the result and investigate any disagreement. Repeat the analysis with one deliberately flawed input—wrong unit, reversed sign, missing sample or premature rounding—and describe how the error appears. This makes the activity an error-detection exercise rather than a search for one polished answer. Finish by naming which quantities were observed, which were assumed, which were fitted and which were derived. State the domain over which the model is credible and one condition that would require a richer model. A strong submission includes the raw synthetic data, formulas or code, labelled axes, units, intermediate checks, final result, uncertainty note and a concise explanation suitable for a younger student. Do not claim professional validation from a classroom simulation.

Investigation 3: Phase error

Rotate the reference by 5°, 20° and 90°. Quantify how the in-phase output falls and the quadrature output grows. Include one graph or table, one dimensional or limiting-case check, and one paragraph separating the calculated result from the real-world conclusion. Change one input across a sensible range to test sensitivity. If the result changes sharply, report the instability instead of hiding it with extra decimal places. Preserve the original data and record every correction so a classmate can audit the route from measurement to claim. Before calculating, predict the direction of change and explain the physical reason. After calculating, compare the prediction with the result and investigate any disagreement. Repeat the analysis with one deliberately flawed input—wrong unit, reversed sign, missing sample or premature rounding—and describe how the error appears. This makes the activity an error-detection exercise rather than a search for one polished answer. Finish by naming which quantities were observed, which were assumed, which were fitted and which were derived. State the domain over which the model is credible and one condition that would require a richer model. A strong submission includes the raw synthetic data, formulas or code, labelled axes, units, intermediate checks, final result, uncertainty note and a concise explanation suitable for a younger student. Do not claim professional validation from a classroom simulation.

Investigation 4: Integration time

Average the same noisy record over 1, 10 and 100 cycles. Compare output variability and the slower response to a step change. Include one graph or table, one dimensional or limiting-case check, and one paragraph separating the calculated result from the real-world conclusion. Change one input across a sensible range to test sensitivity. If the result changes sharply, report the instability instead of hiding it with extra decimal places. Preserve the original data and record every correction so a classmate can audit the route from measurement to claim. Before calculating, predict the direction of change and explain the physical reason. After calculating, compare the prediction with the result and investigate any disagreement. Repeat the analysis with one deliberately flawed input—wrong unit, reversed sign, missing sample or premature rounding—and describe how the error appears. This makes the activity an error-detection exercise rather than a search for one polished answer. Finish by naming which quantities were observed, which were assumed, which were fitted and which were derived. State the domain over which the model is credible and one condition that would require a richer model. A strong submission includes the raw synthetic data, formulas or code, labelled axes, units, intermediate checks, final result, uncertainty note and a concise explanation suitable for a younger student. Do not claim professional validation from a classroom simulation.

Investigation 5: Frequency mismatch

Use a signal and reference separated by a small frequency difference. Plot the low-frequency beat and connect it to the difference frequency. Include one graph or table, one dimensional or limiting-case check, and one paragraph separating the calculated result from the real-world conclusion. Change one input across a sensible range to test sensitivity. If the result changes sharply, report the instability instead of hiding it with extra decimal places. Preserve the original data and record every correction so a classmate can audit the route from measurement to claim. Before calculating, predict the direction of change and explain the physical reason. After calculating, compare the prediction with the result and investigate any disagreement. Repeat the analysis with one deliberately flawed input—wrong unit, reversed sign, missing sample or premature rounding—and describe how the error appears. This makes the activity an error-detection exercise rather than a search for one polished answer. Finish by naming which quantities were observed, which were assumed, which were fitted and which were derived. State the domain over which the model is credible and one condition that would require a richer model. A strong submission includes the raw synthetic data, formulas or code, labelled axes, units, intermediate checks, final result, uncertainty note and a concise explanation suitable for a younger student. Do not claim professional validation from a classroom simulation.

Investigation 6: Low-pass model

Apply a first-order exponential average to a step. Estimate the 63% time and explain the time-constant convention. Include one graph or table, one dimensional or limiting-case check, and one paragraph separating the calculated result from the real-world conclusion. Change one input across a sensible range to test sensitivity. If the result changes sharply, report the instability instead of hiding it with extra decimal places. Preserve the original data and record every correction so a classmate can audit the route from measurement to claim. Before calculating, predict the direction of change and explain the physical reason. After calculating, compare the prediction with the result and investigate any disagreement. Repeat the analysis with one deliberately flawed input—wrong unit, reversed sign, missing sample or premature rounding—and describe how the error appears. This makes the activity an error-detection exercise rather than a search for one polished answer. Finish by naming which quantities were observed, which were assumed, which were fitted and which were derived. State the domain over which the model is credible and one condition that would require a richer model. A strong submission includes the raw synthetic data, formulas or code, labelled axes, units, intermediate checks, final result, uncertainty note and a concise explanation suitable for a younger student. Do not claim professional validation from a classroom simulation.

Investigation 7: Dynamic reserve

Add an interfering tone much larger than the desired signal. Check whether numerical range or front-end saturation limits recovery before averaging helps. Include one graph or table, one dimensional or limiting-case check, and one paragraph separating the calculated result from the real-world conclusion. Change one input across a sensible range to test sensitivity. If the result changes sharply, report the instability instead of hiding it with extra decimal places. Preserve the original data and record every correction so a classmate can audit the route from measurement to claim. Before calculating, predict the direction of change and explain the physical reason. After calculating, compare the prediction with the result and investigate any disagreement. Repeat the analysis with one deliberately flawed input—wrong unit, reversed sign, missing sample or premature rounding—and describe how the error appears. This makes the activity an error-detection exercise rather than a search for one polished answer. Finish by naming which quantities were observed, which were assumed, which were fitted and which were derived. State the domain over which the model is credible and one condition that would require a richer model. A strong submission includes the raw synthetic data, formulas or code, labelled axes, units, intermediate checks, final result, uncertainty note and a concise explanation suitable for a younger student. Do not claim professional validation from a classroom simulation.

Investigation 8: Noise spectrum

Generate white noise and a low-frequency drift. Explain why modulation can move the measurement away from a noisy spectral region. Include one graph or table, one dimensional or limiting-case check, and one paragraph separating the calculated result from the real-world conclusion. Change one input across a sensible range to test sensitivity. If the result changes sharply, report the instability instead of hiding it with extra decimal places. Preserve the original data and record every correction so a classmate can audit the route from measurement to claim. Before calculating, predict the direction of change and explain the physical reason. After calculating, compare the prediction with the result and investigate any disagreement. Repeat the analysis with one deliberately flawed input—wrong unit, reversed sign, missing sample or premature rounding—and describe how the error appears. This makes the activity an error-detection exercise rather than a search for one polished answer. Finish by naming which quantities were observed, which were assumed, which were fitted and which were derived. State the domain over which the model is credible and one condition that would require a richer model. A strong submission includes the raw synthetic data, formulas or code, labelled axes, units, intermediate checks, final result, uncertainty note and a concise explanation suitable for a younger student. Do not claim professional validation from a classroom simulation.

Investigation 9: Harmonic detection

Reference the second harmonic of a distorted periodic response. Separate fundamental and harmonic claims instead of calling both signal strength. Include one graph or table, one dimensional or limiting-case check, and one paragraph separating the calculated result from the real-world conclusion. Change one input across a sensible range to test sensitivity. If the result changes sharply, report the instability instead of hiding it with extra decimal places. Preserve the original data and record every correction so a classmate can audit the route from measurement to claim. Before calculating, predict the direction of change and explain the physical reason. After calculating, compare the prediction with the result and investigate any disagreement. Repeat the analysis with one deliberately flawed input—wrong unit, reversed sign, missing sample or premature rounding—and describe how the error appears. This makes the activity an error-detection exercise rather than a search for one polished answer. Finish by naming which quantities were observed, which were assumed, which were fitted and which were derived. State the domain over which the model is credible and one condition that would require a richer model. A strong submission includes the raw synthetic data, formulas or code, labelled axes, units, intermediate checks, final result, uncertainty note and a concise explanation suitable for a younger student. Do not claim professional validation from a classroom simulation.

Investigation 10: Calibration line

Apply known small inputs, fit output versus input and inspect residuals. Check offset, gain, linearity and uncertainty rather than forcing the intercept to zero. Include one graph or table, one dimensional or limiting-case check, and one paragraph separating the calculated result from the real-world conclusion. Change one input across a sensible range to test sensitivity. If the result changes sharply, report the instability instead of hiding it with extra decimal places. Preserve the original data and record every correction so a classmate can audit the route from measurement to claim. Before calculating, predict the direction of change and explain the physical reason. After calculating, compare the prediction with the result and investigate any disagreement. Repeat the analysis with one deliberately flawed input—wrong unit, reversed sign, missing sample or premature rounding—and describe how the error appears. This makes the activity an error-detection exercise rather than a search for one polished answer. Finish by naming which quantities were observed, which were assumed, which were fitted and which were derived. State the domain over which the model is credible and one condition that would require a richer model. A strong submission includes the raw synthetic data, formulas or code, labelled axes, units, intermediate checks, final result, uncertainty note and a concise explanation suitable for a younger student. Do not claim professional validation from a classroom simulation.

Investigation 11: Uncertainty propagation

Combine X and Y uncertainty for amplitude and phase near several signal levels. Notice why phase becomes unstable when amplitude approaches zero. Include one graph or table, one dimensional or limiting-case check, and one paragraph separating the calculated result from the real-world conclusion. Change one input across a sensible range to test sensitivity. If the result changes sharply, report the instability instead of hiding it with extra decimal places. Preserve the original data and record every correction so a classmate can audit the route from measurement to claim. Before calculating, predict the direction of change and explain the physical reason. After calculating, compare the prediction with the result and investigate any disagreement. Repeat the analysis with one deliberately flawed input—wrong unit, reversed sign, missing sample or premature rounding—and describe how the error appears. This makes the activity an error-detection exercise rather than a search for one polished answer. Finish by naming which quantities were observed, which were assumed, which were fitted and which were derived. State the domain over which the model is credible and one condition that would require a richer model. A strong submission includes the raw synthetic data, formulas or code, labelled axes, units, intermediate checks, final result, uncertainty note and a concise explanation suitable for a younger student. Do not claim professional validation from a classroom simulation.

Investigation 12: Reproducible notebook

Save sample rate, reference source, phase convention, filters and averaging time. Make raw data and processing settings sufficient for a peer to reconstruct the outputs. Include one graph or table, one dimensional or limiting-case check, and one paragraph separating the calculated result from the real-world conclusion. Change one input across a sensible range to test sensitivity. If the result changes sharply, report the instability instead of hiding it with extra decimal places. Preserve the original data and record every correction so a classmate can audit the route from measurement to claim. Before calculating, predict the direction of change and explain the physical reason. After calculating, compare the prediction with the result and investigate any disagreement. Repeat the analysis with one deliberately flawed input—wrong unit, reversed sign, missing sample or premature rounding—and describe how the error appears. This makes the activity an error-detection exercise rather than a search for one polished answer. Finish by naming which quantities were observed, which were assumed, which were fitted and which were derived. State the domain over which the model is credible and one condition that would require a richer model. A strong submission includes the raw synthetic data, formulas or code, labelled axes, units, intermediate checks, final result, uncertainty note and a concise explanation suitable for a younger student. Do not claim professional validation from a classroom simulation.