-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b7bdd4
commit d1bdc4d
Showing
16 changed files
with
464 additions
and
34 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
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
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
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
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,54 @@ | ||
# The content of this file was generated using the Python profile of libCellML 0.5.0. | ||
|
||
from enum import Enum | ||
from math import * | ||
|
||
|
||
__version__ = "0.4.0" | ||
LIBCELLML_VERSION = "0.5.0" | ||
|
||
VARIABLE_COUNT = 10 | ||
|
||
|
||
class VariableType(Enum): | ||
CONSTANT = 0 | ||
COMPUTED_CONSTANT = 1 | ||
ALGEBRAIC = 2 | ||
|
||
|
||
VARIABLE_INFO = [ | ||
{"name": "v", "units": "fmol_per_sec", "component": "SLC_template3_ss", "type": VariableType.COMPUTED_CONSTANT}, | ||
{"name": "E", "units": "fmol", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, | ||
{"name": "P_0", "units": "per_fmol_sec4", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, | ||
{"name": "q_Ao", "units": "fmol", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, | ||
{"name": "P_1", "units": "per_fmol_sec4", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, | ||
{"name": "q_Ai", "units": "fmol", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, | ||
{"name": "P_2", "units": "per_fmol_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, | ||
{"name": "P_5", "units": "per_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, | ||
{"name": "P_4", "units": "per_fmol2_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT}, | ||
{"name": "P_3", "units": "per_fmol_sec3", "component": "SLC_template3_ss", "type": VariableType.CONSTANT} | ||
] | ||
|
||
|
||
def create_variables_array(): | ||
return [nan]*VARIABLE_COUNT | ||
|
||
|
||
def initialise_variables(variables): | ||
variables[1] = 1.1 | ||
variables[2] = 21262500.0 | ||
variables[3] = 150.0 | ||
variables[4] = 3402000.0 | ||
variables[5] = 2.0 | ||
variables[6] = 2902500.0 | ||
variables[7] = 810000.0 | ||
variables[8] = 247140.0 | ||
variables[9] = 2902500.0 | ||
|
||
|
||
def compute_computed_constants(variables): | ||
variables[0] = variables[1]*(variables[2]*variables[3]-variables[4]*variables[5])/(variables[6]*variables[5]+variables[9]*variables[3]+variables[8]*variables[5]*variables[3]+variables[7]) | ||
|
||
|
||
def compute_variables(variables): | ||
pass |
71 changes: 71 additions & 0 deletions
71
tests/resources/generator/cellml_slc_example/slc_model.cellml
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,71 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<model xmlns="http://www.cellml.org/cellml/2.0#" name="test_model"> | ||
<import xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="units_BG.cellml"> | ||
<units units_ref="per_sec" name="per_sec"/> | ||
<units units_ref="fmol_per_sec" name="fmol_per_sec"/> | ||
<units units_ref="per_fmol" name="per_fmol"/> | ||
<units units_ref="fmol" name="fmol"/> | ||
<units units_ref="per_fmol_sec4" name="per_fmol_sec4"/> | ||
<units units_ref="per_fmol_sec3" name="per_fmol_sec3"/> | ||
<units units_ref="per_fmol2_sec3" name="per_fmol2_sec3"/> | ||
<units units_ref="per_sec3" name="per_sec3"/> | ||
</import> | ||
<component name="SLC_template3_ss"> | ||
<variable name="v" units="fmol_per_sec" /> | ||
<variable name="E" units="fmol" initial_value="1.1" /> | ||
<variable name="q_Ai" units="fmol" initial_value="2"/> | ||
<variable name="q_Ao" units="fmol" initial_value="150" /> | ||
<variable name="P_0" units="per_fmol_sec4" initial_value="21262500" id="b4da6c"/> | ||
<variable name="P_1" units="per_fmol_sec4" initial_value="3402000" id="b4da6d"/> | ||
<variable name="P_2" units="per_fmol_sec3" initial_value="2902500" id="b4da6e"/> | ||
<variable name="P_3" units="per_fmol_sec3" initial_value="2902500" interface="public" id="b4da6f"/> | ||
<variable name="P_4" units="per_fmol2_sec3" initial_value="247140" id="b4da70"/> | ||
<variable name="P_5" units="per_sec3" initial_value="810000" id="b4da71"/> | ||
<math xmlns="http://www.w3.org/1998/Math/MathML" xmlns:cellml="http://www.cellml.org/cellml/2.0#"> | ||
<apply> | ||
<eq/> | ||
<ci>v</ci> | ||
<apply> | ||
<divide/> | ||
<apply> | ||
<times/> | ||
<ci>E</ci> | ||
<apply> | ||
<minus/> | ||
<apply> | ||
<times/> | ||
<ci>P_0</ci> | ||
<ci>q_Ao</ci> | ||
</apply> | ||
<apply> | ||
<times/> | ||
<ci>P_1</ci> | ||
<ci>q_Ai</ci> | ||
</apply> | ||
</apply> | ||
</apply> | ||
<apply> | ||
<plus/> | ||
<apply> | ||
<times/> | ||
<ci>P_2</ci> | ||
<ci>q_Ai</ci> | ||
</apply> | ||
<apply> | ||
<times/> | ||
<ci>P_3</ci> | ||
<ci>q_Ao</ci> | ||
</apply> | ||
<apply> | ||
<times/> | ||
<ci>P_4</ci> | ||
<ci>q_Ai</ci> | ||
<ci>q_Ao</ci> | ||
</apply> | ||
<ci>P_5</ci> | ||
</apply> | ||
</apply> | ||
</apply> | ||
</math> | ||
</component> | ||
</model> |
Oops, something went wrong.