EquilibriumOrbitKS

Overview

class orbithunter.EquilibriumOrbitKS(state=None, basis=None, parameters=None, discretization=None, constraints=None, **kwargs)[source]

Class for temporal equilibria

Notes

For convenience, this subclass accepts any (even) value for the time discretization. Only a single time point is required however to fully represent the solution and therefore perform any computations. If the discretization size is greater than 1 then then different bases will have the following shapes: field (N, M). spatial modes = (N, m), spatiotemporal modes (1, m). In other words, discretizations of this type can still be used in the optimization codes but will be much more inefficient. The reason for this choice is because it is possible to start with a spatiotemporal orbit with no symmetry (i.e. OrbitKS) and still end up at an equilibrium solution. Therefore, I am accommodating transformations from other orbit types to EquilibriumOrbitKS. To make the computations more efficient all that is required is usage of the method self.optimize_for_calculations(), which converts N -> 1, making the shape of the state (1, M) in the physical field basis. Also can inherit more methods with this choice. More details are included in the thesis and in the documentation. While only the imaginary components of the spatial modes are non-zero, both real and imaginary components are kept to allow for odd order spatial derivatives, required for the nonlinear term. Other allowed operations such as rotation are preferably performed after converting to a different symmetry type such as AntisymmetricOrbitKS or OrbitKS.

Methods

Note

See also Orbit, OrbitKS, and AntisymmetricOrbitKS,

Initialization

EquilibriumOrbitKS.__init__([state, basis, …])

Initialize self.

EquilibriumOrbitKS.populate([attr])

Initialize random parameters or state or both.

EquilibriumOrbitKS._populate_state(**kwargs)

Initialize a set of random spatiotemporal Fourier modes

EquilibriumOrbitKS._populate_parameters(**kwargs)

Should only be accessed through Orbit.populate()

Special Methods

“Special” methods also known as “magic” or “dunder” (double underscore) methods account for most basic Math operations and other operations pertaining to NumPy arrays.

Note

See Orbit for all definitions.

Properties

EquilibriumOrbitKS.shape

Current state array’s shape

EquilibriumOrbitKS.size

Current state array’s dimensionality

EquilibriumOrbitKS.ndim

Current state array’s number of dimensions

Discretization and Dimensions

EquilibriumOrbitKS.shapes()

State array shapes in different bases.

EquilibriumOrbitKS.dimensions()

Tile dimensions.

EquilibriumOrbitKS.glue_dimensions(…[, …])

Strategy for combining tile dimensions in gluing; default is arithmetic averaging.

EquilibriumOrbitKS.dimension_based_discretization(…)

Orbithunter conventions for discretization size.

EquilibriumOrbitKS.plotting_dimensions()

Dimensions according to plot labels; used in clipping.

Math Functions

EquilibriumOrbitKS.orbit_vector()

Vector representation of Orbit instance; constants all variables required to define the Orbit instance.

EquilibriumOrbitKS.abs()

Orbit instance with absolute value of state.

EquilibriumOrbitKS.dot(other)

Return the L_2 inner product of two orbits

EquilibriumOrbitKS.norm([order])

Norm of spatiotemporal state via numpy.linalg.norm

EquilibriumOrbitKS.dx(**kwargs)

Spatial derivative of the current state.

EquilibriumOrbitKS.dt([order, array])

A time derivative of the current state.

EquilibriumOrbitKS.eqn(**kwargs)

Instance whose state is the Kuramoto-Sivashinsky equation evaluated at the current state

EquilibriumOrbitKS.matvec(other, **kwargs)

Matrix-vector product of a vector with the Jacobian of the current state.

EquilibriumOrbitKS.rmatvec(other, **kwargs)

Matrix-vector product with the adjoint of the Jacobian

EquilibriumOrbitKS.precondition(**kwargs)

Precondition a vector with the inverse (aboslute value) of linear spatial terms

EquilibriumOrbitKS.jacobian(**kwargs)

Jacobian matrix evaluated at the current state.

Visualization

EquilibriumOrbitKS.plot([show, save, …])

Plot the velocity field as a 2-d density plot using matplotlib’s imshow

EquilibriumOrbitKS.mode_plot([show, save, scale])

Plot the spatiotemporal Fourier spectrum as a 2-d density plot using matplotlib’s imshow

State Transformations

EquilibriumOrbitKS.transform([to, array, …])

Transform current state to a different basis.

EquilibriumOrbitKS.resize(…)

Rediscretize the current state typically via zero padding or interpolation.

EquilibriumOrbitKS.reflection([axis, signed])

Reflect the velocity field about the spatial midpoint

EquilibriumOrbitKS.roll(shift[, axis])

Apply numpy roll along specified axis.

EquilibriumOrbitKS.cell_shift(n_cell[, axis])

Rotate by fraction of the period in either axis; nearest discrete approximate is taken.

EquilibriumOrbitKS.rotate(distance[, axis, …])

Rotate the velocity field in either space or time.

EquilibriumOrbitKS.shift_reflection()

Return a OrbitKS with shift-reflected velocity field

EquilibriumOrbitKS.to_fundamental_domain([half])

Overwrite of parent method

EquilibriumOrbitKS.from_fundamental_domain([half])

Overwrite of parent method

EquilibriumOrbitKS._pad(size[, axis])

Overwrite of parent method

EquilibriumOrbitKS._truncate(size[, axis])

Overwrite of parent method

Static

EquilibriumOrbitKS.bases_labels()

Labels of the different bases produced by transforms.

EquilibriumOrbitKS.minimal_shape()

The smallest possible compatible discretization

EquilibriumOrbitKS.minimal_shape_increments()

The smallest valid increment to change the discretization by.

EquilibriumOrbitKS.discretization_labels()

Strings to use to label dimensions/periods

EquilibriumOrbitKS.parameter_labels()

Labels of all parameters

EquilibriumOrbitKS.dimension_labels()

Strings to use to label dimensions/periods.

EquilibriumOrbitKS.periodic_dimensions()

Bools indicating whether or not dimension is periodic.

EquilibriumOrbitKS.positive_indexing()

Indicates whether numpy indexing corresponds to increasing or decreasing values configuration space variable

Other

EquilibriumOrbitKS.copy()

Return an instance with copies of copy-able attributes.

EquilibriumOrbitKS.mask(masking_array[, invert])

Return an Orbit instance with a numpy masked array state

EquilibriumOrbitKS.constrain(*labels)

Set self constraints based on labels provided.

EquilibriumOrbitKS.preprocess()

Check whether the orbit converged to an equilibrium or close-to-zero solution

Defaults

EquilibriumOrbitKS.defaults()

Dict of default values for constraints, parameter ranges, sizes, etc.

EquilibriumOrbitKS._default_shape()

The shape of a generic state, see core.py for details

EquilibriumOrbitKS._default_parameter_ranges()

Default parameter ranges.

EquilibriumOrbitKS._default_constraints()

Defaults for whether or not parameters are constrained.

Reading and Writing Data

EquilibriumOrbitKS.filename([extension, …])

Method for convenience and consistent/conventional file naming.

EquilibriumOrbitKS.to_h5([filename, …])

Export current state information to HDF5 file.