1

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)
Moritz
  • 343
  • 1
  • 13

1 Answers1

1

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.

Wolfgang Bangerth
  • 55,373
  • 59
  • 119
  • I agree that a Gaussian would be a nice fit, so you should try the error-function for the integral – LKlevin Jul 07 '14 at 10:16