Phase#

class coupled_oscillator.phase.Phase(osc_prop: OscillatorProperties, angle: float = 0, displacement: float = 0, angle_momentum: float = 0, displacement_momentum: float = 0, arr: ndarray | None = None)[source]#

Bases: object

__init__(osc_prop: OscillatorProperties, angle: float = 0, displacement: float = 0, angle_momentum: float = 0, displacement_momentum: float = 0, arr: ndarray | None = None)[source]#

Methods

__init__(osc_prop[, angle, displacement, ...])

get_value(value)

Returns the value of the given object.

to_cartesian_coordinates()

Converts the phase to cartesian coordinates.

Attributes

angle

The angle of the pendulum.

angle_momentum

The angular momentum of the pendulum.

displacement

The displacement of the spring.

displacement_momentum

The displacement momentum of the spring.

to_cartesian_coordinates() ndarray[source]#

Converts the phase to cartesian coordinates.

Returns:

np.ndarray: The cartesian coordinates of the phase (x, y).

property angle: float#

The angle of the pendulum.

property displacement: float#

The displacement of the spring.

property angle_momentum: float#

The angular momentum of the pendulum.

property displacement_momentum: float#

The displacement momentum of the spring.

static get_value(value)[source]#

Returns the value of the given object.

If the given object is a Phase object, then the array containing the values of the phase is returned. Otherwise, the given object is returned as is.