Skip to content

Commit 5e382b8

Browse files
committed
Create a test for formPropensitiesGeneral failure in subsequent runs using clearall
The "clearall" command does not actually clear symbolic expressions, variables, etc. for me in Matlab R2024a in subsequent runs. The "clear" command does. However, Dmitri reports not encountering this issue.
1 parent e1f0715 commit 5e382b8

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

tests/known_errors/clearallTest.m

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
classdef clearallTest < matlab.unittest.TestCase
2+
3+
methods (Test)
4+
function clear(testCase1)
5+
for i=1:6
6+
7+
clear; clc; close all
8+
addpath(genpath('../src'));
9+
10+
%% From STEP1 of example_DUSP1_Regulation.m
11+
Model1 = SSIT;
12+
Model1.species = {'offGene';'onGene';'rna'};
13+
Model1.initialCondition = [2;0;0];
14+
Model1.propensityFunctions = {'kon*IGR*offGene';'koff*onGene';'kr*onGene';'gr*rna'};
15+
Model1.inputExpressions = {'IGR','1+a1*exp(-r1*t)*(1-exp(-r2*t))*(t>0)'};
16+
Model1.stoichiometry = [-1,1,0,0;1,-1,0,0;0,0,1,-1];
17+
Model1.parameters = ({'koff',0.014;'kon',0.002;'kr',1;'gr',0.004;...
18+
'a1',20;'r1',0.04;'r2',0.1});
19+
Model1.fspOptions.initApproxSS = true;
20+
Model1.summarizeModel
21+
Model1 = Model1.formPropensitiesGeneral('ToyDUSP1Model');
22+
end
23+
end
24+
function clearall(testCase2)
25+
for i=1:6
26+
27+
clear all; clc; close all
28+
addpath(genpath('../src'));
29+
30+
%% From STEP1 of example_DUSP1_Regulation.m
31+
Model1 = SSIT;
32+
Model1.species = {'offGene';'onGene';'rna'};
33+
Model1.initialCondition = [2;0;0];
34+
Model1.propensityFunctions = {'kon*IGR*offGene';'koff*onGene';'kr*onGene';'gr*rna'};
35+
Model1.inputExpressions = {'IGR','1+a1*exp(-r1*t)*(1-exp(-r2*t))*(t>0)'};
36+
Model1.stoichiometry = [-1,1,0,0;1,-1,0,0;0,0,1,-1];
37+
Model1.parameters = ({'koff',0.014;'kon',0.002;'kr',1;'gr',0.004;...
38+
'a1',20;'r1',0.04;'r2',0.1});
39+
Model1.fspOptions.initApproxSS = true;
40+
Model1.summarizeModel
41+
Model1 = Model1.formPropensitiesGeneral('ToyDUSP1Model');
42+
end
43+
end
44+
end
45+
end

0 commit comments

Comments
 (0)