CellML Discussion List

Text archives Help


[cellml-discussion] (OT) the nature of 'mole' | Re: unit conversion


Chronological Thread 
  • From: m.cooling at auckland.ac.nz (Mike Cooling)
  • Subject: [cellml-discussion] (OT) the nature of 'mole' | Re: unit conversion
  • Date: Tue, 3 Jun 2008 13:05:58 +1200

Hmmm well SI says
http://physics.nist.gov/cuu/Units/current.html
:

Mole: "amount of substance"

1. The mole is the amount of substance of a system which contains as
many elementary entities as there are atoms in 0.012 kilogram of carbon 12;
its symbol is "mol."

2. When the mole is used, the elementary entities must be specified
and may be atoms, molecules, ions, electrons, other particles, or specified
groups of such particles.

Notice groups. So it depends on the definitions of 'elementary entities' and
'particles'. I think that would hold for bread rolls as well as galaxies -
them also being specified groups of such particles - depending on your level
of abstraction.

I suppose technically the above may not apply to concepts. So I could have a
score of philosophies but apparently not a mole of philosophies. But that
might depend on your view of 'substance' (which I would presume means 'has
some mass'...although that would overlap slightly with 'kilogram').

Perhaps this is best resolved in CellML by incorporating common scaling
factors into a 'common units' file that we were talking about some months
ago. Using built-in moles when talking about substance, and a scaling factor
when/if discussing ephemeral things.

Mike.



-----Original Message-----
From: cellml-discussion-bounces at cellml.org
[mailto:cellml-discussion-bounces at cellml.org] On Behalf Of James Lawson
Sent: Tuesday, 3 June 2008 12:11 p.m.
To: CellML Discussion List
Subject: [cellml-discussion] (OT) the nature of 'mole' | Re: unit conversion

Hi guys,

This is a little OT for CellML-discussion, IMO.
>
> Although you can technically talk about a mole of anything,

I take issue with this. You can talk about 6.23e26 of anything, but when you
talk about a mole of something it *MUST* be atoms or molecules. It is not
just a term like 'score' where you can have a 'score' of anything.|

Wikipedia explains this pretty succinctly.

"According to the SI, the mole is not dimensionless, but has its very own
dimension, "amount of substance", comparable to other dimensions such as
mass and luminous intensity. (By contrast, the SI specifically defines the
radian and the steradian as special names for the dimensionless unit one.)"

A mole specifically refers to a large number of atoms.

"The ampere is a base unit, along with the metre, kelvin, second, mole,
candela and the kilogram: it is defined without reference to the quantity
of electric charge."

So the mole is essentially comprised of a scaling factor applied to 'stuff'
where 'stuff' is in the form of 'atom/molecule.' I recognise that this is
'according to the SI' - but when we're talking about units, consensus on
what the unit means is extremely important.

Kind regards,
James
> the way it
> is used by the SI system of units, it is always talking about a mole
> of some kind of particle, whether that particle is an electron or some
> large protein. As such, mole, when used in this sense, truly is a unit
> as the term is used in CellML, rather than just a scaling factor (and
> in fact, it would make sense to define a 'particle' derived unit in
> terms of mole using a multiplier of the inverse of Avogadro's number).
>
>
>> We might also include built-in scaling factors for converting between
>> prefixes. For example if I have a variable A in nanomolar and another
>> B in micromolar I might want to say:
>>
>> A = 1e3 * B
>>
>> One way to do this is to define a scaling factor unit say (in
>> CORspeak)
>>
>> def unit nanospermicro from
>> unit liter {pref: nano};
>> unit liter {pref: micro, expo:-1};
>> enddef;
>>
>> and then have
>>
>> A = 1e3 {nanospermicro} * B.
>>
>> Which is slightly clunky.
>>
>>
>
> This is a perfectly valid way of expressing the model, and if
> necessary, editing tools could help the user to create such units as
> required - we shouldn't complicate the specification substantially for
> processing tools based on what might make it easier to do something
> with current editing tools, because editing tools will have to change
> for CellML 1.2 anyway.
>
>
>> (I think the use of 'liter' above should also be replaced with
>> 'dimensionless', but that is a different issue).
>>
>>
> It doesn't really make sense to say nanodimensionless per
> microdimensionless, I prefer nanolitres per microlitre even though you
> need to duplicate it if you have other conversion factors.
>
>> We could also include dozen, which would aid the bakery-modelling
>> community too ;).
>>
>>
>
> If we are talking about dozens of particles, that can already be done
> in terms of moles easily using multiplier 12 / nA (i.e.
> 1.99264653979527 *
> 10^-23)
>
> Best regards,
> Andrew
>
>
>> -----Original Message-----
>> From: cellml-discussion-bounces at cellml.org
>> [mailto:cellml-discussion-bounces at cellml.org] On Behalf Of Peter
>> Hunter
>> Sent: Tuesday, 3 June 2008 11:35 a.m.
>> To: CellML Discussion List
>> Subject: Re: [cellml-discussion] unit conversion
>>
>> Hi Mike,
>>
>> I agree - but there they are in the SI base unit list see
>> http://physics.nist.gov/cuu/Units/units.html
>> so probably 150 years too late to do much about it!
>>
>> Cheers,
>> Peter
>>
>> Mike Cooling wrote:
>>
>>
>>> Does it strike anyone else as inconsistent that 'moles' are a unit
>>> when moles are just a scaling factor? Like dozen. Maybe they should
>>> be implemented using 'multiplier' or similar rather than a base unit.
>>>
>>> For example, I could have a mole of amps. I couldn't have a second
>>> of
>>>
>>>
>> amps.
>>
>>
>>> -----Original Message-----
>>> From: cellml-discussion-bounces at cellml.org
>>> [mailto:cellml-discussion-bounces at cellml.org] On Behalf Of James
>>> Lawson
>>> Sent: Tuesday, 3 June 2008 11:07 a.m.
>>> To: Erik B
>>> Cc: cellml-discussion at cellml.org
>>> Subject: Re: [cellml-discussion] unit conversion
>>>
>>> Thanks Erik,
>>>
>>> I managed to fix the issue before receiving your email, but this
>>> clears things up for me very concisely. I would venture to say that
>>> the reason that so many CellML models in the CellML repository do
>>> not pass Jsim's units checking is not because of CellML, or any
>>> tools used to create CellML models. Rather it is often because the
>>> models themselves contain unit inconsistencies. It does not help
>>> that units are irrelevant to most modelling tools, but I think the
>>> modelling community is starting to raise the bar with regards to this
issue.
>>> Unfortunately it is often quite difficult to 'fix' inappropriate
>>> units (both quantitatively and
>>> qualitatively,) in a model without breaking it.
>>>
>>> FYI I've uploaded the model in question, which now runs in Jsim, COR
>>> and PCEnv, at:
>>> http://www.cellml.org/models/sachse_moreno_abildskov_2008_version02
>>>
>>> The 'auto' setting for the integrator in Jsim will not run the model
>>> - the CVode integrator must be selected manually.
>>>
>>> Kind regards,
>>> James Lawson
>>>
>>> Erik Butterworth wrote:
>>>
>>>
>>>> On Thu, 29 May 2008, Andrew Miller wrote:
>>>>
>>>>
>>>>
>>>>> 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?).
>>
>>
>>>> Short answer: yes.
>>>>
>>>> Long answer: JSim has two unit conversion modes, on and off.
>>>> With conversion on, the simplest correct formation in MML is
>>>>
>>>> 1. I_inter_fibro = (V_fibro - V) / R_mf;
>>>>
>>>> With unit conversion off, the simplest correct formation is:
>>>>
>>>> 2. I_inter_fibro = 10^6 * (V_fibro - V) / R_mf;
>>>>
>>>> With either unit conversion on or off, a dimensionalized constant
>>>> will produce correct results, at the expense of conciseness:
>>>>
>>>> 3. I_inter_fibro = (10^6 nanoamp/milliamp) * (V_fibro - V) /
>>>> R_mf;
>>>>
>>>> To be compatible with (my understanding of) the CellML units
>>>> spec, JSim's CellML -> MML converter creates MML with unit conversion
on.
>>>> However, due the the historically large (although perhaps
>>>> decreasing) number of CellML models that didn't pass JSim unit
>>>> balance, the JSim WWW site provides (for CellML models not passing
>>>> unit balance) an "imperfect" MML translation with unit conversion
>>>> off. This allows the models to be compiled and run, even if they
>>>> may need conversion factor editing. Even if the CellML model
>>>> doesn't pass JSim unit balance, it would still run correctly if all
>>>> needed conversion factors were in the CellML in form #3 above.
>>>>
>>>> Hope this helps,
>>>>
>>>> Erik B.
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> 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 mailing list
>>> cellml-discussion at cellml.org
>>> http://www.cellml.org/mailman/listinfo/cellml-discussion
>>>
>>>
>> _______________________________________________
>> cellml-discussion mailing list
>> cellml-discussion at cellml.org
>> http://www.cellml.org/mailman/listinfo/cellml-discussion
>>
>>
>
> _______________________________________________
> cellml-discussion mailing list
> cellml-discussion at cellml.org
> http://www.cellml.org/mailman/listinfo/cellml-discussion
>






Archive powered by MHonArc 2.6.18.

Top of page