ModelingToolkit.jl
ModelingToolkit.jl copied to clipboard
remake type promotion fails with empty initial conditions
The last @test_nowarn in
using Test
using ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D
using DifferentialEquations
using ForwardDiff
@testset "remake type promotion with empty initial conditions" begin
@parameters P
@variables x(t)
# numerical ODE: x′(t) = P with x(0) = 0
sys_num = structural_simplify(ODESystem([D(x) ~ P], t, [x], [P]; name = :sys))
prob_num_uninit = ODEProblem(sys_num, [x => 0.0], (0.0, 1.0), [P => NaN]) # uninitialized problem
x_at_1_num(P) = solve(remake(prob_num_uninit; p = [sys_num.P => P]))(1.0, idxs=x)
# analytical solution: x(t) = P*t
sys_anal = structural_simplify(ODESystem([x ~ P*t], t, [x], [P]; name = :sys))
prob_anal_uninit = ODEProblem(sys_anal, [], (0.0, 1.0), [P => NaN])
x_at_1_anal(P) = solve(remake(prob_anal_uninit; p = [sys_anal.P => P]))(1.0, idxs=x)
@test_nowarn x_at_1_num(1.0)
@test_nowarn x_at_1_anal(1.0)
@test_nowarn ForwardDiff.derivative(x_at_1_num, 1.0)
@test_nowarn ForwardDiff.derivative(x_at_1_anal, 1.0)
end
fails with the error
MethodError: no method matching Float64(::Nothing)
Closest candidates are:
Float64(::IrrationalConstants.Loghalf)
@ IrrationalConstants C:\Users\herma\.julia\packages\IrrationalConstants\vp5v4\src\macro.jl:112
Float64(::Int8)
@ Base float.jl:159
Float64(::UInt8)
@ Base float.jl:165
...
Stacktrace:
[1] convert(::Type{ForwardDiff.Dual{ForwardDiff.Tag{var"#x_at_1_anal#10"{ODEProblem{Nothing, Tuple{Float64, Float64}, true, ModelingToolkit.MTKParameters{Tuple{Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}, Nothing, Nothing}, ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#709"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x68b6838e, 0xdcde5d93, 0xe95aa607, 0x31d03dbd, 0xdc6d45c2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xfeaddeee, 0x8de91b1a, 0x6c8ccac3, 0x1362a2f5, 0x5821e073), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.var"#878#generated_observed#718"{Bool, ODESystem, Dict{Any, Any}, Vector{Any}}, Nothing, ODESystem, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, ODESystem, Num}, Float64}, Float64, 1}}, x::Nothing)
@ ForwardDiff C:\Users\herma\.julia\packages\ForwardDiff\PcZ48\src\dual.jl:435
[2] ForwardDiff.Dual{ForwardDiff.Tag{var"#x_at_1_anal#10"{ODEProblem{Nothing, Tuple{Float64, Float64}, true, ModelingToolkit.MTKParameters{Tuple{Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}, Nothing, Nothing}, ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#709"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x68b6838e, 0xdcde5d93, 0xe95aa607, 0x31d03dbd, 0xdc6d45c2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xfeaddeee, 0x8de91b1a, 0x6c8ccac3, 0x1362a2f5, 0x5821e073), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.var"#878#generated_observed#718"{Bool, ODESystem, Dict{Any, Any}, Vector{Any}}, Nothing, ODESystem, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, ODESystem, Num}, Float64}, Float64, 1}(x::Nothing)
@ ForwardDiff C:\Users\herma\.julia\packages\ForwardDiff\PcZ48\src\dual.jl:77
[3] _broadcast_getindex_evalf(f::Type{ForwardDiff.Dual{ForwardDiff.Tag{var"#x_at_1_anal#10"{ODEProblem{Nothing, Tuple{Float64, Float64}, true, ModelingToolkit.MTKParameters{Tuple{Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}, Nothing, Nothing}, ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#709"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x68b6838e, 0xdcde5d93, 0xe95aa607, 0x31d03dbd, 0xdc6d45c2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xfeaddeee, 0x8de91b1a, 0x6c8ccac3, 0x1362a2f5, 0x5821e073), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.var"#878#generated_observed#718"{Bool, ODESystem, Dict{Any, Any}, Vector{Any}}, Nothing, ODESystem, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, ODESystem, Num}, Float64}, Float64, 1}}, args::Nothing)
@ Base.Broadcast .\broadcast.jl:709
[4] _broadcast_getindex
@ .\broadcast.jl:682 [inlined]
[5] getindex
@ .\broadcast.jl:636 [inlined]
[6] copy
@ .\broadcast.jl:918 [inlined]
[7] materialize
@ .\broadcast.jl:903 [inlined]
[8] promote_u0
@ C:\Users\herma\.julia\packages\DiffEqBase\NaUtB\src\forwarddiff.jl:269 [inlined]
[9] get_concrete_problem(prob::ODEProblem{Nothing, Tuple{Float64, Float64}, true, ModelingToolkit.MTKParameters{Tuple{Vector{ForwardDiff.Dual{ForwardDiff.Tag{var"#x_at_1_anal#10"{ODEProblem{Nothing, Tuple{Float64, Float64}, true, ModelingToolkit.MTKParameters{Tuple{Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}, Nothing, Nothing}, ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#709"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x68b6838e, 0xdcde5d93, 0xe95aa607, 0x31d03dbd, 0xdc6d45c2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xfeaddeee, 0x8de91b1a, 0x6c8ccac3, 0x1362a2f5, 0x5821e073), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.var"#878#generated_observed#718"{Bool, ODESystem, Dict{Any, Any}, Vector{Any}}, Nothing, ODESystem, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, ODESystem, Num}, Float64}, Float64, 1}}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}, Nothing, Nothing}, ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#709"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x68b6838e, 0xdcde5d93, 0xe95aa607, 0x31d03dbd, 0xdc6d45c2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xfeaddeee, 0x8de91b1a, 0x6c8ccac3, 0x1362a2f5, 0x5821e073), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.var"#878#generated_observed#718"{Bool, ODESystem, Dict{Any, Any}, Vector{Any}}, Nothing, ODESystem, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, isadapt::Bool; kwargs::@Kwargs{u0::Nothing, p::ModelingToolkit.MTKParameters{Tuple{Vector{ForwardDiff.Dual{ForwardDiff.Tag{var"#x_at_1_anal#10"{ODEProblem{Nothing, Tuple{Float64, Float64}, true, ModelingToolkit.MTKParameters{Tuple{Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}, Nothing, Nothing}, ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#709"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x68b6838e, 0xdcde5d93, 0xe95aa607, 0x31d03dbd, 0xdc6d45c2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xfeaddeee, 0x8de91b1a, 0x6c8ccac3, 0x1362a2f5, 0x5821e073), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.var"#878#generated_observed#718"{Bool, ODESystem, Dict{Any, Any}, Vector{Any}}, Nothing, ODESystem, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, ODESystem, Num}, Float64}, Float64, 1}}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}, Nothing, Nothing}})
@ DiffEqBase C:\Users\herma\.julia\packages\DiffEqBase\NaUtB\src\solve.jl:1171
[10] solve_up(::ODEProblem{Nothing, Tuple{Float64, Float64}, true, ModelingToolkit.MTKParameters{Tuple{Vector{ForwardDiff.Dual{ForwardDiff.Tag{var"#x_at_1_anal#10"{ODEProblem{Nothing, Tuple{Float64, Float64}, true, ModelingToolkit.MTKParameters{Tuple{Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}, Nothing, Nothing}, ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#709"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x68b6838e, 0xdcde5d93, 0xe95aa607, 0x31d03dbd, 0xdc6d45c2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xfeaddeee, 0x8de91b1a, 0x6c8ccac3, 0x1362a2f5, 0x5821e073), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.var"#878#generated_observed#718"{Bool, ODESystem, Dict{Any, Any}, Vector{Any}}, Nothing, ODESystem, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, ODESystem, Num}, Float64}, Float64, 1}}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}, Nothing, Nothing}, ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#709"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x68b6838e, 0xdcde5d93, 0xe95aa607, 0x31d03dbd, 0xdc6d45c2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xfeaddeee, 0x8de91b1a, 0x6c8ccac3, 0x1362a2f5, 0x5821e073), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.var"#878#generated_observed#718"{Bool, ODESystem, Dict{Any, Any}, Vector{Any}}, Nothing, ODESystem, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, ::Nothing, ::Nothing, ::ModelingToolkit.MTKParameters{Tuple{Vector{ForwardDiff.Dual{ForwardDiff.Tag{var"#x_at_1_anal#10"{ODEProblem{Nothing, Tuple{Float64, Float64}, true, ModelingToolkit.MTKParameters{Tuple{Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}, Nothing, Nothing}, ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#709"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x68b6838e, 0xdcde5d93, 0xe95aa607, 0x31d03dbd, 0xdc6d45c2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xfeaddeee, 0x8de91b1a, 0x6c8ccac3, 0x1362a2f5, 0x5821e073), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.var"#878#generated_observed#718"{Bool, ODESystem, Dict{Any, Any}, Vector{Any}}, Nothing, ODESystem, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, ODESystem, Num}, Float64}, Float64, 1}}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}, Nothing, Nothing}; kwargs::@Kwargs{})
@ DiffEqBase C:\Users\herma\.julia\packages\DiffEqBase\NaUtB\src\solve.jl:1070
[11] solve_up(::ODEProblem{Nothing, Tuple{Float64, Float64}, true, ModelingToolkit.MTKParameters{Tuple{Vector{ForwardDiff.Dual{ForwardDiff.Tag{var"#x_at_1_anal#10"{ODEProblem{Nothing, Tuple{Float64, Float64}, true, ModelingToolkit.MTKParameters{Tuple{Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}, Nothing, Nothing}, ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#709"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x68b6838e, 0xdcde5d93, 0xe95aa607, 0x31d03dbd, 0xdc6d45c2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xfeaddeee, 0x8de91b1a, 0x6c8ccac3, 0x1362a2f5, 0x5821e073), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.var"#878#generated_observed#718"{Bool, ODESystem, Dict{Any, Any}, Vector{Any}}, Nothing, ODESystem, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, ODESystem, Num}, Float64}, Float64, 1}}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}, Nothing, Nothing}, ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#709"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x68b6838e, 0xdcde5d93, 0xe95aa607, 0x31d03dbd, 0xdc6d45c2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xfeaddeee, 0x8de91b1a, 0x6c8ccac3, 0x1362a2f5, 0x5821e073), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.var"#878#generated_observed#718"{Bool, ODESystem, Dict{Any, Any}, Vector{Any}}, Nothing, ODESystem, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, ::Nothing, ::Nothing, ::ModelingToolkit.MTKParameters{Tuple{Vector{ForwardDiff.Dual{ForwardDiff.Tag{var"#x_at_1_anal#10"{ODEProblem{Nothing, Tuple{Float64, Float64}, true, ModelingToolkit.MTKParameters{Tuple{Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}, Nothing, Nothing}, ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#709"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x68b6838e, 0xdcde5d93, 0xe95aa607, 0x31d03dbd, 0xdc6d45c2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xfeaddeee, 0x8de91b1a, 0x6c8ccac3, 0x1362a2f5, 0x5821e073), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.var"#878#generated_observed#718"{Bool, ODESystem, Dict{Any, Any}, Vector{Any}}, Nothing, ODESystem, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, ODESystem, Num}, Float64}, Float64, 1}}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}, Nothing, Nothing})
@ DiffEqBase C:\Users\herma\.julia\packages\DiffEqBase\NaUtB\src\solve.jl:1066
[12] solve(::ODEProblem{Nothing, Tuple{Float64, Float64}, true, ModelingToolkit.MTKParameters{Tuple{Vector{ForwardDiff.Dual{ForwardDiff.Tag{var"#x_at_1_anal#10"{ODEProblem{Nothing, Tuple{Float64, Float64}, true, ModelingToolkit.MTKParameters{Tuple{Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}, Nothing, Nothing}, ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#709"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x68b6838e, 0xdcde5d93, 0xe95aa607, 0x31d03dbd, 0xdc6d45c2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xfeaddeee, 0x8de91b1a, 0x6c8ccac3, 0x1362a2f5, 0x5821e073), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.var"#878#generated_observed#718"{Bool, ODESystem, Dict{Any, Any}, Vector{Any}}, Nothing, ODESystem, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, ODESystem, Num}, Float64}, Float64, 1}}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}, Nothing, Nothing}, ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#709"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x68b6838e, 0xdcde5d93, 0xe95aa607, 0x31d03dbd, 0xdc6d45c2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xfeaddeee, 0x8de91b1a, 0x6c8ccac3, 0x1362a2f5, 0x5821e073), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.var"#878#generated_observed#718"{Bool, ODESystem, Dict{Any, Any}, Vector{Any}}, Nothing, ODESystem, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}; sensealg::Nothing, u0::Nothing, p::Nothing, wrap::Val{true}, kwargs::@Kwargs{})
@ DiffEqBase C:\Users\herma\.julia\packages\DiffEqBase\NaUtB\src\solve.jl:1003
[13] solve(::ODEProblem{Nothing, Tuple{Float64, Float64}, true, ModelingToolkit.MTKParameters{Tuple{Vector{ForwardDiff.Dual{ForwardDiff.Tag{var"#x_at_1_anal#10"{ODEProblem{Nothing, Tuple{Float64, Float64}, true, ModelingToolkit.MTKParameters{Tuple{Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}, Nothing, Nothing}, ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#709"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x68b6838e, 0xdcde5d93, 0xe95aa607, 0x31d03dbd, 0xdc6d45c2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xfeaddeee, 0x8de91b1a, 0x6c8ccac3, 0x1362a2f5, 0x5821e073), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.var"#878#generated_observed#718"{Bool, ODESystem, Dict{Any, Any}, Vector{Any}}, Nothing, ODESystem, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, ODESystem, Num}, Float64}, Float64, 1}}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}, Nothing, Nothing}, ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#709"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x68b6838e, 0xdcde5d93, 0xe95aa607, 0x31d03dbd, 0xdc6d45c2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xfeaddeee, 0x8de91b1a, 0x6c8ccac3, 0x1362a2f5, 0x5821e073), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.var"#878#generated_observed#718"{Bool, ODESystem, Dict{Any, Any}, Vector{Any}}, Nothing, ODESystem, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem})
@ DiffEqBase C:\Users\herma\.julia\packages\DiffEqBase\NaUtB\src\solve.jl:993
[14] (::var"#x_at_1_anal#10"{ODEProblem{Nothing, Tuple{Float64, Float64}, true, ModelingToolkit.MTKParameters{Tuple{Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}, Nothing, Nothing}, ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#709"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x68b6838e, 0xdcde5d93, 0xe95aa607, 0x31d03dbd, 0xdc6d45c2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xfeaddeee, 0x8de91b1a, 0x6c8ccac3, 0x1362a2f5, 0x5821e073), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.var"#878#generated_observed#718"{Bool, ODESystem, Dict{Any, Any}, Vector{Any}}, Nothing, ODESystem, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, ODESystem, Num})(P::ForwardDiff.Dual{ForwardDiff.Tag{var"#x_at_1_anal#10"{ODEProblem{Nothing, Tuple{Float64, Float64}, true, ModelingToolkit.MTKParameters{Tuple{Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}, Nothing, Nothing}, ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#709"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x68b6838e, 0xdcde5d93, 0xe95aa607, 0x31d03dbd, 0xdc6d45c2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xfeaddeee, 0x8de91b1a, 0x6c8ccac3, 0x1362a2f5, 0x5821e073), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.var"#878#generated_observed#718"{Bool, ODESystem, Dict{Any, Any}, Vector{Any}}, Nothing, ODESystem, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, ODESystem, Num}, Float64}, Float64, 1})
@ Main C:\Users\herma\Dropbox\School\UIO\Research\boltzmann\bug.jl:19
[15] derivative
@ C:\Users\herma\.julia\packages\ForwardDiff\PcZ48\src\derivative.jl:14 [inlined]
[16] (::var"#8#18"{var"#x_at_1_anal#10"{ODEProblem{Nothing, Tuple{Float64, Float64}, true, ModelingToolkit.MTKParameters{Tuple{Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}, Nothing, Nothing}, ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#709"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x68b6838e, 0xdcde5d93, 0xe95aa607, 0x31d03dbd, 0xdc6d45c2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xfeaddeee, 0x8de91b1a, 0x6c8ccac3, 0x1362a2f5, 0x5821e073), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.var"#878#generated_observed#718"{Bool, ODESystem, Dict{Any, Any}, Vector{Any}}, Nothing, ODESystem, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardODEProblem}, ODESystem, Num}})()
@ Main C:\Users\herma\.julia\juliaup\julia-1.10.2+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Test\src\Test.jl:898
...
Is there a missing type promotion when u0 = nothing (empty initial conditions)?
Is this with the latest MTK? Show ]st
Sorry, I should have clarified. It fails on both master and the most recent stable. Here is ]st on master:
[0c46a032] DifferentialEquations v7.13.0
[f6369f11] ForwardDiff v0.10.36
[961ee093] ModelingToolkit v9.12.0 `https://github.com/SciML/ModelingToolkit.jl.git#master`
[1dea7af3] OrdinaryDiffEq v6.74.1
[90137ffa] StaticArrays v1.9.3
[2efcf032] SymbolicIndexingInterface v0.3.16
Looks like a bug in the anytypedual handling @AayushSabharwal