Skip to content

Commit

Permalink
Fixed bug with dummy differential equation (if model has no states)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinOtter committed May 21, 2021
1 parent 446f7d2 commit a8e55d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/StateSelection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1495,10 +1495,10 @@ function getSortedAndSolvedAST(G, # Typically ::Vector{Vector{Int}}
if length(ODE_states) == 0
if log
println("Model has only explicitly solved algebraic variables.\n",
"Added a dummy differential equation der(x[1]) = -x[1], x[1](t0) = 0")
"Added a dummy differential equation der(_dummy_x) = -_dummy_x, _dummy_x(t0) = 0")
end
push!(eq.equationInfo.x_info, ModiaBase.StateElementInfo(
"", :(), "", :(), XD, 1, "", false, NaN, false))
"_dummy_x", :(), "der(_dummy_x)", :(), XD, 1, "", false, NaN, false))
end

if log
Expand Down

0 comments on commit a8e55d3

Please sign in to comment.