cbadc.simulator.numerical_simulator.PreComputedControlSignalsSimulator

class cbadc.simulator.numerical_simulator.PreComputedControlSignalsSimulator(analog_system: Union[AnalogSystem, ChainOfIntegrators, LeapFrog], digital_control: Union[DigitalControl, MultiLevelDigitalControl], input_signal: List[Sinusoidal], initial_state_vector: array = None, state_noise_covariance_matrix: ndarray = None, atol: float = 1e-15, rtol: float = 1e-10, seed: int = 4212312513432239834528672)[source]

Bases: _BaseSimulator

Simulate the analog system and digital control interactions in the presence on analog signals.

Parameters
  • analog_system (cbadc.analog_system.AnalogSystem) – the analog system

  • digital_control (cbadc.digital_control.DigitalControl) – the digital control

  • input_signals ([cbadc.analog_signal.AnalogSignal]) – a python list of analog signals (or a derived class)

  • clock (cbadc.simulator.clock, optional) – a clock to syncronize simulator output against, defaults to a phase delayed version of the digital_control clock.

  • t_stop (float, optional) – determines a stop time, defaults to math.inf

  • initial_state_vector (array_like, shape=(N), optional) – initial state vector.

  • rtol (float, optional) – Relative and absolute tolerances. The solver keeps the local error estimates less than atol + rtol * abs(y). Effects the underlying solver as described in scipy.integrate.solve_ivp(). Default to 1e-3 for rtol and 1e-6 for atol.

  • atol (float, optional) – Relative and absolute tolerances. The solver keeps the local error estimates less than atol + rtol * abs(y). Effects the underlying solver as described in scipy.integrate.solve_ivp(). Default to 1e-3 for rtol and 1e-6 for atol.

analog_system

the analog system being simulated.

Type

cbadc.analog_system.AnalogSystem

digital_control

the digital control being simulated.

Type

cbadc.digital_control.DigitalControl

t

current time of simulator.

Type

float

clock

a clock to which the outputs of the simulator are synchronized.

Type

float

t_stop

end time at which the generator raises StopIteration.

Type

float

rtol, atol

Relative and absolute tolerances. The solver keeps the local error estimates less than atol + rtol * abs(y). Effects the underlying solver as described in scipy.integrate.solve_ivp(). Default to 1e-3 for rtol and 1e-6 for atol.

Type

float, optional

Yields

array_like, shape=(M,)

Methods

__init__(analog_system, digital_control, ...)

observations()

return the current analog system observations.

reset([t])

reset initial time of simulator and digital control

state_vector()

return current analog system state vector \(\mathbf{x}(t)\) evaluated at time \(t\).

Attributes

res

observations() ndarray

return the current analog system observations.

in other words we return

\(\mathbf{y}(t) = \mathbf{C}^{\mathsf{T}} \mathbf{x}(t)\)

Returns

returns the analog system observation :math:`mathbf{y}(t)

Return type

array_like, shape=(N_tilde,)

reset(t: float = 0.0)

reset initial time of simulator and digital control

state_vector() ndarray

return current analog system state vector \(\mathbf{x}(t)\) evaluated at time \(t\).

Returns

returns the state vector \(\mathbf{x}(t)\)

Return type

array_like, shape=(N,)