- #1
integrator
- 2
- 0
Hello!
I am working on atmospheric scattering and therefore I have to calculate the optical depth along a given path through the atmosphere.
The integral I have to solve is this one:
[tex]\int_{P_a}^{P_b} f ds \quad with \quad f:R\rightarrow R, h\rightarrow e^{(-h/H_0)}[/tex]
[tex]P_a[/tex] und [tex]P_b[/tex] are Points in [tex]R^3[/tex] and I have to solve the integral along the path from [tex]P_a[/tex] to [tex]P_b[/tex]. [tex]H_0[/tex] is just a constant and h is the height of a point between the line from [tex]P_a[/tex] to [tex]P_b[/tex] .
So obviously this is a line integral (at least I hope so), which can be solved this way:
[tex]\int_{P_a}^{P_b} f ds \quad = \quad \int_{a}^{b} f(r(t)) * |r'(t)| dt [/tex]
r is the parameterization of the path, so my r is:
r: [a,b] [tex]\rightarrow R^3[/tex].
r(t) (t is in [a,b]) gives me a point on the path from [tex]P_a[/tex] to [tex]P_b[/tex], with r(a) = [tex]P_a[/tex] and r(b) = [tex]P_b[/tex].
Now I have the problem that the result of r doesn't fit to the input of f, because f needs a height and not a point in [tex]R^3[/tex] .
Therefore I slightly change f (and now call it f2):
[tex]f2:R^3 \rightarrow R, P \rightarrow e^{(-HeightOf(P)/H_0)}[/tex]
f2 expects a point in [tex]R^3[/tex] and calculates the height of the point P itself.
Now I just need the parameterization r of the path. Two solutions came into my mind:
1) [tex] r: [0,1] \rightarrow R^3, t \rightarrow P_a + t * (P_b - P_a) \quad with \quad r'(t) = LengthFromPaToPb = Length
[/tex]
2) [tex] r: [0, N] \rightarrow R^3, t \rightarrow P_a + t * (P_b - P_a) / N \quad with \quad r'(t) = LengthFromPaToPb / N = sampleLength [/tex]
If I pick parameterization 1) I end with this formula:
[tex]\int_{P_a}^{P_b} f ds \quad = \quad \int_{0}^{1} f2(r(t)) * |r'(t)| dt \quad = \quad \int_{0}^{1} f2(r(t)) * Length dt \quad = \quad Length * \int_{0}^{1} f2(r(t)) dt[/tex]
I numerically solve this integral with the trapezium rule.
My problem is, that the solutions I get with the trapezium rule are really big (up to 14000). Maybe its because the length of my paths between Pa and Pb are long (about 80000meters) and thus my Length is also very big.
I can't believe that values around 14000 are right (I have read in a paper, that the optical depth at the horizon is about 6).
So I am asking you: did I make something wrong?
Thanks for your help!
I am working on atmospheric scattering and therefore I have to calculate the optical depth along a given path through the atmosphere.
The integral I have to solve is this one:
[tex]\int_{P_a}^{P_b} f ds \quad with \quad f:R\rightarrow R, h\rightarrow e^{(-h/H_0)}[/tex]
[tex]P_a[/tex] und [tex]P_b[/tex] are Points in [tex]R^3[/tex] and I have to solve the integral along the path from [tex]P_a[/tex] to [tex]P_b[/tex]. [tex]H_0[/tex] is just a constant and h is the height of a point between the line from [tex]P_a[/tex] to [tex]P_b[/tex] .
So obviously this is a line integral (at least I hope so), which can be solved this way:
[tex]\int_{P_a}^{P_b} f ds \quad = \quad \int_{a}^{b} f(r(t)) * |r'(t)| dt [/tex]
r is the parameterization of the path, so my r is:
r: [a,b] [tex]\rightarrow R^3[/tex].
r(t) (t is in [a,b]) gives me a point on the path from [tex]P_a[/tex] to [tex]P_b[/tex], with r(a) = [tex]P_a[/tex] and r(b) = [tex]P_b[/tex].
Now I have the problem that the result of r doesn't fit to the input of f, because f needs a height and not a point in [tex]R^3[/tex] .
Therefore I slightly change f (and now call it f2):
[tex]f2:R^3 \rightarrow R, P \rightarrow e^{(-HeightOf(P)/H_0)}[/tex]
f2 expects a point in [tex]R^3[/tex] and calculates the height of the point P itself.
Now I just need the parameterization r of the path. Two solutions came into my mind:
1) [tex] r: [0,1] \rightarrow R^3, t \rightarrow P_a + t * (P_b - P_a) \quad with \quad r'(t) = LengthFromPaToPb = Length
[/tex]
2) [tex] r: [0, N] \rightarrow R^3, t \rightarrow P_a + t * (P_b - P_a) / N \quad with \quad r'(t) = LengthFromPaToPb / N = sampleLength [/tex]
If I pick parameterization 1) I end with this formula:
[tex]\int_{P_a}^{P_b} f ds \quad = \quad \int_{0}^{1} f2(r(t)) * |r'(t)| dt \quad = \quad \int_{0}^{1} f2(r(t)) * Length dt \quad = \quad Length * \int_{0}^{1} f2(r(t)) dt[/tex]
I numerically solve this integral with the trapezium rule.
My problem is, that the solutions I get with the trapezium rule are really big (up to 14000). Maybe its because the length of my paths between Pa and Pb are long (about 80000meters) and thus my Length is also very big.
I can't believe that values around 14000 are right (I have read in a paper, that the optical depth at the horizon is about 6).
So I am asking you: did I make something wrong?
Thanks for your help!