File Exchange

image thumbnail

Standard Atmosphere Calculator

version 1.0 (2.29 KB) by

Calculates pressure, density, temperature, and speed of sound as a function of height.

3.09091
11 Ratings

6 Downloads

Updated

View License

Using the 1976 US standard atmosphere model, this function returns pressure, denisity, temperature, and speed of sound at a given altitude. Works for both English and metric units.

Comments and Ratings (12)

liang he

Michael Young

Errors in calculated values. Don't Use

Brad Hixon

Accuracy is far below what is required in most aerospace classes now

Richard Rieber

I have no plans about maintaining this function or improving its accuracy. Brent Lewis has written a much better function that includes altitudes upwards of 2000 km and also molecular composition. This is excellent for both aircraft, rockets, and for use in atmospheric drag calculations.

If you require high degrees of accuracy and the more complete version, please use Mr. Lewis' software. However, if you need a simple function with lower accuracy, by all means, try mine.

Caleb Weitz

Very rough values for constants and sloppy coding. Think about recoding.

Brent Lewis

Only covers less than 10% of the 1976 Standard Atmosphere(what is that half a star :) ). Might try the COMPLETE 1976 standard atmosphere. See ya in class(or the bar) Rich

Tom Terrell

Careful on the accuracy of this program, it is based on an obsolete atmosphere model

Eric Wendel

Also, I think line 112 should read:
"[TNew, PNew, RhoNew] = Gradient(H5, H6, TNew, PNew, RhoNew, L6)"

It would also be very helpful if the input were allowed to be a vector.

Lance Locey

Denis Fefelov

Ramji Srimurugan

matt b

Needed to modify it to work with my version of matlab,
[mat] = atmosphere(...)
...
mat = [t, p,rho,a]

Updates

Was informed about bad returns for density and that the code referenced a 1958 standard atmosphere. The density has been fixed and all altitude and lapse rates have been updated to the 1976 version.

Found some big bugs in it that made the function not work. Everything is all better now ^_^

MATLAB Release
MATLAB 6.5 (R13)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video