Solve Equations with Units
Solve Equations with Units
Solve equations with units using both symbolic and numerical functions.
inputs = {HoldForm[Solve[Quantity[2.2*^12, "Joules"] == (1/2)(Quantity[68000., "Kilograms"]) * v ^ 2, v]], HoldForm[Solve[Quantity[133.333, ("Meters"/"SpeedOfLight")] == Sqrt[1 / (1 - (.3 ^ 2))] t, t]], HoldForm[Solve[Quantity[8.444, "Microcoulombs"] == x * Quantity[1, "DegreesCelsius"], x]], HoldForm[NSolve[Quantity[3.21608 * 10 ^ 20, "Hertz"] == (Quantity[1, "SpeedOfLight"]/x), x]], HoldForm[NSolve[(Quantity[1, "PlanckConstant"]/x Quantity[6.646478 * 10 ^ -27, "Kilograms"]) == Quantity[14.8732 * 10 ^ -15, "Meters"], x]], HoldForm[N[Reduce[(1/x * Quantity[1, "Kilometers" / "Seconds" / "Megaparsecs"]) == 6000, x]]]};FormulaGallery[forms_List] := Module[{vals = ParallelMap[ReleaseHold, forms]}, TraditionalForm@Grid[Table[{forms[[i]], vals[[i]]}, {i, Length[forms]}], Dividers -> All, Spacings -> {{1, 1}, 5}, Alignment -> {{Left, Left}, Baseline}, BaseStyle -> {FontFamily -> "Verdana"}, Background -> {None, {{Lighter[Blend[{Blue, Green}], .6], StandardGray}}}]]Pane[FormulaGallery[inputs], 550]