Open timholy opened 12 months ago
can you try with ForwardDiffOverMeasurements.jl? (adds ForwardDiff overloads to measurements)
With that example, I still get
julia> ForwardDiff.derivative(ϕ, 0.0)
ERROR: StackOverflowError:
Stacktrace:
[1] measurement(val::ForwardDiff.Dual{…}, err::ForwardDiff.Dual{…}) (repeats 79984 times)
@ Measurements ~/.julia/packages/Measurements/hcRfF/src/Measurements.jl:93
Some type information was truncated. Use `show(err)` to see complete types.
This is with Measurements 2.10.0, ForwardDiff 0.10.36, and ForwardDiffOverMeasurements 0.1.0. Might the difference from the examples you show is that the variable I'm differentiating is a mapping Float64 -> Measurement{Float64}
rather than a Measurement{Float64} -> Measurement{Float64}
?
A method measurement(val, err::Dual{T, V})::Dual{T, Measurement{T}}
is needed.
I'd like to compute up to third-order derivatives with respect to a scalar (non-measurement) of a measurement-valued function. Something along the lines of this demo:
I've tried ForwardDiff (I saw #100):
and TaylorDiff:
and TaylorSeries:
I haven't yet tried Diffractor (the docs are not fully fleshed out).