lcapy.tmatrix.TimeDomainMatrix

class lcapy.tmatrix.TimeDomainMatrix(*args, **kwargs)

Bases: Matrix

Methods

LT()

Attributes

rows

cols

class TimeDomainExpression(val, **assumptions)

Bases: TimeDomain, Expr

t-domain expression or symbol.

FT(var=None, evaluate=True, **assumptions)

Attempt Fourier transform.

X(f) = int_{-infty} ^ {infty} x(t) exp(-j 2pi f t) dt.

HT(var=None, evaluate=True, **assumptions)

Attempt Hilbert transform.

IHT(var=None, evaluate=True, **assumptions)

Attempt Hilbert transform.

LT(evaluate=True, zero_initial_conditions=None, **assumptions)

Determine one-sided Laplace transform with 0- as the lower limit.

By default initial conditions are assumed to be zero. This can be controlled by zero_initial_conditions.

This is an alias for laplace.

property abs

Return absolute value.

angular_fourier(evaluate=True, **assumptions)

Attempt angular Fourier transform.

angular_frequency_response(**assumptions)

Convert to angular frequency response domain. Note, this is similar to the angular Fourier domain but not always.

differential_equation(inputsym='x', outputsym='y')

Create differential equation from impulse response.

discretize(method=None, alpha=0.5)

Convert to a discrete-time approximation:

\(x(n) pprox K x(t)\)

where \(K\) is a scale factor.

The default method depends on the expression quantity. If the quantity is undefined, voltage, current, `voltagesquared, currentsquared, or power, the default method is impulse-invariance and there is no scaling. This uses:

: math: x[n] = x(n Delta t)

For other quantities, the default method is bilinear’, and the result is scaled by the sampling interval (`Delta t) as is common for the discrete-time impulse response of digital filters:

: math: h[n] = Delta t h_c(n Delta t)

The methods are: ‘impulse-invariance’ ‘bilinear’, ‘tustin’, ‘trapezoidal’ ‘generalized-bilinear’, ‘gbf’ controlled by the parameter alpha ‘euler’, ‘forward-diff’, ‘forward-euler’ ‘backward-diff’, ‘backward-euler’ ‘simpson’, ‘matched-Z’, ‘zero-pole-matching’. All the methods except impulse-invariance are applied in the Laplace domain so the result is unknown for n < 0 unless the expression is causal.

dlti_filter(method='bilinear')

Create DLTI filter using bilinear transform.

property energy

Return signal energy.

final_value()

Determine value at t = oo.

force_causal()

Remove the piecewise condition from the expression and multiply by Heaviside function. See also remove_condition.

fourier(var=None, evaluate=True, **assumptions)

Attempt Fourier transform. This is an alias for FT.

frequency_response(**assumptions)

Convert to frequency response domain. Note, this is similar to the Fourier domain but not always.

hilbert(var=None, evaluate=True, **assumptions)

Attempt Hilbert transform. This is an alias for HT.

initial_value()

Determine value at t = 0. See also pre_initial_value and post_initial_value

inverse_hilbert(var=None, evaluate=True, **assumptions)

Attempt Hilbert transform. This is an alias for IHT.

laplace(evaluate=True, zero_initial_conditions=None, **assumptions)

Determine one-sided Laplace transform with 0- as the lower limit.

By default initial conditions are assumed to be zero. This can be controlled by zero_initial_conditions.

This is an alias for LT.

norm_angular_fourier(evaluate=True, **assumptions)

Attempt normalized angular Fourier transform.

norm_fourier(evaluate=True, **assumptions)

Attempt normalized Fourier transform.

phasor(**assumptions)

Convert to phasor domain.

plot(t=None, **kwargs)

Plot the time waveform. If t is not specified, it defaults to the range(-0.2, 2). t can be a vector of specified instants, a tuple specifing the range, or a constant specifying the maximum value with the minimum value set to 0.

kwargs include: axes - the plot axes to use otherwise a new figure is created xlabel - the x-axis label ylabel - the y-axis label xscale - the x-axis scaling, say for plotting as ms yscale - the y-axis scaling, say for plotting mV plot_deltas - plot Dirac deltas as arrows in addition to those supported by the matplotlib plot command.

The plot axes are returned.

post_initial_value()

Determine value at t = 0+. See also pre_initial_value and initial_value

pre_initial_value()

Determine value at t = 0-. See also initial_value and post_initial_value

response(xvector, tvector, method='bilinear')

Evaluate response to input signal xvector at times tvector. This returns a NumPy array.

sample(tvector)

Return a discrete-time signal evaluated at time values specified by tvector. This returns a NumPy array.