From f38eaa4c64b3250d410f6f0ecb2acaadf7e42369 Mon Sep 17 00:00:00 2001 From: "Frank T. Bergmann" Date: Wed, 2 Oct 2024 21:25:09 +0200 Subject: [PATCH] - add mca test --- examples/react-copasi/package-lock.json | 1 + test/test_node.js | 46 +++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/examples/react-copasi/package-lock.json b/examples/react-copasi/package-lock.json index 7a3a069..514935a 100644 --- a/examples/react-copasi/package-lock.json +++ b/examples/react-copasi/package-lock.json @@ -5,6 +5,7 @@ "requires": true, "packages": { "": { + "name": "react-copasi", "version": "0.1.0", "dependencies": { "@testing-library/jest-dom": "^5.17.0", diff --git a/test/test_node.js b/test/test_node.js index bb20081..7023bf1 100644 --- a/test/test_node.js +++ b/test/test_node.js @@ -74,3 +74,49 @@ createApi().then((Module) => { console.log(instance.eigenValuesReduced2D); }); + + +createApi().then((Module) => { + + // instantiate COPASI simulator + var instance = new COPASI(Module); + + // check version + console.log('Using COPASI: ', instance.version); + + // load a local file using the filesystem + var data = fs.readFileSync(process.argv[2], 'utf8'); + + // print model structure + console.log(instance.loadModel(data)); + + var selection = instance.selectionList; + selection.push("EE(J0,S1)") + + + console.log(selection); + instance.selectionList = selection; + + var result = instance.simulateEx(0, 10, 11); + console.log(result); + + // compute mca + instance.computeMca(true); + + // print control coefficients + console.log("Flux control coefficients: "); + console.log(instance.getFluxControlCoefficients(true)); + console.log(instance.getFluxControlCoefficients(false)); + + console.log("Concentration control coefficients: "); + console.log(instance.getConcentrationControlCoefficients(true)); + console.log(instance.getConcentrationControlCoefficients(false)); + + console.log("Elasticities: "); + console.log(instance.getElasticities(true)); + console.log(instance.getElasticities(false)); + + instance.reset(); + + +});