Re: Unit conversion of a list of quantities
- To: mathgroup at smc.vnet.net
- Subject: [mg131982] Re: Unit conversion of a list of quantities
- From: Alexei Boulbitch <Alexei.Boulbitch at iee.lu>
- Date: Fri, 8 Nov 2013 16:25:25 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-outx@smc.vnet.net
- Delivered-to: mathgroup-newsendx@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 at iee.lu