Skip to content

Instantly share code, notes, and snippets.

@paulflang
Created June 6, 2022 22:06
Show Gist options
  • Save paulflang/da6d17a632bb2736c828d38f4529b878 to your computer and use it in GitHub Desktop.
Save paulflang/da6d17a632bb2736c828d38f4529b878 to your computer and use it in GitHub Desktop.
structural_simplify complains about extra variables despite ODEProblem does just fine, even when checkl_length_true
using Downloads, SBMLToolkit#pl-refactor_v0.1.13
using OrdinaryDiffEq, ModelingToolkit
case = "00023"
sbml_url = "https://raw.githubusercontent.com/sbmlteam/sbml-test-suite/master/cases/semantic/$case/$case"*"-sbml-l3v2.xml"
sbml = String(take!(Downloads.download(sbml_url, IOBuffer())))
ml = readSBMLFromString(sbml, doc -> begin
set_level_and_version(3, 2)(doc)
convert_simplify_math(doc)
end)
rs = ReactionSystem(ml)
sys = convert(ODESystem, rs; include_zero_odes = true)
equations(sys)
states(sys)
ssys = structural_simplify(sys)
prob = ODEProblem(sys, Pair[], (0, 1); check_length=true)
sol = solve(prob, Tsit5())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment