pymordemos.heat

Module Contents

pymordemos.heat.fom_properties(fom, w, stable_lti=True)[source]

Show properties of the full-order model.

Parameters

fom

The full-order Model from iosys or a TransferFunction.

w

Array of frequencies.

stable_lti

Whether the FOM is stable (assuming it is an LTIModel).

pymordemos.heat.main(diameter: float = Argument(0.1, help='Diameter option for the domain discretizer.'), r: int = Argument(5, help='Order of the ROMs.'))[source]

2D heat equation demo.

Discretization of the PDE:

\[\begin{split}\begin{align*} \partial_t z(x, y, t) &= \Delta z(x, y, t), & 0 < x, y < 1,\ t > 0 \\ -\nabla z(0, y, t) \cdot n &= z(0, y, t) - u(t), & 0 < y < 1, t > 0 \\ -\nabla z(1, y, t) \cdot n &= z(1, y, t), & 0 < y < 1, t > 0 \\ -\nabla z(x, 0, t) \cdot n &= z(x, 0, t), & 0 < x < 1, t > 0 \\ -\nabla z(x, 1, t) \cdot n &= z(x, 1, t), & 0 < x < 1, t > 0 \\ z(x, y, 0) &= 0 & 0 < x, y < 1 \\ y(t) &= \int_0^1 z(1, y, t) dy, & t > 0 \end{align*}\end{split}\]

where \(u(t)\) is the input and \(y(t)\) is the output.

pymordemos.heat.run_mor_method(fom, w, reductor, reductor_short_name, r, stable=True, **reduce_kwargs)[source]

Run a model order reduction method.

Parameters

fom

The full-order Model from iosys or a TransferFunction.

w

Array of frequencies.

reductor

The reductor object.

reductor_short_name

A short name for the reductor.

r

The order of the reduced-order model.

stable

Whether the FOM is stable.

reduce_kwargs

Optional keyword arguments for the reduce method.