TimeDependentLinearPDE#

class cuqi.pde.TimeDependentLinearPDE(PDE_form, time_steps, time_obs='final', method='forward_euler', observation_map=None, **kwargs)[source]#

Time Dependent Linear PDE with fixed time stepping using Euler method (backward or forward).

Parameters:
  • PDE_form (callable function) – Callable function with signature PDE_form(parameter1, parameter2, …, t) where parameter1, parameter2, etc. are the Bayesian unknown parameters (the user can choose any names for these parameters, e.g. a, b, etc.) and t is the time at which the PDE form is evaluated. The function returns a tuple of (differential_operator, source_term, initial_condition) where differential_operator is the linear operator at time t, source_term is the source term at time t, and initial_condition is the initial condition. The types of differential_operator and source_term are determined by what the method linalg_solve() accepts as linear operator and right-hand side, respectively. The type of initial_condition should be the same type as the solution returned by linalg_solve().

  • time_steps (ndarray) – An array of the discretized times corresponding to the time steps that starts with the initial time and ends with the final time

  • time_obs (array_like or str) – If passed as an array_like, it is an array of the times at which the solution is observed. If passed as a string it can be set to final to observe at the final time step, or all to observe at all time steps. Default is final.

  • method (str) – Time stepping method. Currently two options are available forward_euler and backward_euler.

  • observation_map (a function handle) – A function that takes the PDE solution, interpolated on grid_obs and time_obs, as input and returns the observed solution. e.g. observation_map=lambda u, grid_obs, time_obs: u**2.

  • kwargs – See LinearPDE for the remaining keyword arguments

Example

See demos/howtos/TimeDependentLinearPDE.py for 1D heat and 1D wave equations examples. It demonstrates setting up TimeDependentLinearPDE objects, including the choice of time stepping methods, observation domain, and observation map.

__init__(PDE_form, time_steps, time_obs='final', method='forward_euler', observation_map=None, **kwargs)[source]#

Methods

__init__(PDE_form, time_steps[, time_obs, ...])

assemble(*args, **kwargs)

Assemble PDE

assemble_step(t)

Assemble time step at time t

interpolate_on_observed_domain(solution)

Interpolate solution on observed time and space points.

observe(solution)

Apply observation operator to the solution.

solve()

Solve PDE by time-stepping

Attributes