- class pymor.models.symplectic.BaseQuadraticHamiltonianModel(T, initial_data, J, H_op, h=None, time_stepper=None, nt=None, num_values=None, output_functional=None, visualizer=None, name=None)[source]¶
Base class of quadratic Hamiltonian systems.
To formulate a quadratic Hamiltonian system it is advised to use a
QuadraticHamiltonianModelwhich works with a
phase_spaceto be compatible with the current implementation of the symplectic basis generation techniques.
Evaluate a quadratic Hamiltonian function.
- class pymor.models.symplectic.QuadraticHamiltonianModel(T, initial_data, H_op, h=None, time_stepper=None, nt=None, num_values=None, output_functional=None, visualizer=None, name=None)[source]¶
Generic class for quadratic Hamiltonian systems.
This class describes Hamiltonian systems given by the equations:
∂_t u(t, μ) = J * H_op(t, μ) * u(t, μ) + J * h(t, μ) u(0, μ) = u_0(μ)
for t in [0,T], where H_op is a linear time-dependent
Operator, J is a canonical Poisson matrix, h is a (possibly) time-dependent vector-like
Operator, and u_0 the initial data. The right-hand side of the Hamiltonian equation is J times the gradient of the Hamiltonian
Ham(u, t, μ) = 1/2* u * H_op(t, μ) * u + u * h(t, μ).
phase_spaceis assumed to be a
BlockVectorSpace. If required, the arguments
initial_dataare casted to operate on a
BlockVectorSpace. With this construction, the solution u(t, μ) is based on a
BlockVectorSpacewhich is required for the current implementation of the symplectic basis generation techniques.
The final time T.
The initial data
u_0. Either a
VectorArrayof length 1 or (for the
Parameter-dependent case) a vector-like
Operator(i.e. a linear
source.dim == 1) which applied to
NumpyVectorArray(np.array())will yield the initial data for a given
The state-independet part of the Hamiltonian h.
time-stepperto be used by
solve. Alternatively, the parameter nt can be specified to use the
implicit midpoint rule.
If time_stepper is
Noneand nt is specified, the
implicit midpoint ruleas time_stepper.
The number of returned vectors of the solution trajectory. If
None, each intermediate vector that is calculated is returned.
Operatormapping a given solution to the model output. In many applications, this will be a
Functional, i.e. an
Operatormapping to scalars. This is not required, however.
A visualizer for the problem. This can be any object with a
visualize(U, m, ...)method. If
visualize(U, *args, **kwargs)method is added to the model which forwards its arguments to the visualizer’s
Name of the model.