sciml / odeinterfacediffeq.jl Goto Github PK
View Code? Open in Web Editor NEWAdds the common API onto ODEInterface classic Fortran methods for the SciML Scientific Machine Learning organization
License: Other
Adds the common API onto ODEInterface classic Fortran methods for the SciML Scientific Machine Learning organization
License: Other
Hi,
I am trying to change parameters in callback with integrator.p
and I encounter
type ODEInterfaceIntegrator has no field p
I keep getting the following error every time I tried to use radau() in my Mac. The code runs smoothly on Windows, but not on Mac (silicon)
ERROR: Cannot find method(s) for radau! I've tried to loadODESolvers(), but it didn't work. Please check ODEInterface.help_solversupport() and call loadODESolvers and check also this output. For further information see also ODEInterface.help_install.
Stacktrace:
[1] getAllMethodPtrs(dlname::String)
@ ODEInterface ~/.julia/packages/ODEInterface/RwRLn/src/DLSolvers.jl:245
[2] radau_impl(rhs::Function, t0::Float64, T::Float64, x0::Vector{…}, opt::ODEInterface.OptionsODE, args::ODEInterface.RadauArguments{…})
@ ODEInterface ~/.julia/packages/ODEInterface/RwRLn/src/Radau.jl:770
[3] radau(rhs::Function, t0::Float64, T::Float64, x0::Vector{Float64}, opt::ODEInterface.OptionsODE)
@ ODEInterface ~/.julia/packages/ODEInterface/RwRLn/src/Radau.jl:744
[4] __solve(prob::ODEProblem{…}, alg::radau{…}, timeseries::Vector{…}, ts::Vector{…}, ks::Vector{…}; saveat::Float64, verbose::Bool, save_everystep::Bool, save_on::Bool, save_start::Bool, timeseries_errors::Bool, dense_errors::Bool, callback::Nothing, alias_u0::Bool, kwargs::@Kwargs{…})
@ ODEInterfaceDiffEq ~/.julia/packages/ODEInterfaceDiffEq/EIV4j/src/solve.jl:144
[5] __solve (repeats 2 times)
@ ~/.julia/packages/ODEInterfaceDiffEq/EIV4j/src/solve.jl:1 [inlined]
[6] solve_call(_prob::ODEProblem{…}, args::radau{…}; merge_callbacks::Bool, kwargshandle::Nothing, kwargs::@Kwargs{…})
@ DiffEqBase ~/.julia/packages/DiffEqBase/eLhx9/src/solve.jl:609
[7] solve_call
@ DiffEqBase ~/.julia/packages/DiffEqBase/eLhx9/src/solve.jl:567 [inlined]
[8] #solve_up#42
@ DiffEqBase ~/.julia/packages/DiffEqBase/eLhx9/src/solve.jl:1058 [inlined]
[9] solve_up
@ DiffEqBase ~/.julia/packages/DiffEqBase/eLhx9/src/solve.jl:1044 [inlined]
[10] #solve#40
@ DiffEqBase ~/.julia/packages/DiffEqBase/eLhx9/src/solve.jl:981 [inlined]
[11] batch_func(i::Int64, prob::EnsembleProblem{…}, alg::radau{…}; kwargs::@Kwargs{…})
@ SciMLBase ~/.julia/packages/SciMLBase/slQep/src/ensemble/basic_ensemble_solve.jl:186
[12] batch_func
@ ~/.julia/packages/SciMLBase/slQep/src/ensemble/basic_ensemble_solve.jl:173 [inlined]
[13] #583
@ ~/.julia/packages/SciMLBase/slQep/src/ensemble/basic_ensemble_solve.jl:240 [inlined]
[14] responsible_map
@ ~/.julia/packages/SciMLBase/slQep/src/ensemble/basic_ensemble_solve.jl:233 [inlined]
[15] solve_batch(prob::EnsembleProblem{…}, alg::radau{…}, ::EnsembleSerial, II::UnitRange{…}, pmap_batch_size::Int64; kwargs::@Kwargs{…})
@ SciMLBase ~/.julia/packages/SciMLBase/slQep/src/ensemble/basic_ensemble_solve.jl:239
[16] solve_batch
@ ~/.julia/packages/SciMLBase/slQep/src/ensemble/basic_ensemble_solve.jl:238 [inlined]
[17] solve_batch(prob::EnsembleProblem{…}, alg::radau{…}, ensemblealg::EnsembleThreads, II::UnitRange{…}, pmap_batch_size::Int64; kwargs::@Kwargs{…})
@ SciMLBase ~/.julia/packages/SciMLBase/slQep/src/ensemble/basic_ensemble_solve.jl:249
[18] solve_batch
@ ~/.julia/packages/SciMLBase/slQep/src/ensemble/basic_ensemble_solve.jl:245 [inlined]
[19] macro expansion
@ ./timing.jl:395 [inlined]
[20] (::SciMLBase.var"#576#577"{Int64, Int64, Int64, @Kwargs{…}, EnsembleProblem{…}, radau{…}, EnsembleThreads})()
@ SciMLBase ~/.julia/packages/SciMLBase/slQep/src/ensemble/basic_ensemble_solve.jl:140
[21] with_logstate(f::Function, logstate::Any)
@ Base.CoreLogging ./logging.jl:515
[22] with_logger
@ ./logging.jl:627 [inlined]
[23] __solve(prob::EnsembleProblem{…}, alg::radau{…}, ensemblealg::EnsembleThreads; trajectories::Int64, batch_size::Int64, progress_aggregate::Bool, pmap_batch_size::Int64, kwargs::@Kwargs{…})
@ SciMLBase ~/.julia/packages/SciMLBase/slQep/src/ensemble/basic_ensemble_solve.jl:124
[24] #solve#44
@ DiffEqBase ~/.julia/packages/DiffEqBase/eLhx9/src/solve.jl:1074 [inlined]
[25] macro expansion
@ ./timing.jl:279 [inlined]
[26] top-level scope
caused by: AssertionError: (dlSolversInfo[dlname]).error === nothing
Stacktrace:
[1] getAllMethodPtrs(dlname::String)
@ ODEInterface ~/.julia/packages/ODEInterface/RwRLn/src/DLSolvers.jl:237
[2] radau_impl(rhs::Function, t0::Float64, T::Float64, x0::Vector{…}, opt::ODEInterface.OptionsODE, args::ODEInterface.RadauArguments{…})
@ ODEInterface ~/.julia/packages/ODEInterface/RwRLn/src/Radau.jl:770
[3] radau(rhs::Function, t0::Float64, T::Float64, x0::Vector{Float64}, opt::ODEInterface.OptionsODE)
@ ODEInterface ~/.julia/packages/ODEInterface/RwRLn/src/Radau.jl:744
[4] __solve(prob::ODEProblem{…}, alg::radau{…}, timeseries::Vector{…}, ts::Vector{…}, ks::Vector{…}; saveat::Float64, verbose::Bool, save_everystep::Bool, save_on::Bool, save_start::Bool, timeseries_errors::Bool, dense_errors::Bool, callback::Nothing, alias_u0::Bool, kwargs::@Kwargs{…})
@ ODEInterfaceDiffEq ~/.julia/packages/ODEInterfaceDiffEq/EIV4j/src/solve.jl:144
[5] __solve (repeats 2 times)
@ ~/.julia/packages/ODEInterfaceDiffEq/EIV4j/src/solve.jl:1 [inlined]
[6] solve_call(_prob::ODEProblem{…}, args::radau{…}; merge_callbacks::Bool, kwargshandle::Nothing, kwargs::@Kwargs{…})
@ DiffEqBase ~/.julia/packages/DiffEqBase/eLhx9/src/solve.jl:609
[7] solve_call
@ DiffEqBase ~/.julia/packages/DiffEqBase/eLhx9/src/solve.jl:567 [inlined]
[8] #solve_up#42
@ DiffEqBase ~/.julia/packages/DiffEqBase/eLhx9/src/solve.jl:1058 [inlined]
[9] solve_up
@ DiffEqBase ~/.julia/packages/DiffEqBase/eLhx9/src/solve.jl:1044 [inlined]
[10] #solve#40
@ DiffEqBase ~/.julia/packages/DiffEqBase/eLhx9/src/solve.jl:981 [inlined]
[11] batch_func(i::Int64, prob::EnsembleProblem{…}, alg::radau{…}; kwargs::@Kwargs{…})
@ SciMLBase ~/.julia/packages/SciMLBase/slQep/src/ensemble/basic_ensemble_solve.jl:186
[12] batch_func
@ ~/.julia/packages/SciMLBase/slQep/src/ensemble/basic_ensemble_solve.jl:173 [inlined]
[13] #583
@ ~/.julia/packages/SciMLBase/slQep/src/ensemble/basic_ensemble_solve.jl:240 [inlined]
[14] responsible_map
@ ~/.julia/packages/SciMLBase/slQep/src/ensemble/basic_ensemble_solve.jl:233 [inlined]
[15] solve_batch(prob::EnsembleProblem{…}, alg::radau{…}, ::EnsembleSerial, II::UnitRange{…}, pmap_batch_size::Int64; kwargs::@Kwargs{…})
@ SciMLBase ~/.julia/packages/SciMLBase/slQep/src/ensemble/basic_ensemble_solve.jl:239
[16] solve_batch
@ ~/.julia/packages/SciMLBase/slQep/src/ensemble/basic_ensemble_solve.jl:238 [inlined]
[17] solve_batch(prob::EnsembleProblem{…}, alg::radau{…}, ensemblealg::EnsembleThreads, II::UnitRange{…}, pmap_batch_size::Int64; kwargs::@Kwargs{…})
@ SciMLBase ~/.julia/packages/SciMLBase/slQep/src/ensemble/basic_ensemble_solve.jl:249
[18] solve_batch
@ ~/.julia/packages/SciMLBase/slQep/src/ensemble/basic_ensemble_solve.jl:245 [inlined]
[19] macro expansion
@ ./timing.jl:395 [inlined]
[20] (::SciMLBase.var"#576#577"{Int64, Int64, Int64, @Kwargs{…}, EnsembleProblem{…}, radau{…}, EnsembleThreads})()
@ SciMLBase ~/.julia/packages/SciMLBase/slQep/src/ensemble/basic_ensemble_solve.jl:140
[21] with_logstate(f::Function, logstate::Any)
@ Base.CoreLogging ./logging.jl:515
[22] with_logger
@ ./logging.jl:627 [inlined]
[23] __solve(prob::EnsembleProblem{…}, alg::radau{…}, ensemblealg::EnsembleThreads; trajectories::Int64, batch_size::Int64, progress_aggregate::Bool, pmap_batch_size::Int64, kwargs::@Kwargs{…})
@ SciMLBase ~/.julia/packages/SciMLBase/slQep/src/ensemble/basic_ensemble_solve.jl:124
[24] #solve#44
@ DiffEqBase ~/.julia/packages/DiffEqBase/eLhx9/src/solve.jl:1074 [inlined]
[25] macro expansion
@ ./timing.jl:279 [inlined]
[26] top-level scope
when I executed ODEInterface.loadODESolvers(), I obtained
Dict{AbstractString, ODEInterface.SolverDLinfo} with 23 entries:
"colnew_i32" => SolverDLinfo("colnew_i32", "", Ptr{Nothing} @0x0000000000000000, (), UndefVarError(:libcolnew_i32_handle))
"radau_i32" => SolverDLinfo("radau_i32", "", Ptr{Nothing} @0x0000000000000000, (), UndefVarError(:libradau_i32_handle))
"bvpsol" => SolverDLinfo("bvpsol", "", Ptr{Nothing} @0x0000000000000000, (), UndefVarError(:libbvpsol_handle))
"seulex" => SolverDLinfo("seulex", "", Ptr{Nothing} @0x0000000000000000, (), UndefVarError(:libseulex_handle))
"odex_i32" => SolverDLinfo("odex_i32", "", Ptr{Nothing} @0x0000000000000000, (), UndefVarError(:libodex_i32_handle))
"seulex_i32" => SolverDLinfo("seulex_i32", "", Ptr{Nothing} @0x0000000000000000, (), UndefVarError(:libseulex_i32_handle))
"bvp_m_proxy" => SolverDLinfo("bvp_m_proxy", "", Ptr{Nothing} @0x0000000000000000, (), UndefVarError(:libbvp_m_proxy_handle))
"dopri5_i32" => SolverDLinfo("dopri5_i32", "", Ptr{Nothing} @0x0000000000000000, (), UndefVarError(:libdopri5_i32_handle))
"radau5_i32" => SolverDLinfo("radau5_i32", "", Ptr{Nothing} @0x0000000000000000, (), UndefVarError(:libradau5_i32_handle))
"ddeabm_i32" => SolverDLinfo("ddeabm_i32", "", Ptr{Nothing} @0x0000000000000000, (), UndefVarError(:libddeabm_i32_handle))
"colnew" => SolverDLinfo("colnew", "", Ptr{Nothing} @0x0000000000000000, (), UndefVarError(:libcolnew_handle))
"rodas_i32" => SolverDLinfo("rodas_i32", "", Ptr{Nothing} @0x0000000000000000, (), UndefVarError(:librodas_i32_handle))
"ddebdf_i32" => SolverDLinfo("ddebdf_i32", "", Ptr{Nothing} @0x0000000000000000, (), UndefVarError(:libddebdf_i32_handle))
"radau" => SolverDLinfo("radau", "", Ptr{Nothing} @0x0000000000000000, (), UndefVarError(:libradau_handle))
"dop853_i32" => SolverDLinfo("dop853_i32", "", Ptr{Nothing} @0x0000000000000000, (), UndefVarError(:libdop853_i32_handle))
"rodas" => SolverDLinfo("rodas", "", Ptr{Nothing} @0x0000000000000000, (), UndefVarError(:librodas_handle))
On ODEInterfaceDiffEq it reads: A standard installation on MacOSX and Linux should work.
But sadly, it doesn't work for me. Is there any workaround for this?
In case it is relevant my Julia version is:
julia> versioninfo()
Julia Version 1.10.0
Commit 3120989f39b (2023-12-25 18:01 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: macOS (arm64-apple-darwin22.4.0)
CPU: 12 × Apple M2 Pro
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
Threads: 1 on 8 virtual cores
Environment:
JULIA_EDITOR = code
I can't figure out how the solver specific options in ODEInterface
are passed to solve
. Can you give an example?
┌ ODEInterfaceDiffEq [09606e27-ecf5-54fc-bb29-004bd9f985bf]
│ WARNING: Method definition alg_order(ODEInterfaceDiffEq.odex) in module ODEInterfaceDiffEq at C:\Users\runneradmin\.julia\packages\ODEInterfaceDiffEq\lGV1B\src\algorithms.jl:22 overwritten at C:\Users\runneradmin\.julia\packages\ODEInterfaceDiffEq\lGV1B\src\algorithms.jl:31.
│ ** incremental compilation may be fatally broken for this module **
julia v1.9.2, ODEInterfaceDiffEq v3.13.1
The following test script errors if ODEInterface
in is the manifest but not a part of the project:
using ODEInterfaceDiffEq, ParameterizedFunctions
van = @ode_def VanDerPol2 begin
dy = μ*((1-x^2)*y - x)
dx = 1*y
end μ
prob = ODEProblem(van,[0;2.],(0.0,6.3),1e6)
sol = solve(prob, radau(), abstol=1e-14, reltol=1e-14)
ERROR: LoadError: Cannot find method(s) for radau! I've tried to loadODESolvers(), but it didn't work. Please check ODEInterface.help_solversupport() and call loadODESolvers and check also this output. For further information see also ODEInterface.help_install.
Stacktrace:
[1] getAllMethodPtrs(::String) at /home/mseeker/.julia/packages/ODEInterface/XXyDo/src/DLSolvers.jl:248
[2] radau_impl(::Function, ::Float64, ::Float64, ::Array{Float64,1}, ::ODEInterface.OptionsODE, ::ODEInterface.RadauArguments{Int64}) at /home/mseeker/.julia/packages/ODEInterface/XXyDo/src/Radau.jl:770
[3] radau(::Function, ::Float64, ::Float64, ::Array{Float64,1}, ::ODEInterface.OptionsODE) at /home/mseeker/.julia/packages/ODEInterface/XXyDo/src/Radau.jl:744
[4] macro expansion at ./logging.jl:313 [inlined]
[5] #__solve#3(::Array{Float64,1}, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::Nothing, ::Base.Iterators.Pairs{Symbol,Float64,Tuple{Symbol,Symbol},NamedTuple{(:abstol, :reltol),Tuple{Float64,Float64}}}, ::typeof(DiffEqBase.__solve), ::ODEProblem{Array{Float64,1},Tuple{Float64,Float64},true,Float64,VanDerPol2{getfield(Main, Symbol("##3#7")),getfield(Main, Symbol("##4#8")),getfield(Main, Symbol("##5#9")),Nothing,Nothing,getfield(Main, Symbol("##6#10")),Expr,Expr},Nothing,DiffEqBase.StandardODEProblem}, ::radau, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}) at /home/mseeker/.julia/packages/ODEInterfaceDiffEq/eZrOa/src/solve.jl:50
[6] (::getfield(DiffEqBase, Symbol("#kw##__solve")))(::NamedTuple{(:abstol, :reltol),Tuple{Float64,Float64}}, ::typeof(DiffEqBase.__solve), ::ODEProblem{Array{Float64,1},Tuple{Float64,Float64},true,Float64,VanDerPol2{getfield(Main, Symbol("##3#7")),getfield(Main, Symbol("##4#8")),getfield(Main, Symbol("##5#9")),Nothing,Nothing,getfield(Main, Symbol("##6#10")),Expr,Expr},Nothing,DiffEqBase.StandardODEProblem}, ::radau, ::Array{Any,1}, ::Array{Any,1}, ::Array{Any,1}) at ./none:0 (repeats 2 times)
[7] #solve#438(::Base.Iterators.Pairs{Symbol,Float64,Tuple{Symbol,Symbol},NamedTuple{(:abstol, :reltol),Tuple{Float64,Float64}}}, ::Function, ::ODEProblem{Array{Float64,1},Tuple{Float64,Float64},true,Float64,VanDerPol2{getfield(Main, Symbol("##3#7")),getfield(Main, Symbol("##4#8")),getfield(Main, Symbol("##5#9")),Nothing,Nothing,getfield(Main, Symbol("##6#10")),Expr,Expr},Nothing,DiffEqBase.StandardODEProblem}, ::radau) at /home/mseeker/.julia/packages/DiffEqBase/ujEgN/src/solve.jl:39
[8] (::getfield(DiffEqBase, Symbol("#kw##solve")))(::NamedTuple{(:abstol, :reltol),Tuple{Float64,Float64}}, ::typeof(solve), ::ODEProblem{Array{Float64,1},Tuple{Float64,Float64},true,Float64,VanDerPol2{getfield(Main, Symbol("##3#7")),getfield(Main, Symbol("##4#8")),getfield(Main, Symbol("##5#9")),Nothing,Nothing,getfield(Main, Symbol("##6#10")),Expr,Expr},Nothing,DiffEqBase.StandardODEProblem}, ::radau) at ./none:0
[9] top-level scope at none:0
[10] include at ./boot.jl:317 [inlined]
[11] include_relative(::Module, ::String) at ./loading.jl:1041
[12] include(::Module, ::String) at ./sysimg.jl:29
[13] include(::String) at ./client.jl:388
[14] top-level scope at none:0
in expression starting at /home/mseeker/Desktop/test_radau.jl:9
However after Pkg.add("ODEInterface")
the script runs without problem.
Versions:
julia> versioninfo()
Julia Version 1.0.1
Commit 0d713926f8 (2018-09-29 19:05 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, skylake)
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
@JuliaRegistrator register()
When solving the minimal example in README I now get the following warning
┌ Warning: Backwards compatability support of the new return codes to Symbols will be deprecated with the Julia v1.9 release. Please see https://docs.sciml.ai/SciMLBase/stable/interfaces/Solutions/#retcodes for more information
Also links in README are broken
@JuliaRegistrator register()
Here's an MWE:
using OrdinaryDiffEq
using ODEInterfaceDiffEq
function lorenz(rhs, z, p, t)
rhs[1] = p.sigma * (z[2] - z[1])
rhs[2] = z[1] * (p.rho - z[3]) - z[2]
rhs[3] = z[1] * z[2] - p.beta * z[3]
end
struct LorenzParameters
sigma::Float64
beta::Float64
rho::Float64
end
z0 = [1; 0; 0]
z0 = Float64.(z0)
p = LorenzParameters(10, 8/3, 28)
pb = ODEProblem(lorenz, z0, (0.0, 4.0), p)
sol = solve(pb, dop853(); saveat = 1e-3, save_everystep = true)
println(issorted(sol.t))
Outputs false. As a result, here's what you get if you plot one of the variables:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.