From adbb54792c84b05681fa99bee63c9b51c6e06e9b Mon Sep 17 00:00:00 2001 From: Evgeny Metelkin Date: Fri, 22 Nov 2024 18:36:54 +0200 Subject: [PATCH] cases 20-22 --- cases/0020/index0.heta | 2 +- cases/0021/index0.heta | 27 +++++++++++++++++++++++++++ cases/0022/index0.heta | 21 +++++++++++++++++++++ package.json | 3 +++ 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 cases/0021/index0.heta create mode 100644 cases/0022/index0.heta diff --git a/cases/0020/index0.heta b/cases/0020/index0.heta index 2a45c2d..de07bf4 100644 --- a/cases/0020/index0.heta +++ b/cases/0020/index0.heta @@ -7,7 +7,7 @@ comp1 @Compartment .= 1; // species -x1 @Species { compartment: comp1 , output: true} .= 10; +x1 @Species { compartment: comp1, output: true} .= 10; x2 @Species { compartment: comp1, output: true } .= 0; x3 @Species { compartment: comp1, output: true } .= 12.12; diff --git a/cases/0021/index0.heta b/cases/0021/index0.heta new file mode 100644 index 0000000..ccc5b95 --- /dev/null +++ b/cases/0021/index0.heta @@ -0,0 +1,27 @@ +/* + Create complete model with 3 compartments and 3 species. + Add possible reactions. + Set initial concentrations. + Set rate rules. + Set parameters. + Set compartments. + Set species. +*/ + +// Compartments +comp1 @Compartment .= 1; +comp2 @Compartment .= 1.5; +comp3 @Compartment .= 2; + +// Species +s1 @Species {compartment: comp1} .= 10; +s2 @Species {compartment: comp1} .= 20; +s3 @Species {compartment: comp2} .= 30; + +// Reactions +r1 @Reaction {actors: s1 + s2 -> s3} .= k1 * s1 * s2 * comp1; // mass action +r2 @Reaction {actors: s3 -> s1 + s2} .= k2 * s3 * comp2; // mass action + +// Constants +k1 @Const = 0.1; +k2 @Const = 0.2; diff --git a/cases/0022/index0.heta b/cases/0022/index0.heta new file mode 100644 index 0000000..3325815 --- /dev/null +++ b/cases/0022/index0.heta @@ -0,0 +1,21 @@ +/* + Create a model with 2 compartments and 2 species. + It also has Time event starting at 10 and repeat each 20 time units. + The event changes the rate of the first reaction to 0.5. +*/ + +// Compartments +comp1 @Compartment .= 1; +comp2 @Compartment .= 2; + +// Species +s1 @Species .= 10; +s2 @Species .= 20; + +// Reactions +r1 @Reaction {actors: s1 + s2 -> s3} .= k1 * s1 * s2 * comp1; // mass action +r2 @Reaction {actors: s3 -> s1 + s2} .= k2 * s3 * comp2; // mass action + +// Time event +time_event @TimeEvent {start: 10, period: 20}; +s1 [time_event]= 0.5; diff --git a/package.json b/package.json index 9eb8a1f..612aba2 100644 --- a/package.json +++ b/package.json @@ -1,4 +1,7 @@ { + "scripts": { + "start": "node js/create-prompt.js" + }, "dependencies": { "dotenv": "^16.4.5", "glob": "^10.4.2",