11.1.8.2. WaveForm

This module implements classes to handle analysis output.

class PySpice.Probe.WaveForm.AcAnalysis(simulation, frequency, nodes, branches, internal_parameters)[source]

Bases: PySpice.Probe.WaveForm.Analysis

This class implements an AC analysis.

property frequency

Return an Numpy array for the frequency abscissa

class PySpice.Probe.WaveForm.Analysis(simulation, nodes=(), branches=(), elements=(), internal_parameters=())[source]

Bases: object

Base class for the simulation output.

Depending of the simulation type, the simulator will return waveforms as a function of

  • time

  • frequency

  • sweep

and corresponding to

  • a node’s voltage

  • a source’s current

The name of a waveform is

  • node’s voltage: node’s name

  • source’s current: source’name

If the waveform name is a valid Python identifier, then you can get the corresponding waveform using:

analysis.waveforme_name

else you have to use this fallback:

analysis['waveforme_name']

Examples of usages:

# Operating point analysis
for node in analysis.nodes.values():
    print('Node {}: {:5.2f} V'.format(str(node), float(node)))
for node in analysis.branches.values():
    print('Node {}: {:5.2f} A'.format(str(node), float(node)))

# DC sensitivity analysis
for element in analysis.elements.values():
    print(element, float(element))

# Plot the voltage of the "out" node
plt.plot(analysis.out.abscissa, analysis.out)

Public Attributes:

nodes

Dictionary for node voltages indexed by node names

branches

Dictionary for branch currents indexed by source names

elements

Dictionary for elements …

property simulation

Return the simulation instance

class PySpice.Probe.WaveForm.DcAnalysis(simulation, sweep, nodes, branches, internal_parameters)[source]

Bases: PySpice.Probe.WaveForm.Analysis

This class implements a DC analysis.

When the DC analysis is performed with multiple sources, sweep is the last source.

The loop scheme is:

for v1 in vsource1:
     for v2 in vsource2:
         ...
property sweep

Return an Numpy array for the sweep abscissa

class PySpice.Probe.WaveForm.DistortionAnalysis(simulation, frequency, nodes, branches, internal_parameters)[source]

Bases: PySpice.Probe.WaveForm.Analysis

This class implements Distortion analysis.

property frequency

Return an Numpy array for the frequency abscissa

class PySpice.Probe.WaveForm.NoiseAnalysis(simulation, nodes, branches, internal_parameters)[source]

Bases: PySpice.Probe.WaveForm.Analysis

This class implements Noise analysis.

class PySpice.Probe.WaveForm.OperatingPoint(simulation, nodes=(), branches=(), elements=(), internal_parameters=())[source]

Bases: PySpice.Probe.WaveForm.Analysis

This class implements an operating point analysis.

class PySpice.Probe.WaveForm.PoleZeroAnalysis(simulation, nodes, branches, internal_parameters)[source]

Bases: PySpice.Probe.WaveForm.Analysis

This class implements a Pole-Zero analysis.

class PySpice.Probe.WaveForm.SensitivityAnalysis(simulation, elements, internal_parameters)[source]

Bases: PySpice.Probe.WaveForm.Analysis

This class implements an sensitivity analysis.

class PySpice.Probe.WaveForm.TransferFunctionAnalysis(simulation, nodes, branches, internal_parameters)[source]

Bases: PySpice.Probe.WaveForm.Analysis

This class implements Transfer Function (TF) analysis.

class PySpice.Probe.WaveForm.TransientAnalysis(simulation, time, nodes, branches, internal_parameters)[source]

Bases: PySpice.Probe.WaveForm.Analysis

This class implements a transient analysis.

property time

Return an Numpy array for the time abscissa

class PySpice.Probe.WaveForm.WaveForm[source]

Bases: PySpice.Unit.Unit.UnitValues

This class implements waveform on top of a Numpy Array.

Public Attributes:

name

unit

title

abscissa

Numpy array of the analysis abscissa