-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix events and checksupport * fix not_implemented list and bump version * prevent a warning in tests
- Loading branch information
1 parent
097f2fe
commit 08230bf
Showing
7 changed files
with
217 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<sbml xmlns="http://www.sbml.org/sbml/level3/version2/core" level="3" version="2"> | ||
<model metaid="_case00026" id="case00026" name="case00026" timeUnits="time"> | ||
<listOfUnitDefinitions> | ||
<unitDefinition id="volume"> | ||
<listOfUnits> | ||
<unit kind="litre" exponent="1" scale="0" multiplier="1"/> | ||
</listOfUnits> | ||
</unitDefinition> | ||
<unitDefinition id="substance"> | ||
<listOfUnits> | ||
<unit kind="mole" exponent="1" scale="0" multiplier="1"/> | ||
</listOfUnits> | ||
</unitDefinition> | ||
<unitDefinition id="time"> | ||
<listOfUnits> | ||
<unit kind="second" exponent="1" scale="0" multiplier="1"/> | ||
</listOfUnits> | ||
</unitDefinition> | ||
</listOfUnitDefinitions> | ||
<listOfCompartments> | ||
<compartment id="compartment" name="compartment" spatialDimensions="3" size="1" units="volume" constant="true"/> | ||
</listOfCompartments> | ||
<listOfSpecies> | ||
<species id="S1" name="S1" compartment="compartment" initialAmount="1" substanceUnits="substance" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/> | ||
<species id="S2" name="S2" compartment="compartment" initialAmount="0" substanceUnits="substance" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/> | ||
</listOfSpecies> | ||
<listOfParameters> | ||
<parameter id="k1" name="k1" value="1" constant="true"/> | ||
</listOfParameters> | ||
<listOfReactions> | ||
<reaction id="reaction1" name="reaction1" reversible="false"> | ||
<listOfReactants> | ||
<speciesReference species="S1" stoichiometry="1" constant="true"/> | ||
</listOfReactants> | ||
<listOfProducts> | ||
<speciesReference species="S2" stoichiometry="1" constant="true"/> | ||
</listOfProducts> | ||
<kineticLaw> | ||
<math xmlns="http://www.w3.org/1998/Math/MathML"> | ||
<apply> | ||
<times/> | ||
<ci> compartment </ci> | ||
<ci> k1 </ci> | ||
<ci> S1 </ci> | ||
</apply> | ||
</math> | ||
</kineticLaw> | ||
</reaction> | ||
</listOfReactions> | ||
<listOfEvents> | ||
<event id="event1" name="event1" useValuesFromTriggerTime="true"> | ||
<trigger initialValue="true" persistent="true"> | ||
<math xmlns="http://www.w3.org/1998/Math/MathML"> | ||
<apply> | ||
<lt/> | ||
<ci> S1 </ci> | ||
<cn> 0.1 </cn> | ||
</apply> | ||
</math> | ||
</trigger> | ||
<listOfEventAssignments> | ||
<eventAssignment variable="S1"> | ||
<math xmlns="http://www.w3.org/1998/Math/MathML"> | ||
<cn type="integer"> 1 </cn> | ||
</math> | ||
</eventAssignment> | ||
</listOfEventAssignments> | ||
</event> | ||
</listOfEvents> | ||
</model> | ||
</sbml> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<sbml xmlns="http://www.sbml.org/sbml/level3/version2/core" level="3" version="2"> | ||
<model metaid="_case00041" id="case00041" name="case00041" timeUnits="time"> | ||
<listOfUnitDefinitions> | ||
<unitDefinition id="volume"> | ||
<listOfUnits> | ||
<unit kind="litre" exponent="1" scale="0" multiplier="1"/> | ||
</listOfUnits> | ||
</unitDefinition> | ||
<unitDefinition id="substance"> | ||
<listOfUnits> | ||
<unit kind="mole" exponent="1" scale="0" multiplier="1"/> | ||
</listOfUnits> | ||
</unitDefinition> | ||
<unitDefinition id="time"> | ||
<listOfUnits> | ||
<unit kind="second" exponent="1" scale="0" multiplier="1"/> | ||
</listOfUnits> | ||
</unitDefinition> | ||
</listOfUnitDefinitions> | ||
<listOfCompartments> | ||
<compartment id="compartment" name="compartment" spatialDimensions="3" size="1" units="volume" constant="true"/> | ||
</listOfCompartments> | ||
<listOfSpecies> | ||
<species id="S1" name="S1" compartment="compartment" initialAmount="1" substanceUnits="substance" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/> | ||
<species id="S2" name="S2" compartment="compartment" initialAmount="0" substanceUnits="substance" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/> | ||
</listOfSpecies> | ||
<listOfParameters> | ||
<parameter id="k1" name="k1" value="1" constant="true"/> | ||
</listOfParameters> | ||
<listOfReactions> | ||
<reaction id="reaction1" name="reaction1" reversible="false"> | ||
<listOfReactants> | ||
<speciesReference species="S1" stoichiometry="1" constant="true"/> | ||
</listOfReactants> | ||
<listOfProducts> | ||
<speciesReference species="S2" stoichiometry="1" constant="true"/> | ||
</listOfProducts> | ||
<kineticLaw> | ||
<math xmlns="http://www.w3.org/1998/Math/MathML"> | ||
<apply> | ||
<times/> | ||
<ci> compartment </ci> | ||
<ci> k1 </ci> | ||
<ci> S1 </ci> | ||
</apply> | ||
</math> | ||
</kineticLaw> | ||
</reaction> | ||
</listOfReactions> | ||
<listOfEvents> | ||
<event id="event1" name="event1" useValuesFromTriggerTime="true"> | ||
<trigger initialValue="true" persistent="true"> | ||
<math xmlns="http://www.w3.org/1998/Math/MathML"> | ||
<apply> | ||
<lt/> | ||
<ci> S1 </ci> | ||
<cn> 0.1 </cn> | ||
</apply> | ||
</math> | ||
</trigger> | ||
<listOfEventAssignments> | ||
<eventAssignment variable="S1"> | ||
<math xmlns="http://www.w3.org/1998/Math/MathML"> | ||
<cn type="integer"> 1 </cn> | ||
</math> | ||
</eventAssignment> | ||
</listOfEventAssignments> | ||
</event> | ||
<event id="event2" name="event2" useValuesFromTriggerTime="true"> | ||
<trigger initialValue="true" persistent="true"> | ||
<math xmlns="http://www.w3.org/1998/Math/MathML"> | ||
<apply> | ||
<gt/> | ||
<ci> S2 </ci> | ||
<cn> 0.5 </cn> | ||
</apply> | ||
</math> | ||
</trigger> | ||
<listOfEventAssignments> | ||
<eventAssignment variable="S2"> | ||
<math xmlns="http://www.w3.org/1998/Math/MathML"> | ||
<cn type="integer"> 0 </cn> | ||
</math> | ||
</eventAssignment> | ||
</listOfEventAssignments> | ||
</event> | ||
</listOfEvents> | ||
</model> | ||
</sbml> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
a | ||
listOfEvents | ||
</delay> | ||
b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
myread(fn) = readSBML(fn, doc -> begin | ||
set_level_and_version(3, 2)(doc) | ||
convert_simplify_math(doc) | ||
end) | ||
|
||
# 1 single trigger, single affect | ||
fn = "data/00026-sbml-l3v2.xml" | ||
m = myread(fn) | ||
@named sys = ODESystem(m) | ||
ssys = structural_simplify(sys) | ||
@test length(ModelingToolkit.get_continuous_events(ssys)) == 1 | ||
prob = ODEProblem(ssys, [], (0, 5.0); saveat = 0:0.1:5.0) | ||
sol = solve(prob, Tsit5()) | ||
@test sol.destats.ncondition > 0 | ||
|
||
# multiple events | ||
fn = "data/00041-sbml-l3v2.xml" | ||
m = myread(fn) | ||
@named sys = ODESystem(m) | ||
ssys = structural_simplify(sys) | ||
@test length(ModelingToolkit.get_continuous_events(ssys)) == 2 | ||
prob = ODEProblem(ssys, [], (0, 5.0); saveat = 0:0.1:5.0) | ||
sol = solve(prob, Tsit5()) | ||
@test sol.destats.ncondition > 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters