TimeDependentLinearPDE#
- class cuqi.pde.TimeDependentLinearPDE(PDE_form, time_steps, time_obs='final', method='forward_euler', **kwargs)#
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(parameter, t) where parameter is the Bayesian parameter 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 bylinalg_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.
kwargs – See
LinearPDE
for the remaining keyword arguments
Example
See demos/demo34_TimeDependentLinearPDE.py for 1D heat and 1D wave equations.
- __init__(PDE_form, time_steps, time_obs='final', method='forward_euler', **kwargs)#
Methods
__init__
(PDE_form, time_steps[, time_obs, ...])assemble
(parameter)Assemble PDE
Assemble time step at time t
observe
(solution)solve
()Solve PDE by time-stepping
Attributes