From b79aecfda1c5ba424f18f071c82d6d6d3ee6cb9d Mon Sep 17 00:00:00 2001 From: "Ankur Sinha (Ankur Sinha Gmail)" Date: Fri, 14 Jun 2024 17:06:01 +0100 Subject: [PATCH 1/2] fix(sbml-import): make TimeDerivative rhs have a `per_time` dimension Otherwise we end up with dimensionally incorrect values: ``` ``` It'll now be: ``` ``` where `tscale` has dimensions `per_time`. --- src/main/java/org/neuroml/importer/sbml/SBMLImporter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/neuroml/importer/sbml/SBMLImporter.java b/src/main/java/org/neuroml/importer/sbml/SBMLImporter.java index 3c84cc4..5317e84 100644 --- a/src/main/java/org/neuroml/importer/sbml/SBMLImporter.java +++ b/src/main/java/org/neuroml/importer/sbml/SBMLImporter.java @@ -831,7 +831,7 @@ else if (r.isAssignment()) { E.info(">>>> StateVariable "+sv); dyn.stateVariables.add(sv); - TimeDerivative td = new TimeDerivative(sv.getName(), "1"); + TimeDerivative td = new TimeDerivative(sv.getName(), timeScale.getName() + "* 1"); dyn.timeDerivatives.add(td); } From cb2c52d1cceba7abfc7f0dc270cd14d4dc89ce59 Mon Sep 17 00:00:00 2001 From: pgleeson Date: Mon, 17 Jun 2024 14:47:18 +0100 Subject: [PATCH 2/2] Adding volt as known sbml unit. --- src/main/java/org/neuroml/importer/sbml/SBMLImporter.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/neuroml/importer/sbml/SBMLImporter.java b/src/main/java/org/neuroml/importer/sbml/SBMLImporter.java index 5317e84..59f96b5 100644 --- a/src/main/java/org/neuroml/importer/sbml/SBMLImporter.java +++ b/src/main/java/org/neuroml/importer/sbml/SBMLImporter.java @@ -314,6 +314,11 @@ public static Lems convertSBMLToLEMS(File sbmlFile, float simDuration, float sim newDim.setN(newDim.getN() + exponent * 1); } else if (kind.equals("second")) { newDim.setT(newDim.getT() + exponent * 1); + } else if (kind.equals("volt")) { + newDim.setM(newDim.getM() + exponent * 1); + newDim.setL(newDim.getL() + exponent * 2); + newDim.setT(newDim.getT() + exponent * -3); + newDim.setI(newDim.getI() + exponent * -1); } else { //TODO: Add all unit kinds from section 4.4.2 in SBML specs: http://sbml.org/Documents/Specifications System.err.print("Add more unit definitions! Missing: "+kind);