Return a constant D function.
Given \(D_0\), returns the function D:\[D(\theta) = D_0\]
D0 (float) – \(D_0\), a positive constant
Function to evaluate \(D\) and its derivatives:
D(theta)evaluates and returns \(D\) at
D(theta, 1)returns both the value of \(D\) and its first derivative at
D(theta, 2)returns the value of \(D\), its first derivative, and its second derivative at
In all cases, the argument
thetamay be a single float or a NumPy array.
- Return type
This function is not particularly useful: a constant D will turn a diffusion problem into a linear one, which has an exact solution and no numerical solvers are necessary. However, it is provided here given that it is the simplest supported function.