NSR-Physiome / JSim

JSim is a Java-based simulation system for building quantitative numeric models and analyzing them with respect to experimental reference data. JSim's primary focus is in physiology and biomedicine, however its computational engine is quite general and applicable to a wide range of scientific domains.
http://www.physiome.org/jsim/
5 stars 4 forks source link

Invalid CellMl export #1

Open filip-jezek opened 5 years ago

filip-jezek commented 5 years ago

Hi, I am trying several tooling options and I thought JSim is the most universal man-in-the-middle between SBML, CellMl and other languages. I tried to import CellMl model ( https://models.cellml.org/workspace/smith_chase_nokes_shaw_wake_2004/file/f7b732c9707abdba5a55d471c49baf7dee92b036/smith_chase_nokes_shaw_wake_2004.cellml ) which was successful and, after fiddling with the non-linear zero finders a bit (neldermead instead of simplex), possible to simulate.

However, when I tried to export it back to CellMl, it produces some code, which is however invalid (I personally tried OpenCOR, but reportedly also in COR).

Can you confirm it is a bug in JSim?

Thanks!

NSR-Physiome commented 5 years ago

I can take a look at the translation issue. Does the cellml model run in openCOR (without translating it to JSim)? I see there is a note at the beginning stating it does not run in COR:

I will take a look at the JSim translation back into cellml and see if there is an issue.

Thanks for your time, -Bart Jardine

Research Engineer, 206-685-2006 Dept. of Bioengineering, University of Washington

On Tue, Jan 22, 2019 at 4:12 PM Filip Ježek notifications@github.com wrote:

Hi, I am trying several tooling options and I thought JSim is the most universal man-in-the-middle between SBML, CellMl and other languages. I tried to import CellMl model ( https://models.cellml.org/workspace/smith_chase_nokes_shaw_wake_2004/file/f7b732c9707abdba5a55d471c49baf7dee92b036/smith_chase_nokes_shaw_wake_2004.cellml ) which was successful and, after fiddling with the non-linear zero finders a bit (neldermead instead of simplex), possible to simulate.

However, when I tried to export it back to CellMl, it produces some code, which is however invalid (I personally tried OpenCOR, but reportedly also in COR).

Can you confirm it is a bug in JSim?

Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/NSR-Physiome/JSim/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AHCQO0ItHSYohApSNQ047AzAgO7K7gRnks5vF6jigaJpZM4aNxnd .

filip-jezek commented 5 years ago

Thanks for YOUR time! Yes, the model runs in OpenCOR with only a slight modification and that is workaround for DAE notation - see https://gist.github.com/filip-jezek/24aaaf8cd5c04fdf8c7435afbd4e4a4a . But I think JSim run fine even without this workaround. The problem is that the OpenCOR could not even open the code generated from JSim, so the problem is on another level.

Thanks again! F/

NSR-Physiome commented 5 years ago

There is a bug in JSim translation back to cellml. When I open the translation in OpenCOR (2015-jun version) i get the following error:

/smith_chase_2004_transFromJSim.cellml Runtime: invalid. Error: the model is underconstrained (i.e. some variables need to be initialised or computed).

Along with this error:

[80] A 'math' element was found in the original CellML file, but it is not known and cannot therefore be processed.

I will take a look at the issue and thanks for reporting the bug. Does OpenCOR support import of SBML models? I was trying to see if JSim's SBML version would be readable in OpenCOR.

The JSim SBML version opened in COPASI and I get warnings as well (but a little more detailed, which should allow me to debug) but I can run a short simulation on it, longer if I fiddle with the initial values, time-step, ODE solver, etc.

ERROR 2019-01-23 09:31:16<

SBML (43): No initial value set for global parameter "V_spt". Setting initial value to 1.0

WARNING 2019-01-23 09:31:16<

SBML (3): The SBML document contains algebraic rules that were ignored. Entities determined by those rules are probably undetermined now.

WARNING 2019-01-23 09:31:15<

SBML (26): Units for some parameters were ignored. Units might be displayed incorrectly.

Parameters: V_rvf, V_tot, V_d_lvf, V_lv, one, P_rvf, V_rv, Q_pul, V_pcd, R_sys, V_lvf, L_pv, E_es_ao, P_peri, P_pcd, P_pu, V_d_pu, P_lvf, Q_pv, Q_sys, R_pv, lambda_spt, P_pa, V_d_pa, P_vc, E_es_spt, V_d_vc, V_pu, P_ed_rvf, lambda_rvf, V_0_spt, E_es_rvf, P_0_spt, V_pa, period, V_vc, L_av, C, B, A, L_tc, V_0_rvf, P_es_rvf, lambda_pcd, L_mt, P_0_rvf, P_ed_lvf, lambda_lvf, P_th, E_es_pu, V_d_spt, E_es_lvf, Q_av, P_ao, Q_tc, V_d_ao, R_av, e_t, R_tc, Q_mt, V_0_pcd, E_es_pa, R_mt, P_0_pcd, E_es_vc, V_spt, V_0_lvf, P_es_lvf, V_d_rvf, P_0_lvf, V_ao, R_pul, P_lv, P_rv, tau

WARNING 2019-01-23 09:31:15<

SBML (40): LIBSBML WARNING 80702 at line 200 column 6: As a principle of best modeling practice, the should set an initial value rather than be left undefined. Doing so improves the portability of models between different simulation and analysis systems, and helps make it easier to detect potential errors in models.

The with the id 'V_spt' does not have 'value' attribute, nor is its initial value set by an or .

Thanks, -Bart

On Tue, Jan 22, 2019 at 5:06 PM Filip Ježek notifications@github.com wrote:

Thanks for YOUR time! Yes, the model runs in OpenCOR with only a slight modification and that is workaround for DAE notation - see https://gist.github.com/filip-jezek/24aaaf8cd5c04fdf8c7435afbd4e4a4a . But I think JSim run fine even without this workaround. The problem is that the OpenCOR could not even open the code generated from JSim, so the problem is on another level.

Thanks again! F/

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/NSR-Physiome/JSim/issues/1#issuecomment-456626379, or mute the thread https://github.com/notifications/unsubscribe-auth/AHCQO11a3MOhg5NTzFgQ-VUqo6tI2y5mks5vF7V_gaJpZM4aNxnd .

filip-jezek commented 5 years ago

No, I do not think the OpenCOR supports SBML.