Flux calculation: Velocity gradient REVISED
The equation using Hubble velocity along the line of sight to do the integral:
τu0=πe2λ0mecf12∫nHI√πbexp[−(u−u0b)2]1Hdv, where dv=Hdr is the differential in Hubble velocity along the LOS
For the second form of the equation, using the gas velocity Hr+upec to do the integral, then
dr=|dudr|−1du=|1H+∇upec|duWhere
du=|Hdr+Δupec|is the differential of the gas velocity along the LOS. Note that an absolute value around du is needed to avoid negative values.
τu0=πe2λ0mecf12∫nHI√πbexp[−(u−u0b)2]|1H+∇upec|duNumerically the gradient and the difference are evaluated:
∇upec=ui+1pec−ui−1pec2dr Δupec=ui+1pec−ui−1pec2The comparison of the Flux from the two calculations is below.
The fractional differences in the Flux are ≲10−11!!!
Actually, the term
Hdr+ΔupecH+∇upec=Hdr+ΔupecH+Δupecdr=drH+ΔupecrH+Δupecdr=drWhich of course should hold from the Jacobian of the transformation. Then this becomes the original form of the equation just changing dr=H−1dv
The issue that I had before was that I was missing the term Δupec in du.