Open ArnoStrouwen opened 1 year ago
Can you clarify what looks wrong here?
It still has
(Differential(a(t)))((<)(ˍ
In the generated code
Ahh yeah, that's just done for derivatives which aren't defined so it should error. We could make that throw a nicer error earlier.
Differential was removed so this was handled.
Differential hasn't been removed, and this issue is still present on v9.0.1
Chris, maybe you were referring to Difference
?
julia> prob.f.jac.jac_oop
RuntimeGeneratedFunction(#=in ModelingToolkit=#, #=using ModelingToolkit=#, :((ˍ₋arg1, t)->begin
#= /home/fredrikb/.julia/packages/SymbolicUtils/r1pzW/src/code.jl:373 =#
#= /home/fredrikb/.julia/packages/SymbolicUtils/r1pzW/src/code.jl:374 =#
#= /home/fredrikb/.julia/packages/SymbolicUtils/r1pzW/src/code.jl:375 =#
begin
begin
begin
#= /home/fredrikb/.julia/packages/SymbolicUtils/r1pzW/src/code.jl:468 =#
(SymbolicUtils.Code.create_array)(typeof(ˍ₋arg1), nothing, Val{2}(), Val{(1, 1)}(), (+)((+)((+)((*)(-1, (>)(ˍ₋arg1[1], 0)), (<)(ˍ₋arg1[1], 0)), (*)((*)(-1, ˍ₋arg1[1]), (Differential(a(t)))((>)(ˍ₋arg1[1], 0)))), (*)(ˍ₋arg1[1], (Differential(a(t)))((<)(ˍ₋arg1[1], 0)))))
end
end
end
end))
I think I closed the wrong tab.
docs recommend doing branching using comparison operator https://docs.sciml.ai/ModelingToolkit/stable/basics/FAQ/#How-do-I-handle-if-statements-in-my-symbolic-forms but I think the Jacobean is not generated correctly?