pyoomph.utils.periodic_driving_response module

A module to compute the linear response of a system to a periodic driving force.

class pyoomph.utils.periodic_driving_response.PeriodicDrivingResponse(problem, omega_param_name='_driving_omega', driving_domain_name='_driving', hopf_param_name='_driving_damping')[source]

Bases: object

Helper class to compute the linear response of a system to a periodic driving force. Replace the periodic driving, e.g. some cos(omega*var("time")), by get_driving_mode() in the problem. Then, after finding a stationary solution, you can use iterate_over_driving_frequencies() to iterate over driving frequencies and get the response of the system.

Parameters:
  • problem (Problem) – The problem to which the driving force is applied.

  • omega_param_name (str) – The name of the parameter that stores the current driving frequency.

  • hopf_param_name (str) – The name of the parameter that is used to find the driving response.

get_driving_frequency()[source]

Returns the current frequency of the driving force.

get_driving_mode()[source]

Must be used to replace the driving force in the problem.

Returns:

An expression that represents the driving force for finding the linear response.

get_driving_omega()[source]

Returns the current angular frequency of the driving force.

iterate_over_driving_frequencies(*, omegas=None, freqs=None, unit=1, signum=1)[source]

Iterator to iterate over the response of the system to different driving frequencies.

Parameters:
  • omegas (Optional[List[Union[Expression, int, float]]]) – A list of angular frequencies to iterate over. You must either set omegas or freqs.

  • freqs (Optional[List[Union[Expression, int, float]]]) – A list of frequencies to iterate over. You must either set omegas or freqs.

  • unit (Union[Expression, int, float]) – An optional unit for the frequencies, e.g. kilo*hertz. Defaults to 1.

  • signum (int) – The sign orientation in the complex plane. Defaults to 1.

Yields:

For each frequency, you get the current response as complex vector, with entries belonging to the degrees of freedom of the system.

set_driving_frequency(freq)[source]

Sets the current frequency of the driving force.

set_driving_omega(omega)[source]

Sets the current angular frequency of the driving force.

split_response_amplitude_and_phase()[source]

Splits the complex response vector into a real-valued amplitude and phase vector.

Returns:

The pair of amplitude and phase vectors.