A list for the developers of CellML tools

Text archives Help


[cellml-dev] simulating model programmatically


Chronological Thread 
  • From: ak.miller at auckland.ac.nz (Andrew Miller)
  • Subject: [cellml-dev] simulating model programmatically
  • Date: Tue, 20 Dec 2011 23:10:09 +1300

On 20/12/11 22:30, Paolo Pannarale wrote:
> Dear Cellml Developers, I'm a PhD student in Bari and I'm developing a
> Java application based on the cellmlapi (cellml-sdk-1.10-Win32-MSVC10.
> exe, MingW didn't worked, generating a could not load dependent libaries
> exception). I need to programmatically solve a model and I got some clue
> about how to do it inspecting the opencell source code. I get an
> exception (Unexpected exception generating code) when calling
> cis.compileModelODE(model) and I guess this is because the api need a c
> compiler to compile the code. I tried to adding the following env
> variables but this didn't work. Can you pls help me?

Hi Paolo,

You do need a C compiler for CIS to work, but the error you are getting
indicates that something is going wrong earlier than that; it is likely
that the model you are testing with is invalid, under or
overconstrained, or beyond the solving capabilities of CIS.

Look at the interface defined in CCGS.idl to see how to interface with
the code generator - running it through the code generator, even with
default options, will give you a more detailed error about what is wrong
with the model. You can also use the VACSS service to do in depth
validation of a CellML model against the CellML specification (with
additional warnings about certain problems).

Best wishes,
Andrew

> BR, thanks, Paolo
>
> CELLML_HOME C:\Program Files (x86)\cellml-sdk-1.10_msvc
> PATH C:\Program Files (x86)\OpenCell\gcc\bin;C:\Program Files
> (x86)\OpenCell\gcc\libexec\gcc\mingw32\3.4.2;%CELLML_HOME%\lib
> LIBRARY_PATH C:\Program Files
> (x86)\OpenCell\gcc\lib\gcc\mingw32\3.4.2;C:\Program Files
> (x86)\OpenCell\gcc\lib
>
> the code i use is the following (the model is loaded properly, i can do
> a getcmetaid(), I use fully instantiate imports, i can simulate the
> model in opencell correctly)
>
> System.loadLibrary("java_cis");
> cis = cellml_bootstrap.CISBootstrap.createIntegrationService();
> Model model = (new ModelLoader(modelfile)).getModel();
> ODESolverCompiledModel oscm = cis.compileModelODE(model); >>
> Exception (Unexpected exception generating code)
> ODESolverRun osr = cis.createODEIntegrationRun(oscm);
> osr.setStepType(ODEIntegrationStepType.BDF_IMPLICIT_1_5_SOLVE);
> osr.setProgressObserver(this);
> double epsAbs=1E-6, epsRel=1E-6, scalVar=1, scalRate=0,
> maxstep=1, tabstepsize=0.01, startBvar=0, stopBvar=10, maxDensity=1000;
> boolean tabstrict = false;
> osr.setStepSizeControl(epsAbs, epsRel, scalVar, scalRate, maxstep);
> osr.setTabulationStepControl(tabstepsize, tabstrict);
> osr.setResultRange(startBvar, stopBvar, maxDensity);
> osr.start();
>
>
> --
> ?[M]y work, which I?ve done for a long time, was not pursued in order
> to gain the praise I now enjoy, but chiefly from a craving after
> knowledge, which I notice resides in me more than in most other
> men. And wherewithal, whenever I found out anything remarkable, I have
> thought it my duty to put down my discovery on paper, so that all
> ingenious people might be informed thereof.?
> (van Leeuwenhoek, Letter to the Royal Society, June 12 1716)
>
> ?Make it as simple as possible. But not simpler?.
> (Albert Einstein)
>
> "The best way to predict the future is to invent it".
> (Alan Kay)
>
> ___________________________________
>
> Questo documento ? indirizzato esclusivamente al destinatario.
> Tutte le informazioni ivi contenute, compresi eventuali allegati,
> sono soggette a riservatezza secondo i termini del D.Lgs. 196/2003
> in materia di "privacy" e ne ? proibito l'utilizzo da parte di
> altri soggetti. Se avesse ricevuto per errore questo messaggio,
> La preghiamo cortesemente di contattare il mittente al pi? presto
> e di cancellare il messaggio subito dopo. Grazie.
> ----
> This document is exclusively intended for the stated addressee.
> All information therein, including any attachment, are reserved
> as per Italian D.Lgs. 196/2003 about privacy, and cannot be used
> by third parties. In case you received this message by mistake,
> please inform the sender and delete the message afterward.
> Thank you.
>
>
> _______________________________________________
> cellml-tools-developers mailing list
> cellml-tools-developers at cellml.org
> http://lists.cellml.org/mailman/listinfo/cellml-tools-developers





Archive powered by MHonArc 2.6.18.

Top of page