1
$\begingroup$

Now that Mathematica has already embedded Wolfram Alpha, so I'd like to plot a graph: "Air Density" - "Elevation".

I know that

input

yields

output

But I can't do that 10000 times. Is there any convenient way to do that? Such as Range[0,10000]?

$\endgroup$

1 Answer 1

2
$\begingroup$

One can just use StandardAtmosphereData[] instead:

ρ = Table[QuantityMagnitude[StandardAtmosphereData[Quantity[h, "Meters"], "Density"]],
          {h, 0, 10^4, 10}];

ListLinePlot[ρ, Axes -> None, Frame -> True,
             FrameLabel -> {"Height (m)", "Density (kg/m³"}]

density vs. height plot for air

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.