Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RaySolver does not support propagating MonteCarloMeasurement uncertainty #11

Open
harivnkochi opened this issue May 28, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@harivnkochi
Copy link

harivnkochi commented May 28, 2023

Minimum Working example where transmit depth, sound speed profile and surface loss are StaticParticles variables. But even if just one of them is a StaticParticles variable, I still get the same error.

using AcousticRayTracers, UnderwaterAcoustics, MonteCarloMeasurements
numparticles = 5
tx_depth = 15.75
tx_depth = tx_depth .+ .1StaticParticles(Float32, numparticles)

basefolder = "D:/code_repo/arctic-melt/research/field-analysis"

SSP = [1500.0, 1490.0, 1520.0]
SSP = SSP .+ 5StaticParticles(eltype(SSP), numparticles)
depth_ssp = 0.0:20.0:40.0|>collect

env = UnderwaterEnvironment(
    seasurface = SurfaceLoss(2.6 .+ .1StaticParticles(Float32, numparticles)),
    seabed = SandyClay,
    ssp = SampledSSP(depth_ssp[:], SSP[:], :linear),
    bathymetry = ConstantDepth(200)
)
pm = RaySolver(env; nbeams = Int(5e1), minangle = -10π/180, maxangle=10π/180,ds = 0.02,atol = 1e-5, athreshold = 1e-5, solvertol=1e-10)#, solver=Rodas5()  
tx = AcousticSource(0.0, -tx_depth, 2000.)

rx_all = AcousticReceiver(100, -5) 
vals = arrivals(pm, tx, rx_all)  

The error message is too large to produce, but the main part of the error seems to be the following:

nested task error: MethodError: no method matching nextfloat(::StaticParticles{Float64, 5})
    Closest candidates are:
      nextfloat(::Union{Float16, Float32, Float64}, ::Integer) at float.jl:685
      nextfloat(::Unitful.AbstractQuantity{T}) where T<:AbstractFloat at D:\Julia 1.5.0\.julia\packages\Unitful\orvol\src\quantities.jl:473
      nextfloat(::ForwardDiff.Dual{T, V, N}) where {T, V, N} at D:\Julia 1.5.0\.julia\packages\ForwardDiff\vXysl\src\dual.jl:309
      ...
@mchitre mchitre self-assigned this Jun 1, 2023
@mchitre mchitre added the enhancement New feature or request label Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants