UnderwaterAcoustics.jl
UnderwaterAcoustics.jl copied to clipboard
Derivatives of eigenray propagation time w.r.t. Rx/Tx position
Differentiable propagation modeling looks really interesting. I've previously use crude finite differencing on the output of Bellhop as a proof-of-concept, while recommending investigating the use of automatic differentiation.
I came across RaySolver and decided to try it. A particular case I'm interested in are derivatives of the propagation time along an eigenray w.r.t. Rx/Tx positions. The simplest case is the derrivative w.r.t range.
The attached code appears to sucessfully calculate the derivatives using finite differences (the results are at least a plausible magnitude). However, my attempt to calculate the derivative with ForwardDiff was unsucessful, with the code returning derivatives of zero. Am I doing something wrong?
The code is also very slow to run the first time. I was aware Julia had a compliation latency, but this was much more than I expected. I'm a Julia novice, but it looks like something odd is happening with memory allocation. Any Ideas?
julia> @time include("munk_single_range_ex1.jl")
1359.126200 seconds (5.80 G allocations: 513.957 GiB, 8.40% gc time)
julia> @time include("munk_single_range_ex1.jl")
0.280822 seconds (830.31 k allocations: 55.448 MiB)
FWIW. I'm using an Intel Core i7 5820K @ 3.30GHz with 32GiB of RAM and an SSD drive running WIndows 10.