Heat Conduction Model
- class Heat(central_param: ndarray = array([1.5, 1.5, 0.5]), param_limits: ndarray = array([[1., 2.], [1., 2.], [0., 1.]]), name: str | None = None, **kwargs)[source]
Bases:
JaxModel
A two-dimensional anisotropic heat conduction equation model on a square domain with four dirichlet boundaries.
The model is defined by the following partial differential equation on the square spacial domain \(\Omega = [0, 1]^2\) on the time interval \([0, 0.1]\):
\[\frac{\partial u}{\partial t} = \nabla \cdot \left( \kappa \nabla u \right)\]subject to
\[u(x, y, t=0) = 0\]and
\[u(0, y, t) = 1, \quad u(1, y, t) = 0, \quad u(x, 0, t) = 1, \quad u(x, 1, t) = 0\]with the symmetric positive definite thermal conductivity matrix \(\kappa\) and the temperature \(u\). Inference is performed on the entries of \(\kappa\): param[0] = \(\kappa_{11}\), param[1] = \(\kappa_{22}\), param[2] = \(\kappa_{12}\).
- classmethod forward(param: ndarray) ndarray [source]
Forward method for the heat model.
Yields the solution of the anisotropic heat conduction equation at time \(t=0.1\) in five spatial points, which are arranged similar to the number “five” on a dice.
- Parameters:
param (np.ndarray) – Entries of the conductivity matrix: param[0] = \(\kappa_{11}\), param[1] = \(\kappa_{22}\), param[2] = \(\kappa_{12}\)
- Returns:
The solution of the anisotropic heat conduction equation at time \(t=0.1\)
- Return type:
np.ndarray
in five spacial points, which are arranged similar to the number “five” on a dice.
- param_is_within_domain(param: ndarray) bool [source]
Checks whether a parameter is within the parameter domain of the model. This condition stems from thermodynamical considerations.
- Parameters:
param (np.ndarray) – The parameter to check.
- Returns:
True if the parameter is within the limits.
- Return type:
bool
- classmethod perform_simulation(kappa: ndarray) ndarray [source]
Performs a simulation of the heat equation with the given parameters.
- Parameters:
kappa (np.ndarray) – Entries of the conductivity matrix: kappa[0] = \(\kappa_{11}\), kappa[1] = \(\kappa_{22}\), kapp[2] = \(\kappa_{12}\)
- Returns:
An array containing the solution of the anisotropic heat conduction equation, where the first two indices correspond to the x and y coordinates, respectively. The time is fixed to the class variable t_end.
- Return type:
np.ndarray
- CENTRAL_PARAM = array([1.5, 1.5, 0.5])
- PARAM_LIMITS = array([[1., 2.], [1., 2.], [0., 1.]])
- data_dim: int | None = 5
The values of the heat equation solution at five points are observed. See evaluation_points.
- evaluation_points = Array([[0.25, 0.25], [0.75, 0.25], [0.5 , 0.5 ], [0.25, 0.75], [0.75, 0.75]], dtype=float64)
- num_grid_points = 20
Number of grid points in each spatial direction
- param_dim: int | None = 3
Number of independent heat conductivity parameters
- plate_length = Array([1., 1.], dtype=float64)
Length of the square plate
- t_end = 0.1
End time of the simulation
- class HeatArtificial(central_param: ndarray = array([1.5, 1.5, 0.5]), param_limits: ndarray = array([[1., 2.], [1., 2.], [0., 1.]]), name: str | None = None, **kwargs)[source]
Bases:
Heat
,ArtificialModelInterface
- generate_artificial_params(num_samples: int, independent_params: bool = True) ndarray [source]
Generates a set of viable parameter samples for the heat model.
- Parameters:
num_samples (int) – Number of samples to generate.
independent_params (bool, optional) – Whether the parameters should be independent. Defaults to True.
- Returns:
A set of viable parameter samples.
- Return type:
np.ndarray
- CENTRAL_PARAM = array([1.5, 1.5, 0.5])
- PARAM_LIMITS = array([[1., 2.], [1., 2.], [0., 1.]])
- num_grid_points = 20
Number of grid points in each spatial direction
- heat_rhs(t: float, u: Array, args: tuple | list) Array [source]
Right hand side of the heat equation.
- Parameters:
t (float) – time at which the right hand side is evaluated
u (jnp.ndarray) – current solution of the heat equation
args (tuple | list) – tuple of the form (dx, dy, param) with dx, dy the spatial discretization and param the thermal conductivity matrix, given as a vector of length 3 with param[0] = kappa_11, param[1] = kappa_22, param[2] = kappa_12
- Returns:
right hand side of the heat equation
- Return type:
jnp.ndarray