# Sweep parameters and keep every case separate

Declare global parameters, add .STEP LIST or linear dimensions, preview the expanded cases and retain each case’s assignments, seed and output identity.

## Compatibility

2.9.0 release target; frozen Windows candidate CLI and maintained-source evidence

Published guidance with release-applicability limits. Confirm package applicability before following this guide.

[Download Sweep parameters and keep every case separate (ZIP)](/_functions/kbExample?name=bias-sweep.zip)

Includes: bias_sweep.cir, README.txt.

## Build and review a sweep in the GUI

The supplied bias_sweep.cir already contains both sweep dimensions. Inspect or edit those entries rather than adding duplicate dimensions. For a new circuit, create the bias LIST values 1m 2m and the resistance range 3 to 1 with increment -1; suffixes retain their electrical meaning.

1. Open a complete editable netlist with the required global .PARAM declarations and an explicit .TRAN or .IV analysis.
2. Open Run > Sweep and measurement workbench. Select Parameter sweep, the source scope and declared parameter. Choose LIST values or a linear range.
3. Use template to replace the proposed command. Editing a template field alone does not replace source. Preview changes, inspect the complete diff, acknowledge the review and apply it.
4. Add a second dimension in the same scope for a Cartesian sweep. Save, then use Preview saved run plan to verify actual assignments, case order, effective seeds and destinations before Run.
5. After execution inspect each case’s status and committed data. Compare plots only for successful retained cases with identical stored time coordinates; use tables or separate files when grids differ.

![Native sweep and measurement workbench on the bias sweep source, with the selected global LIST sweep, proposed .STEP command and source-change review controls.](https://static.wixstatic.com/media/31de30_5e65f17d359549b7a22f375dda6d8aa2~mv2.png)

The native workbench is opened on the supplied sweep source. The existing command and the template fields remain separate until Use template and source-change review.

## Save the complete example as bias_sweep.cir

```text
* Six independent bias/resistance cases; last dimension varies fastest
.PARAM bias=1m
.PARAM resistance=1
I1 0 N DC bias
R1 N 0 resistance
.OPTION ANALYSIS=VOLTAGE INTEGRATION=BDF SEED=27
.STEP PARAM bias LIST 1m 2m
.STEP PARAM resistance 3 1 -1
.TRAN 1p 5p
.PRINT V(N)
.MEASURE TRAN output_peak MAX V(N)
.END

```

## Run the example from the CLI

Use one .PARAM assignment per line. Sweep values must be finite numeric constants; the default parameter declarations must also resolve. A linear increment must be nonzero and point toward the stop value.

Multiple dimensions form a Cartesian product and the last varies fastest. This example uses bias 1 mA then 2 mA; each bias visits resistance 3, 2 and 1 ohm. Each case is a fresh simulation, with no continuation history.

```text
josim-pro-cli -P 17 -o sweep.csv bias_sweep.cir
```

## Check all six cases

The checked output names run from sweep.tran-001.case-1.csv to sweep.tran-006.case-6.csv. The unsuffixed sweep.csv is not written. Use the actual planned/reported job ID rather than guessing a filename.

Each file has six rows over 0–5 ps and V(N) in volts. In source order the constant values are 0.003, 0.002, 0.001, 0.006, 0.004 and 0.002 V, matching I × R for this simple circuit. The independent check used relative 1e-12 and absolute 1e-15 V comparison bounds for this example only.

There are at most eight dimensions, 256 values per dimension and 256 total jobs per deck, including unswept analyses. These are run-count limits, not guarantees about memory or duration. Serial execution is the default; parallel eligibility is a separate platform-specific contract.

## Recover from a rejected sweep

1. Read the source-located .STEP diagnostic. Check declared parameter names, finite literal values, duplicate dimensions, increment direction and expanded case count.
2. For the descending resistance range in this example, restore increment -1 if it was changed to zero. The checked zero-increment request failed before replacing a pre-existing output; the corrected six-case example completed.
3. Keep each earlier committed result with its case identity after a failure. A failed or not-run case is not a successful simulation.

## Sources and verification details

Recorded inputs/builds only. Complete walkthrough and final-package acceptance remain separate.

- VAL-017: JoSIM-Pro 2.9 frozen Windows source candidate built 3 November 2026; not the final distributed package. Fixed-seed noise/spread repetition and CLI precedence; buffered/streamed/gzip data; six Cartesian sweep cases; saved testbench verdicts, provenance hashes, generation protection and recovery Twenty-two checks cover these CLI inputs and runtime only. Native screenshots illustrate authoring/settings controls without a GUI calculation, preview or saved-bench run. Cross-platform repeatability, peak memory, cancellation, other analysis families and final-package acceptance remain unverified. The constant-circuit numerical bounds are example-specific, not universal solver tolerances.

- josim-sweep-workbench: JoSIM-Pro 2.9 frozen Windows candidate, native controls, 3 November 2026. A native control illustration. The separately recorded CLI examples do not qualify this GUI route or the final distributed package.

- josim-pro:docs/manual_source/sections/syntax.tex: Parameter sweeps; Parameter definition
- josim-pro:docs/manual_source/sections/gui_simulation_results.tex: Sweeps, named groups and measurements
- validation:josim-jobs-windows-20261103: VAL-017; exact complete inputs, checked CLI outcomes and limits
- capture:josim-jobs-ui-20261103T145751: Production control illustrations only; no GUI solve, preview or bench run
- owner:technical-review-20261102: 2.9 public target; final distributed-package checks required

- VAL-017 checks the supplied CLI recipe on the frozen Windows candidate. The source manuals still match their reviewed hashes.
- Native images illustrate actual controls; the settings/workbench were cancelled and the testbench view hidden. Complete GUI, technical and final-package acceptance remain pending.

## Related guides

- [Reuse a parameterised subcircuit from an included library](/knowledge-base/josim-hierarchical-design)
- [Measure transient delays, peaks and scalar results](/knowledge-base/josim-measurements)
- [Make noisy and spread simulations reproducible](/knowledge-base/josim-seed-repeatability)
- [Save a transient testbench with explicit pass and fail criteria](/knowledge-base/josim-testbench)
