Toolbox for simulation vectors from a switchmode power converter.

Method __init__ Undocumented
Method N Given a simulation time vector t and my switching frequency fs, returns the number of switching periods in the simulation, including any partial ones at the ends.
Method pick Returns a copy of t where t >= t0, and copies of the args supplied after t with matching elements.
Method linregress No summary
Method extrapolatePdiss Returns copies of t and P with additional items appended to each with predicted power dissipation.
Method monotime Returns an equispaced monotonic time vector from minimum time to maximum with M points per switching period.
Method interpolate Returns equispaced monotonic time vector from minimum time to maximum, with N points, and spline-interpolated values of X at each of those points.
Method smoothed Returns a version of the Vectors object where the 'time' vector has exactly one sample per switching cycle and the others are smoothed and decimated to have the same reduced sample rate.
Method periodAveraged Returns the average value of X for each switching cycle.
Method lowerBound Returns a 2-tuple with equispaced time and value vectors from lower smoothed bound of X.
def __init__(self, fs, **kw):
Undocumented
def N(self, t, ts=None):

Given a simulation time vector t and my switching frequency fs, returns the number of switching periods in the simulation, including any partial ones at the ends.

You can specify a sample interval ts and then the returned number will be the number of samples required to represent the time vector at that equispaced sample interval.

def pick(self, t0, t, *args):

Returns a copy of t where t >= t0, and copies of the args supplied after t with matching elements.

def linregress(self, t, X, t0=0):

Returns the slope and y-intercept of a line fitted to the supplied time and value vectors t and X. If you set t0 to a time in the range of t, the linear regression will only operate on points after that time.

def extrapolatePdiss(self, t, P):

Returns copies of t and P with additional items appended to each with predicted power dissipation.

The last predicted point has twice the absolute time as the last element of t as supplied.

def monotime(self, t, M=1, N=None):

Returns an equispaced monotonic time vector from minimum time to maximum with M points per switching period.

You may specify the number of points with N instead of using a calculation based on switching frequency and M.

def interpolate(self, t, X, N, s=0.02, linear=False):

Returns equispaced monotonic time vector from minimum time to maximum, with N points, and spline-interpolated values of X at each of those points.

For a faster fit, you can set linear True and then simple linear interpolation will be used.

def smoothed(self, V):

Returns a version of the Vectors object where the 'time' vector has exactly one sample per switching cycle and the others are smoothed and decimated to have the same reduced sample rate.

def periodAveraged(self, t, X):

Returns the average value of X for each switching cycle.

def lowerBound(self, t, X):

Returns a 2-tuple with equispaced time and value vectors from lower smoothed bound of X.

API Documentation for pingspice, generated by pydoctor at 2021-09-18 08:41:11.