1
$\begingroup$

I do have a Diffusion coefficient in a convection diffusion PDE which is discontinuous and looks like (concentration on the x-Axis): enter image description here

For numerical reasons i use the integrated form: enter image description here

I calculate the functions in beforehand and during my calculations i interpolate the diffusion coefficient depending on the actual concentration value on each grid point. Note that the function is discontinuous at x = 0.1 and x = 0.5

If i could fit an analytical function to the data i could avoid the interpolation at each time step and may speed up the calculation. Is that possible and would it make sense ? Which function would make sense ? something like:

myfun = somefunction*((u>=0.1) && (u<=0.5)
$\endgroup$

1 Answer 1

1
$\begingroup$

If your data is available on a uniform grid, you are unlikely to accelerate your computations: all you currently have to do is a single division $i=\lfloor x/\Delta x \rfloor$ to find which interval you're in, and a linear interpolation between data point $i$ and $i+1$. Pretty much any function that is not a low-order polynomial will cost far more than these operations.

But if you insist, to fit a function to your data it would be helpful where it comes from. The curve looks like a Gaussian, but whether it really is of course depends on what exactly it models.

$\endgroup$
1
  • $\begingroup$ I agree that a Gaussian would be a nice fit, so you should try the error-function for the integral $\endgroup$
    – LKlevin
    Jul 7, 2014 at 10:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.