Skip to content

Latest commit

 

History

History
69 lines (51 loc) · 1.63 KB

File metadata and controls

69 lines (51 loc) · 1.63 KB

.PLOT Statement

The .PLOT statement specifies signals to capture as XY plot data during simulation. Results are stored in the XyPlots collection of the SpiceSharpModel.

Syntax

.PLOT [<type>] <expr1> [<expr2> ...] [merge]
Parameter Description
type Optional analysis filter: DC, AC, TRAN, NOISE
expr Signal expressions to plot
merge Optional keyword — combine all simulations into one plot

Examples

* Plot output voltage during transient
.PLOT TRAN V(OUT)

* Plot multiple signals during AC
.PLOT AC V(OUT) V(IN)

* Merge all sweep iterations into one plot
.PLOT TRAN V(OUT) merge

MNA View

.PLOT does not affect convergence, timestep choice, or matrix loading. It records values after the requested analysis has solved its MNA system.

The plotted expressions use the same sources as .SAVE and .PRINT: node voltages, branch currents, and device properties computed from the solved state.

Merge Behavior

  • Without merge: A separate XyPlot is created for each simulation run (except OP).
  • With merge: All simulation runs are combined into a single XyPlot with series labeled by simulation.

Typical Usage

RC Step Response
V1 IN 0 PULSE(0 5 0 1n 1n 5m 10m)
R1 IN OUT 1k
C1 OUT 0 100n
.TRAN 1e-6 20e-3
.PLOT TRAN V(OUT) V(IN)
.END

C# API

var model = reader.Read(parseResult.FinalModel);

foreach (var plot in model.XyPlots)
{
    Console.WriteLine(plot.Name);
    foreach (var series in plot.Series)
    {
        Console.WriteLine($"  Series: {series.Name}, Points: {series.Points.Count}");
    }
}