tdcpy.ndde module#

NDDE - Neutral Delay Differential Equation#

TODO TODO TODO .. rubric:: Notes

  1. As of now, only A and hA, rest of the implementation will follow

class tdcpy.ndde.NDDE(A, hA, H, hH, B=None, hB=None, C=None, hC=None, D=None, hD=None, **kwargs)#

Bases: TDSBase

Neutral Delay Differential Equaton

dxdt(t) = A[i]*x(t - hA[i]) + ... + A[mA]*x(t - hA[mA])
      - H[0] * dxdt(t - hH[0]) - ... - H[mH] * dxdt(t - hH[mH])

TODO documentation

Parameters:
__init__(A, hA, H, hH, B=None, hB=None, C=None, hC=None, D=None, hD=None, **kwargs)#
Parameters:
Return type:

None

property n: int#

state size

property n_inputs: int#

number of inputs

property n_outputs: int#

number of outputs

property E: ndarray[tuple[Any, ...], dtype[_ScalarT]]#

E matrix from TDS representation, shape (n, n)

property A: ndarray[tuple[Any, ...], dtype[_ScalarT]]#

list of dynamics matrices

property H: ndarray[tuple[Any, ...], dtype[_ScalarT]]#

list of dynamics matrices

property hA: ndarray[tuple[Any, ...], dtype[_ScalarT]]#

A delays

property mA: int#

number of A delays

property hH: ndarray[tuple[Any, ...], dtype[_ScalarT]]#

H delays

property mH: int#

number of H delays

property B: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None#

input matrices

property hB: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None#

input delays

property mB: int#

number of input delays

property C: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None#

output matrices

property hC: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None#

output delays

property mC: int#

number of output delays

property D: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None#

feed-through matrices

property hD: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None#

feed-through delays

property mD: int#

number of feed-through delays

property uE: ndarray[tuple[Any, ...], dtype[_ScalarT]]#

orthonormal basis for left null space of E

property vE: ndarray[tuple[Any, ...], dtype[_ScalarT]]#

orthonormal basis for right null space of E

property is_compressed: bool#

Cheks if NDDE is in compressed form (no duplicates in hA)

property is_sorted: bool#

TODO Checks if DDAE is in sorted form (ascending hA)

property is_logical: bool#

TODO - as of now, always return False

property is_lti: bool#

Checks if NDDE is Linear Time-invariant

property is_real: bool#

Checks if DDAE uses complex storage for any of defining arrays

property is_delay_difference_equation: bool#

NDDE can not be delay difference equation

to_asymptotic_transfer_function(**kwargs)#
Return type:

RDDE

sort(inplace=False)#

Sorts delays (self.hA) into ascending order

Return type:

NDDE

compress(inplace=False)#

Removes delay duplicates, sorts delays into ascending order

Parameters:
  • inplace (bool) – wheter to modify existing NDDE or create a new one, default False

  • rtol (float) – relative tolerance for determining matrix element is zero, default 1e-5

  • atol (float) – absolute tolerance for determining matrix element is zero, default 1e-8

Returns:

compressed representation None: if inplace=True (current object is updated)

Return type:

NDDE

to_ddae()#

Converts NDDE to DDAE

[0  I]  [dxdt(t)] = [A0 0] [x(t)] + SUM [A[k]   0] [x(t-tau)]
[0  0]  [dadt(t)] = [I -I] [a(t)]   k=1 [H[k-1] 0] [a(t-tau)]
Return type:

DDAE

get_delay_difference_equation()#

Converts to Delay-difference Equation

For a NDDAE, the associated delay difference equation is given by

I*x(t) + H[0]*x(t-hH[0]) + ... + H[mH]*x(t-hH[mH]) = 0
Return type:

DDAE

eval_char_matrix(s)#

Evaluate the characteristic matrix at s

M(s) = s*(E + H[0]*exp(-s*hH[0]) + ... + H[mH]*exp(-s*hH[mH])) - A[0]*exp(-s*hA[0]) - ... - A[mA]*exp(-s*hA[mA])
Parameters:

s (complex, float, int) – s from complex plane

Returns:

characteristic matrix M evaluated at s

Return type:

M (array)

eval_char_matrix_derivative(s)#

Derivative of the characteristic matrix with respect to s evaluated at s

dM(s) = E + (H[0]*exp(-s*H[0])+...+H[mH]*exp(-s*H[mH]) - s*(hH[0]*H[0]*exp(-s*H[0])+...+hH[mH]*H[mH]*exp(-s*H[mH])
            + (hA[0]*A[0]*exp(-s*hA[0])+...+hA[mA]*A[mA]*exp(-s*hA[mA]))
Parameters:
  • (complex (s) – s from complex plane

  • float – s from complex plane

  • int – s from complex plane

  • s (complex)

Returns:

derivative of characteristic matrix M evaluated at s

Return type:

dM(array)