pymor.models.examples

Module Contents

pymor.models.examples.heat_equation_1d_example(diameter=0.01, nt=100)[source]

Return parametric 1D heat equation example with one output.

Parameters:
  • diameter – Diameter option for the domain discretizer.

  • nt – Number of time steps.

Returns:

fom – Heat equation problem as an InstationaryModel.

pymor.models.examples.heat_equation_example(grid_intervals=50, nt=50)[source]

Return heat equation example with a high-conductivity and two parametrized channels.

Parameters:
  • grid_intervals – Number of intervals in each direction of the two-dimensional RectDomain.

  • nt – Number of time steps.

Returns:

fom – Heat equation problem as an InstationaryModel.

pymor.models.examples.heat_equation_non_parametric_example(diameter=0.1, nt=100)[source]

Return non-parametric heat equation example with one output.

Parameters:
  • diameter – Diameter option for the domain discretizer.

  • nt – Number of time steps.

Returns:

fom – Heat equation problem as an InstationaryModel.

pymor.models.examples.msd_example(n=6, m=2, m_i=4, k_i=4, c_i=1, as_lti=False)[source]

Mass-spring-damper model as (port-Hamiltonian) linear time-invariant system.

Taken from [GPBvdS12].

Parameters:
  • n – The order of the model.

  • m – The number or inputs and outputs of the model.

  • m_i – The weight of the masses.

  • k_i – The stiffness of the springs.

  • c_i – The amount of damping.

  • as_lti – If True, the matrices of the standard linear time-invariant system are returned. Otherwise, the matrices of the port-Hamiltonian linear time-invariant system are returned.

Returns:

fom – Mass-spring-damper model as an LTIModel (if as_lti is True) or PHLTIModel (if as_lti is False).

pymor.models.examples.penzl_example()[source]

Return Penzl’s example.

Returns:

fom – Penzl’s FOM example as an LTIModel.

pymor.models.examples.penzl_mimo_example(n, m=2, p=3)[source]

Return modified multiple-input multiple-output Penzl’s example.

Parameters:

n – Model order.

Returns:

fom – Penzl’s FOM example as an LTIModel.

pymor.models.examples.stokes_2Dexample(mesh_resolution=4, rhs=None)[source]

Return a discretization of a parametric, stationary Stokes equation on the unit disk.

Discretizes the following Stokes equation

\[\begin{split}- \mu \Delta u(x, \mu) + \nabla p(x, \mu) & = f(x) \text{ in } \Omega \\ \nabla \cdot u(x, \mu) & = 0 \text{ in } \Omega\end{split}\]

with homogeneous Dirichlet boundary conditions, where \(\mu\) is the dynamic viscosity and \(\Omega\) is the unit disk. To eliminate the singularity of the saddle-point system, one pressure node is set to zero.

Parameters:
  • mesh_resolution – The number of mesh refinements performed by the scikit-fem discretizer on the unit disk.

  • rhs – The Function f. rhs.dim_domain has to be 2, whereas rhs.shape_range has to be (2,). If None, a default right-hand side is chosen.

Returns:

fom – Discretized Stokes equation as a SaddlePointModel.

pymor.models.examples.thermal_block_example(diameter=1 / 100)[source]

Return 2x2 thermal block example.

Parameters:

diameter – Grid element diameter.

Returns:

fom – Thermal block problem as a StationaryModel.

pymor.models.examples.transfer_function_delay_example(tau=1, a=-0.1)[source]

Return transfer function of a 1D system with input delay.

Parameters:
  • tau – Time delay.

  • a – The matrix A in the 1D system as a scalar.

Returns:

tf – Delay model as a TransferFunction.