2
$\begingroup$

I'm trying to solve the following integral numerically. $$H(y) = \int dx \, f(x) \, \delta(g(x,y)).$$ For this I chose a representation of the delta-function and employ convergence with respect to $\eta$ $$\sum_\limits{x_i} \, f(x_i) \, \frac{\eta}{g(x_i,y)^2+\eta^2}. $$

I calculate this for every $y$ such that I can plot $H(y)$ in the end. The problem is, that I would expect for $\eta \rightarrow 0$ the best results, but there seems to be a line (approx. $\eta=10^{-4}$) upon which I get a bunch of delta-like peaks in $H(y)$ instead of a smooth curve (for e.g. $\eta=10^{-2}$) which I want and would expect.

$\endgroup$
9
  • 2
    $\begingroup$ What about finding the zeroes of $g(x,y)$ rather? $\endgroup$ – Joce Nov 18 '16 at 15:14
  • $\begingroup$ If its only 1D or 2D, I think I have seen a good algorithm at chebfun.org. For higher dimensional problems, root finding is of course a problem. $\endgroup$ – Bort Nov 18 '16 at 15:24
  • $\begingroup$ Finding the zero's of g(x,y) requires to do this for every y. One problem is also that you would have to interpolate g, because the x-dependence is known only numerically. Sounds really complicated procedure to me and I have now idea about stability of this? $\endgroup$ – J. Goe Nov 18 '16 at 15:30
  • 3
    $\begingroup$ This approach would require the quadrature method to resolve large changes in function magnitude on length scale of $\eta$, so it's quite reasonable that it fails to do it well when $\eta$ is small. Finding the zeros of $g$ seems like a better approach. $\endgroup$ – Kirill Nov 18 '16 at 16:50
  • 1
    $\begingroup$ I think Joce's proposition is the proper one as well. I believe approximating a Dirac functional cannot be very robust. What do you mean by "x-dependence is known only numerically"? I would assume this means that for each y you have a list of g-values corresponding to some predetermined set of x-values? $\endgroup$ – knl Nov 19 '16 at 11:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.