资源简介
大气参数matlab计算代码,只需输入高度参数即可,计算可得到某一高度下的大气参数
代码片段和文件信息
% function [t p rho a] = atmosphere(height unit)
% Richard Rieber
% rrieber@gmail.com
% Updated 3/17/2006
%
% Function to determine temperature pressure density and speed of sound
% as a function of height. Function based on US Standard Atmosphere of
% 1976. All calculations performed in metric units but converted to
% english if the user chooses. Assuming constant gravitational
% acceleration.
%
% Input o height (feet or meters) can be a 1-dimensional vector
% o unit - optional; default is metric;
% boolean True for english units False for metric
% Output o t - Temperature (K (default) or R)
% o p - Pressure (pa (default) or psi)
% o rho - Density (kg/m^3 (default) or lbm/ft^3)
% o a - speed of sound (m/s (default) or ft/s)
function [t p rho a] = atmosphere(heightunit)
if nargin < 1
error(‘Error: Not enough inputs: see help atmosphere.m‘)
elseif nargin > 2
error(‘Error: Too few inputs: see help atmosphere.m‘)
elseif nargin == 2
unit = logical(unit);
elseif nargin == 1
unit = 0;
end
for j = 1:length(height)
if height(j) < 0
error(‘Height should be greater than 0‘)
end
m2ft = 3.2808;
K2R = 1.8;
pa2psi = 1.450377377302092e-004;
kg2lbm = 2.20462262184878;
if unit
height(j) = height(j)/m2ft;
end
g = 9.81; %Acceleration of gravity (m/s/s)
gamma = 1.4; %Ratio of specific heats
R = 287; %Gas constant for air (J/kg-K)
%Altitudes (m)
Start = 0;
H1 = 11000;
H2 = 20000;
H3 = 32000;
H4 = 47000;
H5 = 51000;
H6 = 71000;
H7 = 84852;
%Lapse Rates (K/m)
L1 = -0.0065;
L2 = 0;
L3 = .001;
L4 = .0028;
L5 = 0;
L6 = -.0028;
L7 = -.002;
%Initial Values
T0 = 288.16; %(k)
P0 = 1.01325e5; %(pa)
Rho0 = 1.225; %(kg/m^3)
if height(j) <= H1
[TNew PNew RhoNew] = Gradient(Start height(j) T0 P0 Rho0 L1);
elseif height(j) > H1 & height(j) <= H2
[TNew PNew RhoNew] = Gradient(Start H1 T0 P0 Rho0 L1);
[TNew PNew RhoNew] = IsoThermal(H1 height(j) TNew PNew RhoNew);
elseif height(j) > H2 & height(j) <= H3
[TNew PNew RhoNew] = Gradient(Start H1 T0 P0 Rho0 L1);
[TNew PNew RhoNew] = IsoThermal(H1 H2 TNew PNew RhoNew);
[TNew PNew RhoNew] = Gradient(H2 height(j) TNew PNew RhoNew L3);
elseif height(j) > H3 & height(j) <= H4
[TNew PNew RhoNew] = Gradient(Start H1 T0 P0 Rho0 L1);
[TNew PNew RhoNew] = IsoThermal(H1 H2 TNew PNew RhoNew);
相关资源
- matlab 二维泊松 有限差分法 通过系数
- 基于灰度共生矩阵的图像分割
- BOC信号跟踪MATLAB仿真代码
- 三次样条差值拟合 matlab
- 基于matlab的模糊控制程序集
- 基于多播的QOSmatlab程序
-
模糊控制的matlab simuli
nk仿真 -
基于Matlab/SIMUli
nk的 OPGW感应取电仿真 - 装配生产线任务平衡问题的遗传算法
- IEEE33节点matlab潮流程序.doc
- BP算法的MATLAB实现
- DQPSK调制与解调
- 绘制天线方向图
- 基于matlab的相机标定程序
- Matlab实现kl变换
- 图像显著性检测
- matlab 显示txt数据图片
- USM算法锐化图像 拉普拉斯算法处理图
- 基于matlab的海明窗带阻滤波器的设计
- matlab房间脉冲响应模拟工具
- pagerank matlab
- PSO-optimize-RBF matlab实现
- 异步电机软起动matlab仿真文件
- 单高斯背景建模MATLAB
- 神经网络解决TSP问题
- matlab批量读入图片
- LDPC的matlab 仿真 BP算法 BPSK调制
- FFT实现快速卷积 MATLAB
- 中值,均值,高斯滤波MATLAB处理,含
- MATLAB BP神经网络工具箱
评论
共有 条评论