Thank you all. The latter looks very interesting but:
julia> f_Tf(x, ϑ, ω, ε, μ) = ϑ - ((1/ω) * log(x/ε)) - 1/μ
f_Tf (generic function with 1 method)
julia> ε, ω, ϑ, μ, τ = [epsilon, omega, Tp, nu, tmax]
5-element Array{Float64,1}:
1.0
0.05
2.392731385751533
0.72
4000.0
julia> x = 0.0:0.1:τ
0.0:0.1:4000.0
julia> y = f_Tf.(x, ϑ, ω, ε, μ)
40001-element Array{Float64,1}:
julia> df = t->ForwardDiff.derivative(f_Tf,t)
#19 (generic function with 1 method)
julia> d2f = t->ForwardDiff.derivative(df,t)
#21 (generic function with 1 method)
julia> rho(t) = (abs(1 + df(t)^2))^1.5 / abs(d2f(t)) # radius of curvature
rho (generic function with 1 method)
julia> drho = t->ForwardDiff.derivative(rho,t)
#23 (generic function with 1 method)
julia> fzero(drho, 500)
ERROR: MethodError: no method matching f_Tf(::ForwardDiff.Dual{ForwardDiff.Tag{typeof(f_Tf),ForwardDiff.Dual{ForwardDiff.Tag{typeof(rho),Float64},Float64,1}},ForwardDiff.Dual{ForwardDiff.Tag{typeof(rho),Float64},Float64,1},1})
Closest candidates are:
f_Tf(::Any, ::Any, ::Any, ::Any, ::Any) at none:1
Stacktrace:
[1] derivative at /home/gigiux/.julia/packages/ForwardDiff/sdToQ/src/derivative.jl:14 [inlined]
[2] (::var"#19#20")(::ForwardDiff.Dual{ForwardDiff.Tag{typeof(rho),Float64},Float64,1}) at ./none:1
[3] rho(::ForwardDiff.Dual{ForwardDiff.Tag{typeof(rho),Float64},Float64,1}) at ./none:1
[4] derivative at /home/gigiux/.julia/packages/ForwardDiff/sdToQ/src/derivative.jl:14 [inlined]
[5] (::var"#23#24")(::Float64) at ./none:1
[6] (::Roots.FnWrapper)(::Float64) at /home/gigiux/.julia/packages/Roots/Z5Mal/src/find_zero.jl:262
[7] (::Roots.DerivativeFree{Roots.FnWrapper})(::Float64) at /home/gigiux/.julia/packages/Roots/Z5Mal/src/find_zero.jl:263 (repeats 2 times)
[8] init_state(::Roots.Secant, ::Roots.DerivativeFree{Roots.DerivativeFree{Roots.FnWrapper}}, ::Tuple{Float64,Float64}) at /home/gigiux/.julia/packages/Roots/Z5Mal/src/derivative_free.jl:64
[9] init_state(::Roots.Secant, ::Roots.DerivativeFree{Roots.DerivativeFree{Roots.FnWrapper}}, ::Float64) at /home/gigiux/.julia/packages/Roots/Z5Mal/src/derivative_free.jl:59
[10] find_zero(::Roots.DerivativeFree{Roots.FnWrapper}, ::Float64, ::Roots.Secant, ::Roots.AlefeldPotraShi; tracks::Roots.NullTracks, verbose::Bool, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/gigiux/.julia/packages/Roots/Z5Mal/src/find_zero.jl:654
[11] #find_zero#33 at /home/gigiux/.julia/packages/Roots/Z5Mal/src/derivative_free.jl:123 [inlined]
[12] find_zero at /home/gigiux/.julia/packages/Roots/Z5Mal/src/derivative_free.jl:120 [inlined]
[13] derivative_free(::Function, ::Float64; order::Int64, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/gigiux/.julia/packages/Roots/Z5Mal/src/fzero.jl:155
[14] derivative_free(::Function, ::Float64) at /home/gigiux/.julia/packages/Roots/Z5Mal/src/fzero.jl:134
[15] #fzero#48 at /home/gigiux/.julia/packages/Roots/Z5Mal/src/fzero.jl:65 [inlined]
[16] fzero(::Function, ::Int64) at /home/gigiux/.julia/packages/Roots/Z5Mal/src/fzero.jl:63
[17] top-level scope at none:1
Why the error?
Is 500 based on my initial eye-ball assumption?
Is the definition of rho universal (based on the curvature radius) or is specific to the equation f_Tf?