Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #16197
| From | Alexei Boulbitch <Alexei.Boulbitch@iee.lu> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Unit conversion of a list of quantities |
| Date | 2013-11-08 20:46 +0000 |
| Message-ID | <l5jiin$lov$1@smc.vnet.net> (permalink) |
| Organization | Time-Warner Telecom |
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
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Unit conversion of a list of quantities Alexei Boulbitch <Alexei.Boulbitch@iee.lu> - 2013-11-08 20:46 +0000
csiph-web