Hi there,
I have a very simple ODE problem defined by:
f_norm(x, α) = x - α*(1 - exp(-x))
f_norm_prime(x, α) = 1 - α*exp(-x)
f_norm_dprime(x, α) = α*exp(-x)
function dxdN!(dx, x, α, N)
f = f_norm(x, α)
fx = f_norm_prime(x, α)
fxx = f_norm_dprime(x, α)
dx = 3*(2*f - x*fx)/(x*fxx - fx)
end
using DifferentialEquations
prob = ODEProblem(dxdN!, x0, Nspan, α)
Up until here everything seems to work fine and the ODE initial value problem seems to be accepted and well understood by the DifferentialEquations.jl package. However, when I run:
sol =solve(prob)
I get the following error:
ERROR: MethodError: no method matching similar(::Float64, ::Type{Float64})
Closest candidates are:
similar(::Union{LinearAlgebra.Adjoint{T, var"#s832"}, LinearAlgebra.Transpose{T, var"#s832"}} where {T, var"#s832"<:(AbstractVector{T} where T)}, ::Type{T}) where T at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/adjtrans.jl:230
similar(::Union{LinearAlgebra.Adjoint{T, S}, LinearAlgebra.Transpose{T, S}} where {T, S}, ::Type{T}) where T at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/adjtrans.jl:234
similar(::Union{LinearAlgebra.Adjoint{T, S}, LinearAlgebra.Transpose{T, S}} where {T, S}, ::Type{T}, ::Tuple{Vararg{Int64, N}}) where {T, N} at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/LinearAlgebra/src/adjtrans.jl:235
What happens? I guess it must be something very silly of me and I thank you in advance.