Skip to content

Commit 95bf2aa

Browse files
committed
WIP: more sanity checks
1 parent e168360 commit 95bf2aa

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

vcell-core/src/main/java/cbit/vcell/mapping/ReactionRuleSpec.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,12 +1339,14 @@ public boolean checkOnRate(SiteAttributesSpec sasOne, SiteAttributesSpec sasTwo)
13391339
}
13401340
double kon = Double.parseDouble(lp.getExpression().infix());
13411341
// TODO: check all scaling
1342-
double kon_scale = 1660000.0 * kon; // Kon also needs some conversion (TODO: why?)
1342+
double kon_scale = 1660000.0 * kon; // Kon also needs some conversion (micromolar -> particles)
13431343
double D_scale = D * 1000000.0; // D is in um^2/s, convert to nm^2/s
13441344

1345-
double rhs1 = 4.0*Math.PI*R*D_scale;
1345+
double kD = 4.0*Math.PI*R*D_scale;
13461346

1347-
boolean check = (kon_scale < rhs1);
1347+
// double kOnIntrinsic = (rescalekon * kD) / (kD - rescalekon); cannot be negative,
1348+
// hence kD must be > kon_scale
1349+
boolean check = (kon_scale < kD);
13481350
return check;
13491351
}
13501352

vcell-core/src/main/java/cbit/vcell/mapping/SpeciesContextSpec.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,6 +1504,11 @@ public void gatherIssues(IssueContext issueContext, List<Issue> issueVector){
15041504
return;
15051505
}
15061506

1507+
// TODO: diameter of each site must be smaller than partition size on x, y, z
1508+
1509+
// TODO: diffusion speed * dt must be smaller than the partition size on x, y, z so that the particle
1510+
// won't be able to jump outside the current partition or its neighboring partitions
1511+
15071512
// rate rules and assignment rules are not permitted
15081513
// normally it is not possible to create RateRule or AssignmentRule using the vcell UI, the Protocols subpanels are disabled
15091514
// we check this just in case the user is very crafty and finds a way

0 commit comments

Comments
 (0)