Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #16197 > unrolled thread

Re: Unit conversion of a list of quantities

Started byAlexei Boulbitch <Alexei.Boulbitch@iee.lu>
First post2013-11-08 20:46 +0000
Last post2013-11-08 20:46 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: Unit conversion of a list of quantities Alexei Boulbitch <Alexei.Boulbitch@iee.lu> - 2013-11-08 20:46 +0000

#16197 — Re: Unit conversion of a list of quantities

FromAlexei Boulbitch <Alexei.Boulbitch@iee.lu>
Date2013-11-08 20:46 +0000
SubjectRe: Unit conversion of a list of quantities
Message-ID<l5jiin$lov$1@smc.vnet.net>
I have the following lists:
Edep = {4.9491200000000017`*^-14 Joules,
  1.8669264000000004`*^-14 Joules, 6.223088000000001`*^-15 Joules}
mass = {0.043937500000000004` g, 0.06987` g, 0.02329` g}

I want to calculate dose:
dose = Edep/mass

I get another list (of Quantities):

{(1.1264*10^-12 Joules)/g, (2.672*10^-13 Joules)/g, (
 2.672*10^-13 Joules)/g}

OK, but I want to have Grays, ie. Joules/kg:

UnitConvert[dose, "Joules/kg"]

Unfortunately output is not what I want:
{UnitConvert[(1.1264*10^-12 Joules)/g, "Joules/kg"],
 UnitConvert[(2.672*10^-13 Joules)/g, "Joules/kg"],
 UnitConvert[(2.672*10^-13 Joules)/g, "Joules/kg"]}


How to get Mathematica to convert J/g to J/kg?
Mathematica 9.0.1 on linux.

Regards, Mariusz


Hi, Mariusz,

These are your lists:

Edep={4.94912*^-14 J,1.8669264*^-14 J,6.223088*^-15 J};
mass={0.0439375 g,0.06987` g,0.02329` g};
dose = Edep/mass;

Now, you can transform grams into kilograms in several ways. One is the ReplaceAll

dose /. g -> 10^-3*kg

{(1.1264*10^-9 J)/kg, (2.672*10^-10 J)/kg, (2.672*10^-10 J)/kg}

Or directly into the Grays:

dose /. g -> 10^-3*kg /. J -> Gy*kg

{1.1264*10^-9 Gy, 2.672*10^-10 Gy, 2.672*10^-10 Gy}

Have fun, Alexei

Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone :  +352-2454-2566
Office fax:       +352-2454-3566
mobile phone:  +49 151 52 40 66 44

e-mail: alexei.boulbitch@iee.lu


[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web