Ohmforge Transient Simulation
Simulate a circuit over time: waveforms, Vpp/RMS/frequency, CSV and a chart.
How it works
Runs a transient (time-domain) simulation of a SPICE netlist with trapezoidal or backward-Euler integration, adaptive time steps and breakpoints at source corners. Returns resampled waveforms of the chosen nodes, oscilloscope-style measurements (min, max, Vpp, mean, RMS, frequency, duty cycle, rise time), rating warnings, a chart and CSV.
- Starts from the DC operating point (or from initial conditions with "uic"), then integrates capacitors and inductors with companion models: trapezoidal (2C/h) or backward Euler (C/h); inductors and coupled inductors use branch currents.
- Each time step is solved with Newton–Raphson. The step size adapts: the difference between the corrector and a linear predictor estimates the local truncation error; failed steps are retried with h/8.
- Source corners (PULSE edges, PWL points) are breakpoints: the integrator lands on them and restarts with backward Euler to avoid trapezoidal ringing. Behavioural events (555 latch, relay pull-in, fuse, current limit) are localised by step bisection.
- Returned samples are linearly interpolated onto a uniform grid (output step). Measurements: time-weighted mean and RMS, Vpp, frequency from mid-level crossings with 10 % hysteresis, 10–90 % rise time.
Teaching-grade simulation: device models are simplified (Ebers–Moll BJT, level-1 MOSFET, behavioural op-amps and 555) and part ratings are typical values. Verify real designs on the bench and against manufacturer data before building anything connected to mains voltage.
Sources
- SPICE: A Computer Program to Simulate Semiconductor Circuits (L. W. Nagel, UC Berkeley ERL-M520, 1975) (University of California, Berkeley)
- The Modified Nodal Approach to Network Analysis (Ho, Ruehli, Brennan, IEEE Trans. Circuits and Systems, 1975) (IEEE)
- ngspice User Manual (device models, convergence options, source syntax) (ngspice project)
Part of Ohmforge
-
Ohmforge Virtual electronics workbench
Draw a circuit, switch it on, and measure it with real-feeling bench instruments.
Related tools
- Ohmforge DC Operating Point – SPICE netlist in, node voltages, branch currents, power and overload warnings out.
- Ohmforge AC Sweep (Bode plot) – Frequency response of a circuit: Bode magnitude/phase, −3 dB corner and unity gain.
How to use the Ohmforge Transient Simulator
Simulate voltages over time from a SPICE netlist, from RC charging to rectifier ripple, and read min, max, RMS, frequency and duty cycle like on an oscilloscope.
What it is for
A DC operating point tells you where a circuit settles. A transient simulation shows how it gets there and what happens over time: a capacitor charging, a rectifier's ripple, a 555 oscillating, a switch turning on. This tool runs Ohmforge's time-domain solver on a SPICE netlist or a saved .ohmforge.json project. You get the waveforms as a chart, oscilloscope-style measurements for each node, rating checks and a CSV of every sample.
Sources can be DC, SIN, PULSE or PWL. The stop time and output step come from the netlist's .tran line unless you override them. You can choose trapezoidal integration (accurate, SPICE's default) or backward Euler (damped, more robust), and start from initial conditions instead of the operating point, which oscillators need. Device models are simplified teaching-grade ones. Treat results as a strong guide, not a substitute for the bench.
Worked example
RC step response, τ = 1 ms: a 1 V pulse into 1 kΩ and 1 µF, .tran 10u 5m.
Transient over 5 ms in 513 steps. V(out) ranges from 0 V to 993.3 mV, RMS 838.3 mV.
After five time constants the capacitor has reached 99.3 % of the step, matching the textbook 1 − e⁻⁵. The run needed 513 accepted steps and no rejected ones.
Half-wave rectifier with smoothing: a 12 V peak, 50 Hz sine through a 1N4007 into 470 µF with a 1 kΩ load, .tran 50u 100m:
| Node | Min | Max | Mean | RMS | Frequency |
|---|---|---|---|---|---|
| ac | −12 V | 12 V | ≈ 0 V | 8.485 V | 50 Hz |
| out | 0 V | 11.25 V | 10.83 V | 10.9 V | 50 Hz |
The output peaks about 0.75 V below the input because of the diode drop. The "Min 0 V" is the moment of switch-on, not the ripple. In the CSV, the last 40 ms show the output swinging between 10.82 V and 11.25 V, so about 0.44 V of ripple. That fits the rule of thumb I ÷ (f·C) ≈ 10.8 mA ÷ (50 Hz × 470 µF) ≈ 0.46 V.
How to read the result
- Run: simulated time, accepted and rejected steps, and how it started (operating point or initial conditions). Rejected steps are normal near sharp edges.
- Waveforms: up to eight probed nodes on one chart.
- Measurements: min, max, peak-to-peak, time-weighted mean and RMS, frequency and duty cycle, each taken over the whole run.
- Rating check: whether any part exceeded its rating, judged on average power, RMS current and peak voltage over the run. Netlist resistors without a
POWER=value are checked against an assumed 0.25 W. - Waveforms (CSV): time plus one column per node, for your own analysis.
Tips and common mistakes
- Measurements include the start-up. For steady-state values like ripple, simulate longer and read the last cycles from the CSV.
- Set the output step well below the fastest event. A 10 µs step can't resolve a 1 µs edge, and it also limits the internal step size.
- Oscillators such as a 555 astable or a ring oscillator may sit at a stable but wrong operating point. Turn on Start from initial conditions.
- If trapezoidal integration rings around sudden changes, try backward Euler. It damps the numerical oscillation at the cost of a little accuracy.
- Use Nodes to return to keep the chart readable on large circuits. Without it, all nodes are returned.
FAQ
How do I measure ripple on a power supply?
Simulate several cycles past start-up, download the CSV and take max minus min of the output over the last few periods. In the example, that's about 0.44 V.
What's the difference between trapezoidal and backward Euler?
Trapezoidal is more accurate and is SPICE's default. Backward Euler is more robust and damps artificial ringing, which helps with stiff or switching circuits.
Why does my oscillator not oscillate?
Starting from the DC operating point can leave it in a balanced state. Enable Start from initial conditions so the capacitors begin at 0 V.
Can I use my Ohmforge project instead of a netlist?
Yes. Paste the saved project JSON. Its transient settings become the defaults.
Guide last updated:
For scripts and AI agents
- JSON API:
POST https://ohmforgetransient.usefulweb.site/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://ohmforgetransient.usefulweb.site/mcp· tool nameohmforge_transient
Example request
curl -s -X POST https://ohmforgetransient.usefulweb.site/api/v1/calculate \
-H 'content-type: application/json' \
-d '{"netlist":"* RC step response, tau = 1 ms\nV1 in 0 PULSE(0 1 0 1n 1n 10m 20m)\nR1 in out 1k\nC1 out 0 1u\n.tran 10u 5m\n.end","probes":["in","out"]}'