finesse.analysis.actions.FrequencyResponse

Overview

class finesse.analysis.actions.FrequencyResponse(f, inputs, outputs, *, open_loop=False, name='inject')[source]

Bases: finesse.analysis.actions.Action

Computes the frequency response of a signal injceted at various nodes to compute transfer functions to multiple output nodes. Inputs and outputs should be electrical or mechanical nodes. It does this in an efficient way by using the same model and solving for multiple RHS input vectors.

This action does not alter the model state.

Parameters

f : array, double

Frequencies to compute the transfer functions over

inputs : iterable[str or Element]

Mechanical or electrical node to inject signal at

outputs : iterable[str or Element]

Mechanical or electrical nodes to measure output at

open_loop : bool, optional

Computes open loop transfer functions if the system has closed

name : str, optional

Solution name

Examples

Here we measure a set of transfer functions from DARM and CARM to four readouts for a particular model,

>>> sol = FrequencyResponse(np.geomspace(0.1, 50000, 100),
...         ('DARM', 'CARM'),
...         ('AS.DC', 'AS45.I', 'AS45.Q', 'REFL9.I'),
... ).run(model)

Single inputs and outputs can also be specified

>>> FrequencyResponse(np.geomspace(0.1, 50000, 100), 'DARM', AS.DC').run(model)

The transfer functions can then be accessed like a 2D array by name, the ordering of inputs to outputs does not matter.

>>> sol['DARM'] # DARM to all outputs
>>> sol['DARM', 'AS.DC'] # DARM to AS.DC
>>> sol['DARM', ('AS.DC', 'AS45.I')]
>>> sol['AS.DC'] # All inputs to AS.DC readout