CellML Discussion List

Text archives Help


[cellml-discussion] unit conversion


Chronological Thread 
  • From: ak.miller at auckland.ac.nz (Andrew Miller)
  • Subject: [cellml-discussion] unit conversion
  • Date: Thu, 29 May 2008 12:23:53 +1200

Erik Butterworth wrote:
> Since I don't know what CellML file you're talking about, I coded
> what I believe is the intended equation in JSim MML (attached). Let
> me know what is confusing about this encoding (if anything) of if I've
> missed the point. Different encodings will, natually, lead to
> different results.
> Running the model under JSim gives the correct answer in my mind:
>
> I_inter_fibro = 1E6 nanoamperes
Hi Erik, thanks for your reply.

I think James had something more along the lines of:
I_inter_fibro = 10^6 * (V_fibro - V) / R_mf
(where 10^6 is marked as a dimensionless number).

In this case the intention of the modeller is that the expression being
equated to I_inter_fibro is already in nanoamps, and this will give the
correct results in PCEnv and COR, I believe.

I agree that it would be better modelling practice to mark 10^6 as being
in units nanoamps per milliamps, and in this case PCEnv and COR will
give correct results of 1E6 nanoamperes (and I presume also JSim?).

At least my reading of the CellML specification is that tools should not
be automatically inserting conversion factors like this when processing
CellML models, although they may optionally warn the user that a
conversion factor may be missing and / or offer to insert it for them.

Best regards,
Andrew

>
> Erik Butterworth butterw at u.washington.edu 206-685-2007
>
> On Thu, 29 May 2008, Andrew Miller wrote:
>
>> Date: Thu, 29 May 2008 11:29:50 +1200
>> From: Andrew Miller <ak.miller at auckland.ac.nz>
>> To: James Lawson <j.lawson at auckland.ac.nz>
>> Cc: James Lawson <j.lawson at auckland.ac.nz>, butterw at u.washington.edu
>> Subject: Re: unit conversion
>>
>> James Lawson wrote:
>>> Hi Andrew, Justin,
>>>
>>> Thanks for your help. Basically, I've had to multiply a current by a
>>> scaling factor of 1 million to get the model to run in PCEnv. It was
>>> made in Jsim and worked fine, but now I have a model that will run
>>> in PCEnv but not Jsim. Do you guys have any idea about what I could
>>> do to get it running in both? Would showing you the model help? I
>>> could email the Jsim guys and ask them if I knew what to ask.. It
>>> seems like Jsim doesn't really convert nanoamps into 10e-6 amps and
>>> work with the value from there, whereas PCEnv does. Would this be
>>> right?
>>>
>>> Basically the issue that I have addressed is that units for the
>>> variables in the equation for I_inter_fibro aren't dimensionally
>>> equivalent:
>>>
>>> The equation is: I_inter_fibro =(V_fibro - V) / R_mf
>>>
>>> Where I_inter_fibro is in nanoamperes, V_fibro and V are in
>>> millivolts and R_mf is in ohms. So the equation says that nanoamps =
>>> millivolts / ohms. Thus I have changed the equation to say
>>> I_inter_fibro = 1e+06 * (V_fibro - V) / R_mf
>> Hi James,
>>
>> What are the units on the 1E6 scaling factor? If you put them in
>> nanoamps_per_milliamp or something like that, then I think all
>> software should do the right thing. Automatically inserting the
>> conversion factor is not the correct software behaviour however; at
>> most software should be flagging the problem and helping the user to
>> insert the factor if they decide there is an actual problem.
>>
>> Best regards,
>> Andrew
>>
>>>
>>> So at the moment I do not know how to get the model to run in both
>>> PCEnv and Jsim. What I'll do is upload a variant of the model to the
>>> repository with different curation notes, but ideally I should be
>>> able to get one model that runs in both environments. This looks
>>> like it might be a pretty persistent problem unfortunately.
>>>
>>> Thanks,
>>> James
>>>
>>> Andrew Miller wrote:
>>>> James Lawson wrote:
>>>>> Hi guys,
>>>>>
>>>>> I was wondering if you might be able to help me out with a
>>>>> curation issue. I've been working on a model that was tested in
>>>>> Jsim that just wasn't producing the right results in PCEnv.
>>>>> Finally I figured out that it was something to do with the
>>>>> magnitude of a current being out by a factor of a million - milli
>>>>> to nano. So obviously this is something to do with unit
>>>>> conversions being applied in one tool and not the other. I was
>>>>> under the impression that it was Jsim that doesn't apply units
>>>>> conversions and PCEnv and COR that do - am I right here? I'm
>>>>> worried that having fixed the model under PCEnv, I've broken it
>>>>> under Jsim. Could you guys please explain here?
>>>>>
>>>>> I do have JSim on my computer but I'm unable to figure out how to
>>>>> import a CellML file into it and run it.
>>>> PCEnv carries out units conversions at the connections (so if you
>>>> cannot something in millimol/L to something in nanomol/L it will
>>>> convert for you; this is what the CellML specificatin requires).
>>>> COR doesn't do this, and instead gives an error if you try to
>>>> connect variables in diffferent units. I've heard that some
>>>> versions of JSim try to actually change the maths to insert
>>>> conversion factors in at the equation level - but I believe this is
>>>> usually turned off.
>>>>
>>>> Best regards,
>>>> Andrew
>>>
>>
>>




  • [cellml-discussion] unit conversion, Andrew Miller, 05/29/2008

Archive powered by MHonArc 2.6.18.

Top of page