Group Abstract Group Abstract

Message Boards Message Boards

DimensionalCombinations such that solutions can be numerically evaluated?

Posted 3 years ago

How does one specify a QuantityVariable within a DimensionalCombinations invocation such that a resulting expression can be used in a substitution thence evaluation of a numeric Quantity? At the end of the attached notebook, notice that I had to strip off the expression that contained the QuantityVariable from the desired solution to DimensionalCombinations and do a manual substitution of the original Quantity so it could be numerically evaluated and converted into the desired units.

POSTED BY: James Bowery
3 Replies
POSTED BY: Jason Martinez
POSTED BY: Daniel Lichtblau

I will suggest naming intermediate computations and avoiding use of the percent operator %.

As for what went wrong, it involves use of QuantityVariable and I do not know if it is a bug or a misuse. The gist is that at least in some cases you will need to explicitly evaluate the second argument. The minor variation of your code below seems to give a plausible result.

mm = mUmaximum /. Solve[Sqrt[
             c^5/((4 Pi)^2*G blackbodyEmissivity BoltzmannConstant *
                   CBRTemp^4)] == (2 G mUmaximum)/
         c^2 + (4 G \[Pi] mUmaximum)/c^2 - (
               4 G \[Pi] Cos[(c^3 t)/(G mUmaximum)] mUmaximum)/c^2 /. 
      t -> 0, 
       mUmaximum] /. {t -> 0, 
      BoltzmannConstant -> Quantity[1, "StefanBoltzmannConstant"], 
      blackbodyEmissivity -> 
        Quantity[1, "Joules"/("Meters"*"Meters"*"Seconds")], 
      G -> Quantity[1, "GravitationalConstant"], 
      c -> Quantity[1, "SpeedOfLight"], 
    CBRTemp -> Quantity[2.73, "Kelvins"]};

qu = QuantityUnit[First[mm]];
ud = UnitDimensions[qu]

(* Out[531]= {{"MassUnit", 1/2}, {"TimeUnit", 3/2}} *)

dc = DimensionalCombinations[
   {QuantityVariable["mUmx", Evaluate@ud]},
   QuantityVariable["mss", "Mass"],
   IncludeQuantities -> "PhysicalConstants",
    GeneratedParameters -> None
   ];
ne = First[Rest[dc]]

(* Out[534]= (Quantity[1, ("SpeedOfLight")^(9/4)/(
   "GravitationalConstant")^(3/4)]) Sqrt[QuantityVariable[
 "mUmx",{{"MassUnit", 1/2}, {"TimeUnit", 3/2}}]] *)
POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard