Control and filtering

lock
Lock

A simple lock which computes and applies the feedback to a given parameter using an error signal.

Syntax:
lock name error_signal feedback gain accuracy enabled=true offset=0
Required:

name: Name of newly created lock.

error_signal: An error signal parameter or an object capable of producing a real-type error signal. This is typically a demodulated PowerDetector instance (or the name of the instance).

feedback: A parameter of the model to apply the locks’ feedback signal to.

gain: Control loop gain.

accuracy: Threshold to decide whether the loop is locked.

enabled: If true this lock will run when the RunLocks() action is used. Explicitly specifying the name of the lock will override this setting, e.g. RunLocks(name).

offset: An offset that is applied to the error signal before it is used.

degree_of_freedom
dof
DegreeOfFreedom

The degree of freedom element represents degrees of freedom in your optical setup. It is used to control multiple parameters in your model in a coherent way.

Syntax:
dof name *node_amplitude_pairs DC=0 lock_parameters=true
Required:

name: Name of the degree of freedom.

\*node_amplitude_pairs: tuple[str, float | Symbol]: String referring to a parameter or a local degree of freedom, coupled with the amplitude with which this DOF will drive the parameter. The parameter value will be set to the product of this (symbolic) amplitude and the DOF.DC parameter. In case multiple DOFS drive the same parameter, their contributions will be summed.

Optional:

DC: DC value for the degree of freedom, by default 0

lock_parameters: Whether to ‘lock’ the parameters driven by this degree of freedom. This prevents accidental overriding of parameter values that are meant to be controlled by a dof, by default True.

See Also:

Using degrees of freedom

amplifier
Amplifier
Syntax:
amplifier name gain=1

Component Graph

../../../_images/amp.svg
filter_zpk
zpk
ZPKFilter

A zero-pole-gain filter element that is used for shaping signals in simulations. It is a two port element. p1 is the input port and p2 is the output port. Each one has a single node: p1.i and p2.o.

Syntax:
zpk name z p k=none fQ=false gain=1
Required:

name: Name of element in the model

z: A 1D-array of zeros. Use [] if none are required. By default these are provided in units of radians/s, not Hz.

p: A 1D-array of poles. Use [] if none are required. By default these are provided in units of radians/s, not Hz.

gain: Overall gain for the filter. Differs from k as this is a Parameter so can be easily switched on/off or varied during a simulation.

Optional:

k: Gain factor for the zeros and poles. If None then its value is automatically set to generate a unity gain at DC.

fQ: When True the zeros and poles can be specified in a tuple of (frequency, quality factor) for each pole and zero. This automatically adds the complex conjugate pair.

Component Graph

../../../_images/zpk.svg
filter_butter
butter
ButterFilter
Syntax:
butter name order btype frequency gain=1 analog=true

Component Graph

../../../_images/butter.svg
filter_cheby1
cheby1
Cheby1Filter
Syntax:
cheby1 name order rp btype frequency gain=1 analog=true

Component Graph

../../../_images/cheby.svg
test_point
test
TestPoint

A simple component which has an arbitrary number of test nodes that can be connected to and from.

Syntax:
test name *ports