Error propagation of a variable for an integral

Click For Summary

Discussion Overview

The discussion revolves around the error propagation of a variable in a numerical integral that depends on two parameters, \(a \pm \delta a\) and \(b \pm \delta b\). Participants explore how to calculate the integral and its uncertainties, given that there is no analytical solution available. The conversation includes technical aspects of numerical integration and uncertainty quantification.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant presents the integral and the values obtained from varying parameters \(a\) and \(b\), seeking to determine \(c\) and \(\delta c\).
  • Another participant suggests that uncertainties in \(a\) and \(b\) lead to a formula for the uncertainty in the integral, involving partial derivatives evaluated at \(a\) and \(b\).
  • A participant reiterates the form of the integral, emphasizing the constants involved.
  • Some participants propose calculating the integral at the extremes of \(a\) and \(b\) and using these deviations to approximate the uncertainties in quadrature.
  • There is a request for clarification on the mathematical formulation of the uncertainty propagation.
  • A participant provides a Python code snippet using libraries for numerical integration and uncertainty handling, indicating that it successfully computes the desired results.
  • Further clarification is sought on the mathematical expressions for approximating the partial derivatives related to the uncertainties.

Areas of Agreement / Disagreement

Participants express various methods for handling uncertainty propagation, but there is no consensus on a single approach. Some methods involve numerical evaluations and approximations, while others suggest different mathematical formulations. The discussion remains unresolved regarding the best method to apply.

Contextual Notes

Participants note the absence of analytical solutions for the integral, which limits the methods available for error propagation. There are also assumptions made about the independence of parameters \(a\) and \(b\) that may affect the results.

Arman777
Insights Author
Gold Member
Messages
2,163
Reaction score
191
I have an integral that depends on two parameters ##a\pm\delta a## and ##b\pm \delta b##. I am doing this integral numerically and no python function can calculate the integral with uncertainties.

So I have calculated the integral for each min, max values of a and b.
As a result I have obtained 4 values, such that;

$$(a + \delta a, b + \delta b) = 13827.450210 \pm 0.000015~~(1)$$
$$(a + \delta a, b - \delta b) = 13827.354688 \pm 0.000015~~(2)$$
$$(a - \delta a, b + \delta b) = 13912.521548 \pm 0.000010~~(3)$$
$$(a - \delta a, b - \delta b) = 13912.425467 \pm 0.000010~~(4)$$

So it is clear that ##(2)## gives the min and ##(3)## gives the max. Let us show the result of the integral as ##c \pm \delta c##. So my problem is what is ##c## and ##\delta c## here?

The integral is something like this

$$I(a,b,x) =C\int_0^b \frac{dx}{\sqrt{a(1+x)^3 + \eta(1+x)^4 + (\gamma^2 - a - \eta)}}$$

where ##\eta## and ##\gamma## are constant.

Note: You guys can also generalize it by taking ##\eta \pm \delta \eta## but it is not necessary for now.

I have to take derivatives or integrals numerically. There's no known analytical solution for the integral.

##\eta = 4.177 \times 10^{-5}##, ##a = 0.1430 \pm 0.0011##, ##b = 1089.92 \pm 0.25##, ##\gamma = 0.6736 \pm 0.0054##, ##C = 2997.92458##
 
Last edited:
Physics news on Phys.org
Generally, if your intergal is I(a,b) = \int_{x_0}^{x_1} F(a,b,x)\,dx, then uncertainties in a and b would lead to I(a,b)<br /> \pm\frac{\partial I}{\partial a}\delta a \pm \frac{\partial I}{\partial b}\delta b with the partial derivatives evaluated at a and b. You can evaluate these derivatives by differentiating under the integral:
<br /> \frac{\partial I}{\partial a} = \int_{x_0}^{x_1} \frac{\partial F}{\partial a}(a, b, x)\,dx etc.
 
  • Like
Likes   Reactions: Arman777
The integral is something like this

$$I(a,b,x) =\int_0^b \frac{dx}{\sqrt{a(1+x)^3 + \eta(1+x)^4 + (\gamma^2 - a - \eta)}}$$

where ##\eta## and ##\gamma## are constant.
 
Assuming a and b are uncorrelated: Calculate the integral at (a,b+delta_b), (a,b-delta_b) and analogous for delta_a. Then use the deviations as approximation for ##\frac{\partial I}{\partial b}\delta b## and add both uncertainties in quadrature.
 
mfb said:
Assuming a and b are uncorrelated: Calculate the integral at (a,b+delta_b), (a,b-delta_b) and analogous for delta_a. Then use the deviations as approximation for ##\frac{\partial I}{\partial b}\delta b## and add both uncertainties in quadrature.
I did not quite understand it..Can you maybe put it in a more mathematical way
 
Code:
  from numpy import sqrt
    from scipy import integrate
    import uncertainties as u
    from uncertainties.umath import *

    #Important Parameters
    C = 2997.92458  # speed of light in [km/s]
    eta = 4.177 * 10**(-5)
    a = u.ufloat(0.1430, 0.0011)
    b = u.ufloat(1089.92, 0.25)
    gama = u.ufloat(0.6736, 0.0054)

    @u.wrap
    def D_zrec_finder(gama, a, b):
        def D_zrec(z):
            return C / sqrt(a * (1+z)**3 + eta * (1+z)**4 + (gama**2 - a - eta))
        result, error = integrate.quad(D_zrec, 0, b)
        return result    print((D_zrec_finder(gama, a, b)).n)
    print((D_zrec_finder(gama, a, b)).s)

This works
 
Arman777 said:
I did not quite understand it..Can you maybe put it in a more mathematical way
$$\frac{\partial I}{\partial b}\delta b \approx \frac 1 2 (I(a,b+\delta b)-I(a,b-\delta b))$$
$$\frac{\partial I}{\partial a}\delta a \approx \frac 1 2 (I(a+\delta a,b)-I(a-\delta a,b))$$

As b is your integration border you can simplify this one: ##\frac{\partial I}{\partial b}## is simply the function value at x=b.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 20 ·
Replies
20
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K