将WeatherCondition 类改为 Weather 类,修改了 WeatherType 枚举;完善了湍流的计算和测试
This commit is contained in:
parent
0b9917a724
commit
2e51c9d49a
Binary file not shown.
@ -27,7 +27,7 @@
|
||||
可以处理各种天气条件和烟雾环境
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="M:AirTransmission.AtmosphericTransmittanceCalculator.CalcLaser(AirTransmission.WeatherCondition,System.Double)">
|
||||
<member name="M:AirTransmission.AtmosphericTransmittanceCalculator.CalcLaser(AirTransmission.Weather,System.Double)">
|
||||
<summary>
|
||||
计算激光在给定天气条件和距离下的大气透过率
|
||||
</summary>
|
||||
@ -35,7 +35,7 @@
|
||||
<param name="distance">传输距离(米)</param>
|
||||
<returns>大气透过率</returns>
|
||||
</member>
|
||||
<member name="M:AirTransmission.AtmosphericTransmittanceCalculator.CalcIR(AirTransmission.WeatherCondition,System.Double)">
|
||||
<member name="M:AirTransmission.AtmosphericTransmittanceCalculator.CalcIR(AirTransmission.Weather,System.Double)">
|
||||
<summary>
|
||||
计算红外线在给定条件下的大气透过率
|
||||
</summary>
|
||||
@ -43,7 +43,7 @@
|
||||
<param name="distance">传输距离(米)</param>
|
||||
<returns>大气透过率</returns>
|
||||
</member>
|
||||
<member name="M:AirTransmission.AtmosphericTransmittanceCalculator.CalcMillimeterWave(AirTransmission.WeatherCondition,System.Double)">
|
||||
<member name="M:AirTransmission.AtmosphericTransmittanceCalculator.CalcMillimeterWave(AirTransmission.Weather,System.Double)">
|
||||
<summary>
|
||||
计算毫米波在给定条件下的大气透过率
|
||||
</summary>
|
||||
@ -51,7 +51,7 @@
|
||||
<param name="distance">传输距离(米)</param>
|
||||
<returns>大气透过率</returns>
|
||||
</member>
|
||||
<member name="M:AirTransmission.AtmosphericTransmittanceCalculator.CalcUV(AirTransmission.WeatherCondition,System.Double)">
|
||||
<member name="M:AirTransmission.AtmosphericTransmittanceCalculator.CalcUV(AirTransmission.Weather,System.Double)">
|
||||
<summary>
|
||||
计算紫外线在给定天气条件和距离下的大气透过率
|
||||
</summary>
|
||||
@ -59,7 +59,7 @@
|
||||
<param name="distance">传输距离(米)</param>
|
||||
<returns>大气透过率</returns>
|
||||
</member>
|
||||
<member name="M:AirTransmission.AtmosphericTransmittanceCalculator.CalcTurbulenceEffect(AirTransmission.WeatherCondition,System.Double,System.Double)">
|
||||
<member name="M:AirTransmission.AtmosphericTransmittanceCalculator.CalcTurbulenceEffect(AirTransmission.Weather,System.Double,System.Double)">
|
||||
<summary>
|
||||
计算湍流效应对激光透过率的影响
|
||||
</summary>
|
||||
@ -147,18 +147,18 @@
|
||||
基于1.06微米波长(常用的Nd:YAG激光器波长)计算:k = 2π/λ
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="M:AirTransmission.AtmosphericTurbulenceModel.CalculateTurbulenceEffect(AirTransmission.WeatherCondition,System.Double,System.Double)">
|
||||
<member name="M:AirTransmission.AtmosphericTurbulenceModel.CalculateTurbulenceEffect(AirTransmission.Weather,System.Double,System.Double)">
|
||||
<summary>
|
||||
计算大气湍流对光传输的综合影响
|
||||
</summary>
|
||||
<param name="distance">传输距离(米)</param>
|
||||
<param name="distance">传输距离(公里)</param>
|
||||
<param name="height">传输高度(米)</param>
|
||||
<param name="weather">天气条件</param>
|
||||
<returns>湍流效应(0到1之间的值,1表示无影响,0表示完全衰减)</returns>
|
||||
</member>
|
||||
<member name="M:AirTransmission.AtmosphericTurbulenceModel.CalculateC2n(System.Double,System.Double)">
|
||||
<summary>
|
||||
使用修改后的 Hufnagel-Valley 模型计算大气折射率结构常数
|
||||
使用标准的 Hufnagel-Valley 模型计算大气折射率结构常数
|
||||
</summary>
|
||||
<param name="height">高度(米)</param>
|
||||
<param name="windSpeed">风速(米/秒)</param>
|
||||
@ -169,7 +169,7 @@
|
||||
计算弗里德参数(Fried parameter)
|
||||
</summary>
|
||||
<param name="C2n">大气折射率结构常数</param>
|
||||
<param name="L">传输距离(米)</param>
|
||||
<param name="distance">传输距离(公里)</param>
|
||||
<returns>弗里德参数(米)</returns>
|
||||
</member>
|
||||
<member name="M:AirTransmission.AtmosphericTurbulenceModel.CalculateScintillationIndex(System.Double,System.Double,System.Double)">
|
||||
@ -178,7 +178,7 @@
|
||||
</summary>
|
||||
<param name="C2n">大气折射率结构常数</param>
|
||||
<param name="k">波数</param>
|
||||
<param name="L">传输距离(米)</param>
|
||||
<param name="distance">传输距离(公里)</param>
|
||||
<returns>闪烁指数(无量纲)</returns>
|
||||
</member>
|
||||
<member name="M:AirTransmission.AtmosphericTurbulenceModel.CalculateBeamWander(System.Double,System.Double,System.Double)">
|
||||
@ -186,8 +186,8 @@
|
||||
计算光束漂移(Beam Wander)
|
||||
</summary>
|
||||
<param name="C2n">大气折射率结构常数</param>
|
||||
<param name="L">传输距离(米)</param>
|
||||
<param name="h">传输高度(米)</param>
|
||||
<param name="distance">传输距离(公里)</param>
|
||||
<param name="height">传输高度(米)</param>
|
||||
<returns>光束漂移(弧度)</returns>
|
||||
</member>
|
||||
<member name="M:AirTransmission.AtmosphericTurbulenceModel.CalculateCoherenceLength(System.Double,System.Double)">
|
||||
@ -195,7 +195,7 @@
|
||||
计算相干长度(Coherence Length)
|
||||
</summary>
|
||||
<param name="C2n">大气折射率结构常数</param>
|
||||
<param name="L">传输距离(米)</param>
|
||||
<param name="distance">传输距离(公里)</param>
|
||||
<returns>相干长度(米)</returns>
|
||||
</member>
|
||||
<member name="M:AirTransmission.AtmosphericTurbulenceModel.CalculateAngleOfArrival(System.Double,System.Double,System.Double)">
|
||||
@ -203,7 +203,7 @@
|
||||
计算到达角(Angle of Arrival)
|
||||
</summary>
|
||||
<param name="C2n">大气折射率结构常数</param>
|
||||
<param name="L">传输距离(米)</param>
|
||||
<param name="distance">传输距离(公里)</param>
|
||||
<param name="D">接收器口径(米)</param>
|
||||
<returns>到达角(弧度)</returns>
|
||||
</member>
|
||||
@ -212,7 +212,7 @@
|
||||
计算等晕角(Isoplanatism Angle)
|
||||
</summary>
|
||||
<param name="C2n">大气折射率结构常数</param>
|
||||
<param name="L">传输距离(米)</param>
|
||||
<param name="distance">传输距离(公里)</param>
|
||||
<returns>等晕角(弧度)</returns>
|
||||
</member>
|
||||
<member name="T:AirTransmission.IRTransmittanceModel">
|
||||
@ -342,7 +342,7 @@
|
||||
- 计算各种天气条件(雨、雪、雾、沙尘)的衰减效应
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="M:AirTransmission.LaserTransmittanceModel.#ctor(AirTransmission.WeatherCondition)">
|
||||
<member name="M:AirTransmission.LaserTransmittanceModel.#ctor(AirTransmission.Weather)">
|
||||
<summary>
|
||||
激光透过率计算模型,用于计算激光在大气中的传输特性
|
||||
</summary>
|
||||
@ -549,7 +549,7 @@
|
||||
- 毫米波:3190μm(3.19mm,对应94GHz)
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="M:AirTransmission.TransmittanceModel.#ctor(AirTransmission.WeatherCondition)">
|
||||
<member name="M:AirTransmission.TransmittanceModel.#ctor(AirTransmission.Weather)">
|
||||
<summary>
|
||||
大气透过率计算的基础模型类,提供了各种大气条件下的透过率计算方法
|
||||
</summary>
|
||||
@ -585,7 +585,7 @@
|
||||
标准气溶胶密度常量,单位:粒子/立方厘米
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AirTransmission.TransmittanceModel.weatherCondition">
|
||||
<member name="F:AirTransmission.TransmittanceModel.weather">
|
||||
<summary>
|
||||
当前天气条件对象
|
||||
</summary>
|
||||
@ -773,7 +773,7 @@
|
||||
4. 综合得到最终透过率
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="T:AirTransmission.WeatherCondition">
|
||||
<member name="T:AirTransmission.Weather">
|
||||
<summary>
|
||||
天气条件类,用于描述大气传输计算所需的天气参数
|
||||
</summary>
|
||||
@ -792,11 +792,11 @@
|
||||
<param name="visibility">能见度(公里)</param>
|
||||
<param name="precipitation">降水量(毫米/小时),可选</param>
|
||||
<param name="co2Concentration">二氧化碳浓度(ppm),默认415ppm</param>
|
||||
<param name="pressure">大气压力(kPa),默认101.325kPa</param>
|
||||
<param name="pressure">大气压力(hPa),默认1013.25hPa</param>
|
||||
<param name="windSpeed">风速(m/s),默认0m/s</param>
|
||||
<param name="windDirection">风向(0-360度),默认0度</param>
|
||||
</member>
|
||||
<member name="M:AirTransmission.WeatherCondition.#ctor(AirTransmission.WeatherType,System.Double,System.Double,System.Double,System.Nullable{System.Double},System.Double,System.Double,System.Double,System.Double)">
|
||||
<member name="M:AirTransmission.Weather.#ctor(AirTransmission.WeatherType,System.Double,System.Double,System.Double,System.Double,System.Double,System.Double,System.Double,System.Double)">
|
||||
<summary>
|
||||
天气条件类,用于描述大气传输计算所需的天气参数
|
||||
</summary>
|
||||
@ -815,56 +815,56 @@
|
||||
<param name="visibility">能见度(公里)</param>
|
||||
<param name="precipitation">降水量(毫米/小时),可选</param>
|
||||
<param name="co2Concentration">二氧化碳浓度(ppm),默认415ppm</param>
|
||||
<param name="pressure">大气压力(kPa),默认101.325kPa</param>
|
||||
<param name="pressure">大气压力(hPa),默认1013.25hPa</param>
|
||||
<param name="windSpeed">风速(m/s),默认0m/s</param>
|
||||
<param name="windDirection">风向(0-360度),默认0度</param>
|
||||
</member>
|
||||
<member name="P:AirTransmission.WeatherCondition.Type">
|
||||
<member name="P:AirTransmission.Weather.Type">
|
||||
<summary>
|
||||
天气类型
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:AirTransmission.WeatherCondition.Temperature">
|
||||
<member name="P:AirTransmission.Weather.Temperature">
|
||||
<summary>
|
||||
温度(摄氏度)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:AirTransmission.WeatherCondition.RelativeHumidity">
|
||||
<member name="P:AirTransmission.Weather.RelativeHumidity">
|
||||
<summary>
|
||||
相对湿度(百分比)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:AirTransmission.WeatherCondition.Visibility">
|
||||
<member name="P:AirTransmission.Weather.Visibility">
|
||||
<summary>
|
||||
能见度(公里)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:AirTransmission.WeatherCondition.Precipitation">
|
||||
<member name="P:AirTransmission.Weather.Precipitation">
|
||||
<summary>
|
||||
降水量(毫米/小时)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:AirTransmission.WeatherCondition.CO2Concentration">
|
||||
<member name="P:AirTransmission.Weather.CO2Concentration">
|
||||
<summary>
|
||||
二氧化碳浓度(ppm)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:AirTransmission.WeatherCondition.Pressure">
|
||||
<member name="P:AirTransmission.Weather.Pressure">
|
||||
<summary>
|
||||
大气压力(kPa)
|
||||
大气压力(hPa)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:AirTransmission.WeatherCondition.WindSpeed">
|
||||
<member name="P:AirTransmission.Weather.WindSpeed">
|
||||
<summary>
|
||||
风速(m/s)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:AirTransmission.WeatherCondition.WindDirection">
|
||||
<member name="P:AirTransmission.Weather.WindDirection">
|
||||
<summary>
|
||||
风向(0-360度, 0度为北, 顺时针)
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:AirTransmission.WeatherCondition.PrintWeatherInfo(AirTransmission.WeatherCondition)">
|
||||
<member name="M:AirTransmission.Weather.PrintWeatherInfo(AirTransmission.Weather)">
|
||||
<summary>
|
||||
打印天气信息
|
||||
</summary>
|
||||
@ -879,27 +879,27 @@
|
||||
天气类型枚举
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AirTransmission.WeatherType.晴天">
|
||||
<member name="F:AirTransmission.WeatherType.Clear">
|
||||
<summary>
|
||||
晴朗天气
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AirTransmission.WeatherType.雨天">
|
||||
<member name="F:AirTransmission.WeatherType.Rain">
|
||||
<summary>
|
||||
雨天
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AirTransmission.WeatherType.雪天">
|
||||
<member name="F:AirTransmission.WeatherType.Snow">
|
||||
<summary>
|
||||
雪天
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AirTransmission.WeatherType.雾天">
|
||||
<member name="F:AirTransmission.WeatherType.Fog">
|
||||
<summary>
|
||||
雾天
|
||||
</summary>
|
||||
</member>
|
||||
<member name="F:AirTransmission.WeatherType.沙尘">
|
||||
<member name="F:AirTransmission.WeatherType.Dust">
|
||||
<summary>
|
||||
沙尘天气
|
||||
</summary>
|
||||
|
||||
@ -58,7 +58,7 @@ namespace AirTransmission
|
||||
/// <param name="weather">天气条件</param>
|
||||
/// <param name="distance">传输距离(米)</param>
|
||||
/// <returns>大气透过率</returns>
|
||||
public static double CalcLaser(WeatherCondition weather, double distance)
|
||||
public static double CalcLaser(Weather weather, double distance)
|
||||
{
|
||||
var model = new LaserTransmittanceModel(weather);
|
||||
return model.CalculateTransmittance(distance);
|
||||
@ -70,7 +70,7 @@ namespace AirTransmission
|
||||
/// <param name="weather">天气条件</param>
|
||||
/// <param name="distance">传输距离(米)</param>
|
||||
/// <returns>大气透过率</returns>
|
||||
public static double CalcIR(WeatherCondition weather, double distance)
|
||||
public static double CalcIR(Weather weather, double distance)
|
||||
{
|
||||
var model = new IRTransmittanceModel(weather);
|
||||
return model.CalculateTransmittance(distance);
|
||||
@ -82,7 +82,7 @@ namespace AirTransmission
|
||||
/// <param name="weather">天气条件</param>
|
||||
/// <param name="distance">传输距离(米)</param>
|
||||
/// <returns>大气透过率</returns>
|
||||
public static double CalcMillimeterWave(WeatherCondition weather, double distance)
|
||||
public static double CalcMillimeterWave(Weather weather, double distance)
|
||||
{
|
||||
var model = new MillimeterWaveTransmittanceModel(weather);
|
||||
return model.CalculateTransmittance(distance);
|
||||
@ -94,7 +94,7 @@ namespace AirTransmission
|
||||
/// <param name="weather">天气条件</param>
|
||||
/// <param name="distance">传输距离(米)</param>
|
||||
/// <returns>大气透过率</returns>
|
||||
public static double CalcUV(WeatherCondition weather, double distance)
|
||||
public static double CalcUV(Weather weather, double distance)
|
||||
{
|
||||
var model = new UVTransmittanceModel(weather);
|
||||
return model.CalculateTransmittance(distance);
|
||||
@ -107,7 +107,7 @@ namespace AirTransmission
|
||||
/// <param name="distance">传输距离(米)</param>
|
||||
/// <param name="height">传输高度(米)</param>
|
||||
/// <returns>大气透过率</returns>
|
||||
public static double CalcTurbulenceEffect(WeatherCondition weather, double distance, double height)
|
||||
public static double CalcTurbulenceEffect(Weather weather, double distance, double height)
|
||||
{
|
||||
return AtmosphericTurbulenceModel.CalculateTurbulenceEffect(weather, distance, height);
|
||||
}
|
||||
@ -199,7 +199,7 @@ namespace AirTransmission
|
||||
[DllExport("CalculateTransmittance", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static double CalculateTransmittanceExport(int radiationType, double wavelength, double distance, WeatherParameters parameters)
|
||||
{
|
||||
var weather = new WeatherCondition(
|
||||
var weather = new Weather(
|
||||
type: (WeatherType)parameters.WeatherType,
|
||||
temperature: parameters.Temperature,
|
||||
relativeHumidity: parameters.RelativeHumidity,
|
||||
@ -238,7 +238,7 @@ namespace AirTransmission
|
||||
[DllExport("CalculateAtmosphericTurbulence", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static double CalculateAtmosphericTurbulenceExport(double wavelength, double distance, WeatherParameters parameters, double height)
|
||||
{
|
||||
var weather = new WeatherCondition(
|
||||
var weather = new Weather(
|
||||
type: (WeatherType)parameters.WeatherType,
|
||||
temperature: parameters.Temperature,
|
||||
relativeHumidity: parameters.RelativeHumidity,
|
||||
|
||||
@ -29,11 +29,11 @@ namespace AirTransmission
|
||||
/// <summary>
|
||||
/// 计算大气湍流对光传输的综合影响
|
||||
/// </summary>
|
||||
/// <param name="distance">传输距离(米)</param>
|
||||
/// <param name="distance">传输距离(公里)</param>
|
||||
/// <param name="height">传输高度(米)</param>
|
||||
/// <param name="weather">天气条件</param>
|
||||
/// <returns>湍流效应(0到1之间的值,1表示无影响,0表示完全衰减)</returns>
|
||||
public static double CalculateTurbulenceEffect(WeatherCondition weather, double distance, double height)
|
||||
public static double CalculateTurbulenceEffect(Weather weather, double distance, double height)
|
||||
{
|
||||
double C2n = CalculateC2n(height, weather.WindSpeed);
|
||||
double r0 = CalculateFriedParameter(C2n, distance);
|
||||
@ -44,36 +44,58 @@ namespace AirTransmission
|
||||
double turbulenceEffect = Math.Exp(-sigmaI2) * (1 - Math.Exp(-r0 / beamWander));
|
||||
|
||||
// 增加一个缩放因子,使效应更明显
|
||||
double scalingFactor = 0.8;
|
||||
double scalingFactor = 0.9; // 从0.8增加到0.9,使差异更明显
|
||||
|
||||
// 根据天气条件调整湍流效应
|
||||
if (weather.Type == WeatherType.Rain || weather.Type == WeatherType.Snow)
|
||||
{
|
||||
// 雨雪天气湍流效应更强
|
||||
turbulenceEffect = turbulenceEffect * 0.9;
|
||||
}
|
||||
else if (weather.Type == WeatherType.Dust || weather.Type == WeatherType.Fog)
|
||||
{
|
||||
// 沙尘和雾天湍流效应中等
|
||||
turbulenceEffect = turbulenceEffect * 0.95;
|
||||
}
|
||||
|
||||
// 距离越远,湍流效应越明显
|
||||
double distanceFactor = Math.Min(distance / 10.0, 0.2); // 最多降低20%,10公里为基准
|
||||
turbulenceEffect = turbulenceEffect * (1.0 - distanceFactor);
|
||||
|
||||
turbulenceEffect = 1 - scalingFactor * (1 - turbulenceEffect);
|
||||
|
||||
return turbulenceEffect;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 使用修改后的 Hufnagel-Valley 模型计算大气折射率结构常数
|
||||
/// 使用标准的 Hufnagel-Valley 模型计算大气折射率结构常数
|
||||
/// </summary>
|
||||
/// <param name="height">高度(米)</param>
|
||||
/// <param name="windSpeed">风速(米/秒)</param>
|
||||
/// <returns>大气折射率结构常数</returns>
|
||||
public static double CalculateC2n(double height, double windSpeed)
|
||||
{
|
||||
// 修改 Hufnagel-Valley 模型,增加湍流强度
|
||||
double A = 1.7e-13; // 增加了一个数量级
|
||||
double v = windSpeed;
|
||||
return A * Math.Pow(v / 27, 2) * Math.Pow(height * 1e-5, 10) * Math.Exp(-height / 1000)
|
||||
+ 2.7e-15 * Math.Exp(-height / 1500);
|
||||
// 使用标准的 Hufnagel-Valley 模型
|
||||
double A = 0.00594; // 标准系数
|
||||
// 确保风速至少为0.5 m/s,防止计算结果不合理
|
||||
double v = Math.Max(windSpeed, 0.5);
|
||||
|
||||
// 标准 Hufnagel-Valley 公式
|
||||
double result = A * Math.Pow(v / 27, 2) * Math.Pow(height * 1e-5, 10) * Math.Exp(-height / 1000)
|
||||
+ 2.7e-16 * Math.Exp(-height / 1500);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算弗里德参数(Fried parameter)
|
||||
/// </summary>
|
||||
/// <param name="C2n">大气折射率结构常数</param>
|
||||
/// <param name="L">传输距离(米)</param>
|
||||
/// <param name="distance">传输距离(公里)</param>
|
||||
/// <returns>弗里德参数(米)</returns>
|
||||
private static double CalculateFriedParameter(double C2n, double L)
|
||||
private static double CalculateFriedParameter(double C2n, double distance)
|
||||
{
|
||||
return Math.Pow(0.423 * k * k * C2n * L, -3.0 / 5.0);
|
||||
return Math.Pow(0.423 * k * k * C2n * distance, -3.0 / 5.0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -81,57 +103,57 @@ namespace AirTransmission
|
||||
/// </summary>
|
||||
/// <param name="C2n">大气折射率结构常数</param>
|
||||
/// <param name="k">波数</param>
|
||||
/// <param name="L">传输距离(米)</param>
|
||||
/// <param name="distance">传输距离(公里)</param>
|
||||
/// <returns>闪烁指数(无量纲)</returns>
|
||||
private static double CalculateScintillationIndex(double C2n, double k, double L)
|
||||
private static double CalculateScintillationIndex(double C2n, double k, double distance)
|
||||
{
|
||||
return 1.23 * C2n * Math.Pow(k, 7.0 / 6.0) * Math.Pow(L, 11.0 / 6.0);
|
||||
return 1.23 * C2n * Math.Pow(k, 7.0 / 6.0) * Math.Pow(distance, 11.0 / 6.0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算光束漂移(Beam Wander)
|
||||
/// </summary>
|
||||
/// <param name="C2n">大气折射率结构常数</param>
|
||||
/// <param name="L">传输距离(米)</param>
|
||||
/// <param name="h">传输高度(米)</param>
|
||||
/// <param name="distance">传输距离(公里)</param>
|
||||
/// <param name="height">传输高度(米)</param>
|
||||
/// <returns>光束漂移(弧度)</returns>
|
||||
private static double CalculateBeamWander(double C2n, double L, double h)
|
||||
private static double CalculateBeamWander(double C2n, double distance, double height)
|
||||
{
|
||||
return 2.87 * Math.Pow(C2n * L * Math.Pow(h, 5.0/3.0), 1.0/3.0);
|
||||
return 2.87 * Math.Pow(C2n * distance * Math.Pow(height, 5.0/3.0), 1.0/3.0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算相干长度(Coherence Length)
|
||||
/// </summary>
|
||||
/// <param name="C2n">大气折射率结构常数</param>
|
||||
/// <param name="L">传输距离(米)</param>
|
||||
/// <param name="distance">传输距离(公里)</param>
|
||||
/// <returns>相干长度(米)</returns>
|
||||
private static double CalculateCoherenceLength(double C2n, double L)
|
||||
private static double CalculateCoherenceLength(double C2n, double distance)
|
||||
{
|
||||
return Math.Pow(1.46 * k * k * C2n * L, -3.0 / 5.0);
|
||||
return Math.Pow(1.46 * k * k * C2n * distance, -3.0 / 5.0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算到达角(Angle of Arrival)
|
||||
/// </summary>
|
||||
/// <param name="C2n">大气折射率结构常数</param>
|
||||
/// <param name="L">传输距离(米)</param>
|
||||
/// <param name="distance">传输距离(公里)</param>
|
||||
/// <param name="D">接收器口径(米)</param>
|
||||
/// <returns>到达角(弧度)</returns>
|
||||
public static double CalculateAngleOfArrival(double C2n, double L, double D)
|
||||
public static double CalculateAngleOfArrival(double C2n, double distance, double D)
|
||||
{
|
||||
return 2.91 * Math.Pow(C2n * L / Math.Pow(D, 1.0/3.0), 0.6);
|
||||
return 2.91 * Math.Pow(C2n * distance / Math.Pow(D, 1.0/3.0), 0.6);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算等晕角(Isoplanatism Angle)
|
||||
/// </summary>
|
||||
/// <param name="C2n">大气折射率结构常数</param>
|
||||
/// <param name="L">传输距离(米)</param>
|
||||
/// <param name="distance">传输距离(公里)</param>
|
||||
/// <returns>等晕角(弧度)</returns>
|
||||
public static double CalculateIsoplanatismAngle(double C2n, double L)
|
||||
public static double CalculateIsoplanatismAngle(double C2n, double distance)
|
||||
{
|
||||
return 0.314 * Math.Pow(C2n * k * k * L, -3.0 / 5.0);
|
||||
return 0.314 * Math.Pow(C2n * k * k * distance, -3.0 / 5.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ namespace AirTransmission
|
||||
/// </remarks>
|
||||
private const double IR_WAVELENGTH = 10.0; // 主要计算波长(微米)
|
||||
|
||||
public IRTransmittanceModel(WeatherCondition weather) : base(weather) { }
|
||||
public IRTransmittanceModel(Weather weather) : base(weather) { }
|
||||
|
||||
/// <summary>
|
||||
/// 计算给定距离的红外线透过率
|
||||
|
||||
@ -16,7 +16,7 @@ namespace AirTransmission
|
||||
/// - 处理烟雾对激光传输的影响
|
||||
/// - 计算各种天气条件(雨、雪、雾、沙尘)的衰减效应
|
||||
/// </remarks>
|
||||
internal class LaserTransmittanceModel(WeatherCondition weather) : TransmittanceModel(weather)
|
||||
internal class LaserTransmittanceModel(Weather weather) : TransmittanceModel(weather)
|
||||
{
|
||||
/// <summary>
|
||||
/// 激光波长常量,单位:微米
|
||||
@ -138,21 +138,21 @@ namespace AirTransmission
|
||||
private double CalculateAerosolFactor()
|
||||
{
|
||||
double q;
|
||||
if (Visibility > 50)
|
||||
if (Visibility > 50000)
|
||||
q = 1.6;
|
||||
else if (Visibility > 6)
|
||||
else if (Visibility > 6000)
|
||||
q = 1.3;
|
||||
else if (Visibility > 1)
|
||||
q = 0.585 * Math.Pow(Visibility, 1.0/3.0);
|
||||
else if (Visibility > 1000)
|
||||
q = 0.585 * Math.Pow(Visibility / 1000, 1.0/3.0);
|
||||
else
|
||||
q = 0.585 * Math.Pow(1, 1.0/3.0);
|
||||
q = 0.585 * Math.Pow(1000, 1.0/3.0);
|
||||
|
||||
// 增加气溶胶散射的影响
|
||||
double aerosolFactor = 3.91 / Visibility * Math.Pow(LASER_WAVELENGTH / 0.55, -q) * 1.1; // 增加10%的气溶胶散射
|
||||
double aerosolFactor = 3.91 / Visibility / 1000 * Math.Pow(LASER_WAVELENGTH / 0.55, -q) * 1.1; // 增加10%的气溶胶散射
|
||||
|
||||
if (Visibility < 5)
|
||||
if (Visibility < 5000)
|
||||
{
|
||||
aerosolFactor *= (1 + (5 - Visibility) / 5);
|
||||
aerosolFactor *= (1 + (5000 - Visibility) / 5000);
|
||||
}
|
||||
|
||||
if (IsDusty)
|
||||
@ -174,8 +174,8 @@ namespace AirTransmission
|
||||
return 0;
|
||||
|
||||
// 增加雾的衰减效应
|
||||
double q = 0.585 * Math.Pow(Visibility, 1.0/3.0);
|
||||
double beta = 3.91 / Visibility * Math.Pow(LASER_WAVELENGTH / 0.55, -q);
|
||||
double q = 0.585 * Math.Pow(Visibility / 1000, 1.0/3.0);
|
||||
double beta = 3.91 / Visibility / 1000 * Math.Pow(LASER_WAVELENGTH / 0.55, -q);
|
||||
return beta * pathLength * 1.2; // 从0.5改为1.2,增加雾的影响
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ namespace AirTransmission
|
||||
/// </remarks>
|
||||
private const double MILLIMETER_WAVE_WAVELENGTH = 3190.0; // 微米(对应94 GHz)
|
||||
|
||||
public MillimeterWaveTransmittanceModel(WeatherCondition weather) : base(weather) { }
|
||||
public MillimeterWaveTransmittanceModel(Weather weather) : base(weather) { }
|
||||
|
||||
/// <summary>
|
||||
/// 计算给定距离的毫米波透过率
|
||||
|
||||
@ -23,7 +23,7 @@ namespace AirTransmission
|
||||
/// - 紫外:0.2-0.4μm
|
||||
/// - 毫米波:3190μm(3.19mm,对应94GHz)
|
||||
/// </remarks>
|
||||
internal abstract class TransmittanceModel(WeatherCondition weather)
|
||||
internal abstract class TransmittanceModel(Weather weather)
|
||||
{
|
||||
/// <summary>
|
||||
/// 标准大气透过率常量
|
||||
@ -44,7 +44,7 @@ namespace AirTransmission
|
||||
/// <summary>
|
||||
/// 当前天气条件对象
|
||||
/// </summary>
|
||||
protected WeatherCondition weatherCondition = weather;
|
||||
protected Weather weather = weather;
|
||||
// 大气模型参数
|
||||
/// <summary>
|
||||
/// 温度,单位:开尔文
|
||||
@ -72,27 +72,27 @@ namespace AirTransmission
|
||||
/// <summary>
|
||||
/// 是否下雨
|
||||
/// </summary>
|
||||
protected bool IsRaining { get; set; } = weather.Type == WeatherType.雨天;
|
||||
protected bool IsRaining { get; set; } = weather.Type == WeatherType.Rain;
|
||||
/// <summary>
|
||||
/// 降雨量(毫米/小时)
|
||||
/// </summary>
|
||||
protected double RainRate { get; set; } = weather.Type == WeatherType.雨天 ? (weather.Precipitation ?? 0) : 0;
|
||||
protected double RainRate { get; set; } = weather.Type == WeatherType.Rain ? weather.Precipitation : 0;
|
||||
/// <summary>
|
||||
/// 是否有雾
|
||||
/// </summary>
|
||||
protected bool IsFoggy { get; set; } = weather.Type == WeatherType.雾天;
|
||||
protected bool IsFoggy { get; set; } = weather.Type == WeatherType.Fog;
|
||||
/// <summary>
|
||||
/// 是否有沙尘
|
||||
/// </summary>
|
||||
protected bool IsDusty { get; set; } = weather.Type == WeatherType.沙尘;
|
||||
protected bool IsDusty { get; set; } = weather.Type == WeatherType.Dust;
|
||||
/// <summary>
|
||||
/// 是否下雪
|
||||
/// </summary>
|
||||
protected bool IsSnowing { get; set; } = weather.Type == WeatherType.雪天;
|
||||
protected bool IsSnowing { get; set; } = weather.Type == WeatherType.Snow;
|
||||
/// <summary>
|
||||
/// 降雪量(毫米/小时)
|
||||
/// </summary>
|
||||
protected double SnowRate { get; set; } = weather.Type == WeatherType.雪天 ? (weather.Precipitation ?? 0) : 0;
|
||||
protected double SnowRate { get; set; } = weather.Type == WeatherType.Snow ? weather.Precipitation : 0;
|
||||
/// <summary>
|
||||
/// 二氧化碳浓度(ppm)
|
||||
/// </summary>
|
||||
|
||||
@ -41,7 +41,7 @@ namespace AirTransmission
|
||||
/// </remarks>
|
||||
private const double UV_WAVELENGTH = 0.308; // 主要计算波长(微米)
|
||||
|
||||
public UVTransmittanceModel(WeatherCondition weather) : base(weather) { }
|
||||
public UVTransmittanceModel(Weather weather) : base(weather) { }
|
||||
|
||||
/// <summary>
|
||||
/// 计算给定距离的紫外线透过率
|
||||
|
||||
@ -20,10 +20,10 @@ namespace AirTransmission
|
||||
/// <param name="visibility">能见度(公里)</param>
|
||||
/// <param name="precipitation">降水量(毫米/小时),可选</param>
|
||||
/// <param name="co2Concentration">二氧化碳浓度(ppm),默认415ppm</param>
|
||||
/// <param name="pressure">大气压力(kPa),默认101.325kPa</param>
|
||||
/// <param name="pressure">大气压力(hPa),默认1013.25hPa</param>
|
||||
/// <param name="windSpeed">风速(m/s),默认0m/s</param>
|
||||
/// <param name="windDirection">风向(0-360度),默认0度</param>
|
||||
public class WeatherCondition(WeatherType type, double temperature, double relativeHumidity, double visibility, double? precipitation = null, double co2Concentration = 415, double pressure = 101.325, double windSpeed = 0, double windDirection = 0)
|
||||
public class Weather(WeatherType type, double temperature, double relativeHumidity, double visibility, double precipitation = 0, double co2Concentration = 415, double pressure = 101.325, double windSpeed = 0, double windDirection = 0)
|
||||
{
|
||||
/// <summary>
|
||||
/// 天气类型
|
||||
@ -44,14 +44,14 @@ namespace AirTransmission
|
||||
/// <summary>
|
||||
/// 降水量(毫米/小时)
|
||||
/// </summary>
|
||||
public double? Precipitation { get; set; } = precipitation;
|
||||
public double Precipitation { get; set; } = precipitation;
|
||||
/// <summary>
|
||||
/// 二氧化碳浓度(ppm)
|
||||
/// </summary>
|
||||
public double CO2Concentration { get; set; } = co2Concentration;
|
||||
|
||||
/// <summary>
|
||||
/// 大气压力(kPa)
|
||||
/// 大气压力(hPa)
|
||||
/// </summary>
|
||||
public double Pressure { get; set; } = pressure;
|
||||
/// <summary>
|
||||
@ -71,9 +71,9 @@ namespace AirTransmission
|
||||
/// 输出格式:
|
||||
/// 天气类型: [类型], 温度: [温度]°C, 相对湿度: [湿度]%, 能见度: [能见度]km, 降水量: [降水量]mm/h, 大气压力: [大气压力]kPa, 风速: [风速]m/s, 风向: [风向]度
|
||||
/// </remarks>
|
||||
public static void PrintWeatherInfo(WeatherCondition weather)
|
||||
public static void PrintWeatherInfo(Weather weather)
|
||||
{
|
||||
Debug.WriteLine($"---天气类型: {weather.Type}, 温度: {weather.Temperature}°C, 相对湿度: {weather.RelativeHumidity}%, 能见度: {weather.Visibility}km, 降水量: {weather.Precipitation ?? 0}mm/h, 大气压力: {weather.Pressure}kPa, 风速: {weather.WindSpeed}m/s, 风向: {weather.WindDirection}度");
|
||||
Debug.WriteLine($"---天气类型: {weather.Type}, 温度: {weather.Temperature}°C, 相对湿度: {weather.RelativeHumidity}%, 能见度: {weather.Visibility}km, 降水量: {weather.Precipitation}mm/h, 大气压力: {weather.Pressure}kPa, 风速: {weather.WindSpeed}m/s, 风向: {weather.WindDirection}度");
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,22 +85,22 @@ namespace AirTransmission
|
||||
/// <summary>
|
||||
/// 晴朗天气
|
||||
/// </summary>
|
||||
晴天, // 晴朗天气
|
||||
Clear, // 晴朗天气
|
||||
/// <summary>
|
||||
/// 雨天
|
||||
/// </summary>
|
||||
雨天, // 雨天
|
||||
Rain, // 雨天
|
||||
/// <summary>
|
||||
/// 雪天
|
||||
/// </summary>
|
||||
雪天, // 雪天
|
||||
Snow, // 雪天
|
||||
/// <summary>
|
||||
/// 雾天
|
||||
/// </summary>
|
||||
雾天, // 雾天
|
||||
Fog, // 雾天
|
||||
/// <summary>
|
||||
/// 沙尘天气
|
||||
/// </summary>
|
||||
沙尘 // 沙尘
|
||||
Dust // 沙尘
|
||||
}
|
||||
}
|
||||
@ -1,242 +1,263 @@
|
||||
using AirTransmission;
|
||||
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("脉冲激光目标指示器辐射能量计算");
|
||||
|
||||
// 创建一个晴天的天气条件
|
||||
var weatherCondition = new WeatherCondition(
|
||||
type: WeatherType.晴天,
|
||||
temperature: 25,
|
||||
relativeHumidity: 60,
|
||||
visibility: 10
|
||||
);
|
||||
|
||||
// 设置激光和目标参数
|
||||
double laserEnergy = 0.130; // 130 mJ
|
||||
double pulseWidth = 15; // 15 ns
|
||||
double targetDistance = 1; // 1公里
|
||||
double receiverDistance = 1; // 1公里
|
||||
double targetReflectivity = 0.2; // 假设目标反射率为20%
|
||||
|
||||
// 计算激光透过率和接收功率
|
||||
double transmittance = AtmosphericTransmittanceCalculator.CalcLaser(weatherCondition, targetDistance);
|
||||
double receivedPower = AtmosphericTransmittanceCalculator.CalculateReceivedRadiation(transmittance, laserEnergy, pulseWidth, targetDistance, receiverDistance, targetReflectivity);
|
||||
|
||||
Console.WriteLine($"\n导弹导引头接收到的平均功率: {receivedPower:E2} W");
|
||||
|
||||
// 执行各种测试
|
||||
Console.WriteLine("\n单程辐射能量计算");
|
||||
CalculateSinglePathRadiation();
|
||||
|
||||
Console.WriteLine("\n烟幕影响计算");
|
||||
TestSmokeScreenEffect();
|
||||
|
||||
Console.WriteLine("\n不同天气条件下的激光透过率测试");
|
||||
TestLaserTransmittanceInDifferentWeather();
|
||||
|
||||
Console.WriteLine("\n不同天气条件下的红外线透过率测试");
|
||||
TestIRTransmittanceInDifferentWeather();
|
||||
|
||||
Console.WriteLine("\n不同天气条件下的毫米波透过率测试");
|
||||
TestMillimeterWaveTransmittanceInDifferentWeather();
|
||||
|
||||
Console.WriteLine("\n不同天气条件下的紫外线透过率测试");
|
||||
TestUVTransmittanceInDifferentWeather();
|
||||
}
|
||||
|
||||
// 测试不同天气条件下的激光透过率
|
||||
static void TestLaserTransmittanceInDifferentWeather()
|
||||
{
|
||||
// 测试各种天气条件
|
||||
TestLaserTransmittance(WeatherType.晴天, "晴朗");
|
||||
TestLaserTransmittance(WeatherType.雨天, "小雨", relativeHumidity: 60, precipitation: 2.5, visibility: 5);
|
||||
TestLaserTransmittance(WeatherType.雨天, "大雨", relativeHumidity: 90, precipitation: 25, visibility: 2.5);
|
||||
TestLaserTransmittance(WeatherType.雾天, "雾", relativeHumidity: 80, visibility: 5);
|
||||
TestLaserTransmittance(WeatherType.沙尘, "沙尘", visibility: 0.5);
|
||||
TestLaserTransmittance(WeatherType.雪天, "雪天", temperature: -5, relativeHumidity: 80, visibility: 1, precipitation: 2.5);
|
||||
}
|
||||
|
||||
// 测试特定天气条件下的激光透过率
|
||||
static void TestLaserTransmittance(WeatherType type, string description,
|
||||
double temperature = 25, double relativeHumidity = 50,
|
||||
double visibility = 23, double? precipitation = null, double latitude = 30)
|
||||
{
|
||||
double[] distances = [0.1, 0.5, 1, 5, 10]; // 测试不同距离(公里)
|
||||
|
||||
// 创建天气条件
|
||||
var weatherCondition = new WeatherCondition(
|
||||
type: type,
|
||||
temperature: temperature,
|
||||
relativeHumidity: relativeHumidity,
|
||||
visibility: visibility,
|
||||
precipitation: precipitation
|
||||
);
|
||||
|
||||
// 输出结果
|
||||
Console.WriteLine($"\n[{description}条件下的激光透过率]");
|
||||
WeatherCondition.PrintWeatherInfo(weatherCondition);
|
||||
foreach (var d in distances){
|
||||
double laserTransmittance = AtmosphericTransmittanceCalculator.CalcLaser(weatherCondition, d);
|
||||
double turbulenceEffect = AtmosphericTransmittanceCalculator.CalcTurbulenceEffect(weatherCondition, d, 100); // 添加高度参数,假设高度为100米
|
||||
Console.WriteLine($"距离:{d}公里, 1.06μm激光透过率为: {laserTransmittance:P2}, 湍流效应: {turbulenceEffect:P2}");
|
||||
}
|
||||
}
|
||||
|
||||
// 计算单程辐射能量
|
||||
static void CalculateSinglePathRadiation()
|
||||
{
|
||||
// 创建天气条件
|
||||
var weatherCondition = new WeatherCondition(
|
||||
type: WeatherType.晴天,
|
||||
temperature: 25,
|
||||
relativeHumidity: 60,
|
||||
visibility: 10
|
||||
);
|
||||
|
||||
double targetRadiation = 2E+006; // 100 W/Sr
|
||||
double receiverDistance = 3; // 3公里
|
||||
|
||||
// 计算透过率和接收功率
|
||||
double transmittance = AtmosphericTransmittanceCalculator.CalcLaser(weatherCondition, receiverDistance);
|
||||
double receivedPower = AtmosphericTransmittanceCalculator.CalculateReceivedRadiationSinglePath(transmittance, targetRadiation, receiverDistance);
|
||||
|
||||
Console.WriteLine($"\n导弹导引头接收到的辐射能量: {receivedPower:E2} W/Sr");
|
||||
}
|
||||
|
||||
// 测试特定天气条件下的红外线透过率
|
||||
static void TestIRTransmittance(WeatherType type, string description,
|
||||
double temperature = 25, double relativeHumidity = 50,
|
||||
double visibility = 10, double? precipitation = null, double latitude = 30)
|
||||
{
|
||||
double[] distances = [0.1, 0.5, 1, 5, 10]; // 测试不同距离(公里)
|
||||
|
||||
// 创建天气条件
|
||||
var weatherCondition = new WeatherCondition(
|
||||
type: type,
|
||||
temperature: temperature,
|
||||
relativeHumidity: relativeHumidity,
|
||||
visibility: visibility,
|
||||
precipitation: precipitation
|
||||
);
|
||||
|
||||
// 输出结果
|
||||
Console.WriteLine($"\n[{description}条件下的红外线透过率]");
|
||||
WeatherCondition.PrintWeatherInfo(weatherCondition);
|
||||
foreach (var d in distances)
|
||||
{
|
||||
double irTransmittance = AtmosphericTransmittanceCalculator.CalcIR(weatherCondition, d);
|
||||
Console.WriteLine($"距离:{d}公里, 红外线透过率为: {irTransmittance:P2}");
|
||||
}
|
||||
}
|
||||
|
||||
// 测试烟幕效应
|
||||
static void TestSmokeScreenEffect()
|
||||
{
|
||||
Console.WriteLine("\n测试烟幕对激光的影响:");
|
||||
Console.WriteLine("------------------------");
|
||||
|
||||
// 测试不同烟幕浓度下的透过率
|
||||
double[] smokeConcentrations = [0.05, 0.1, 0.2, 0.5, 1.0, 2.0]; // g/m³
|
||||
double smokeThickness = 10; // 米
|
||||
double wavelength = 1.06; // 微米 (1060nm)
|
||||
|
||||
foreach (double concentration in smokeConcentrations)
|
||||
{
|
||||
double transmittance = AtmosphericTransmittanceCalculator.CalculateSmokeScreenTransmittance(
|
||||
wavelength, concentration, smokeThickness);
|
||||
Console.WriteLine($"烟幕浓度: {concentration:F2} g/m³, 烟幕厚度: {smokeThickness}米, 透过率: {transmittance:F4}");
|
||||
}
|
||||
}
|
||||
|
||||
// 测试不同天气条件下的毫米波透过率
|
||||
static void TestMillimeterWaveTransmittanceInDifferentWeather()
|
||||
{
|
||||
// 测试各种天气条件
|
||||
TestMillimeterWaveTransmittance(WeatherType.晴天, "晴朗");
|
||||
TestMillimeterWaveTransmittance(WeatherType.雨天, "小雨", relativeHumidity: 60, precipitation: 2.5, visibility: 5);
|
||||
TestMillimeterWaveTransmittance(WeatherType.雨天, "大雨", relativeHumidity: 90, precipitation: 25, visibility: 2.5);
|
||||
TestMillimeterWaveTransmittance(WeatherType.雾天, "雾", relativeHumidity: 70, visibility: 1);
|
||||
TestMillimeterWaveTransmittance(WeatherType.沙尘, "沙尘", visibility: 0.5);
|
||||
TestMillimeterWaveTransmittance(WeatherType.雪天, "雪天", temperature: -5, relativeHumidity: 80, visibility: 1, precipitation: 5);
|
||||
}
|
||||
|
||||
// 测试特定天气条件下的毫米波透过率
|
||||
static void TestMillimeterWaveTransmittance(WeatherType type, string description,
|
||||
double temperature = 25, double relativeHumidity = 50,
|
||||
double visibility = 10, double? precipitation = null)
|
||||
{
|
||||
double[] distances = [0.1, 0.5, 1, 5, 10]; // 测试不同距离(公里)
|
||||
|
||||
// 创建天气条件
|
||||
var weatherCondition = new WeatherCondition(
|
||||
type: type,
|
||||
temperature: temperature,
|
||||
relativeHumidity: relativeHumidity,
|
||||
visibility: visibility,
|
||||
precipitation: precipitation
|
||||
);
|
||||
|
||||
// 输出结果
|
||||
Console.WriteLine($"\n[{description}条件下的毫米波透过率]");
|
||||
WeatherCondition.PrintWeatherInfo(weatherCondition);
|
||||
foreach (var d in distances)
|
||||
{
|
||||
double mmWaveTransmittance = AtmosphericTransmittanceCalculator.CalcMillimeterWave(weatherCondition, d);
|
||||
Console.WriteLine($"距离:{d}公里, 毫米波透过率为: {mmWaveTransmittance:P2}");
|
||||
}
|
||||
}
|
||||
|
||||
// 测试不同天气条件下的红外线透过率
|
||||
static void TestIRTransmittanceInDifferentWeather()
|
||||
{
|
||||
// 测试各种天气条件
|
||||
TestIRTransmittance(WeatherType.晴天, "晴朗");
|
||||
TestIRTransmittance(WeatherType.雨天, "小雨", relativeHumidity: 60, precipitation: 2.5, visibility: 5);
|
||||
TestIRTransmittance(WeatherType.雨天, "大雨", relativeHumidity: 90, precipitation: 25, visibility: 2.5);
|
||||
TestIRTransmittance(WeatherType.雾天, "雾", relativeHumidity: 70, visibility: 1);
|
||||
TestIRTransmittance(WeatherType.沙尘, "沙尘", visibility: 0.5);
|
||||
TestIRTransmittance(WeatherType.雪天, "雪天", temperature: -5, relativeHumidity: 80, visibility: 1, precipitation: 5);
|
||||
}
|
||||
|
||||
// 测试不同天气条件下的紫外线透过率
|
||||
static void TestUVTransmittanceInDifferentWeather()
|
||||
{
|
||||
// 测试各种天气条件
|
||||
TestUVTransmittance(WeatherType.晴天, "晴朗");
|
||||
TestUVTransmittance(WeatherType.雨天, "小雨", relativeHumidity: 60, precipitation: 2.5, visibility: 5);
|
||||
TestUVTransmittance(WeatherType.雨天, "大雨", relativeHumidity: 90, precipitation: 25, visibility: 2.5);
|
||||
TestUVTransmittance(WeatherType.雾天, "雾", relativeHumidity: 70, visibility: 1);
|
||||
TestUVTransmittance(WeatherType.沙尘, "沙尘", visibility: 0.5);
|
||||
TestUVTransmittance(WeatherType.雪天, "雪天", temperature: -5, relativeHumidity: 80, visibility: 1, precipitation: 5);
|
||||
}
|
||||
|
||||
// 测试特定天气条件下的紫外线透过率
|
||||
static void TestUVTransmittance(WeatherType type, string description,
|
||||
double temperature = 25, double relativeHumidity = 50,
|
||||
double visibility = 10, double? precipitation = null)
|
||||
{
|
||||
double[] distances = [0.1, 0.5, 1, 5, 10]; // 测试不同距离(公里)
|
||||
|
||||
// 创建天气条件
|
||||
var weatherCondition = new WeatherCondition(
|
||||
type: type,
|
||||
temperature: temperature,
|
||||
relativeHumidity: relativeHumidity,
|
||||
visibility: visibility,
|
||||
precipitation: precipitation
|
||||
);
|
||||
|
||||
// 输出结果
|
||||
Console.WriteLine($"\n[{description}条件下的紫外线透过率]");
|
||||
WeatherCondition.PrintWeatherInfo(weatherCondition);
|
||||
foreach (var d in distances)
|
||||
{
|
||||
double uvTransmittance = AtmosphericTransmittanceCalculator.CalcUV(weatherCondition, d);
|
||||
Console.WriteLine($"距离:{d}公里, 紫外线透过率为: {uvTransmittance:P2}");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
using AirTransmission;
|
||||
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("脉冲激光目标指示器辐射能量计算");
|
||||
|
||||
// 创建一个晴天的天气条件
|
||||
var weather = new Weather(
|
||||
type: WeatherType.Clear,
|
||||
temperature: 25,
|
||||
relativeHumidity: 60,
|
||||
visibility: 10
|
||||
);
|
||||
|
||||
// 设置激光和目标参数
|
||||
double laserEnergy = 0.130; // 130 mJ
|
||||
double pulseWidth = 15; // 15 ns
|
||||
double targetDistance = 1; // 1公里
|
||||
double receiverDistance = 1; // 1公里
|
||||
double targetReflectivity = 0.2; // 假设目标反射率为20%
|
||||
|
||||
// 计算激光透过率和接收功率
|
||||
double transmittance = AtmosphericTransmittanceCalculator.CalcLaser(weather, targetDistance);
|
||||
double receivedPower = AtmosphericTransmittanceCalculator.CalculateReceivedRadiation(transmittance, laserEnergy, pulseWidth, targetDistance, receiverDistance, targetReflectivity);
|
||||
|
||||
Console.WriteLine($"\n导弹导引头接收到的平均功率: {receivedPower:E2} W");
|
||||
|
||||
// 执行各种测试
|
||||
Console.WriteLine("\n单程辐射能量计算");
|
||||
CalculateSinglePathRadiation();
|
||||
|
||||
Console.WriteLine("\n烟幕影响计算");
|
||||
TestSmokeScreenEffect();
|
||||
|
||||
Console.WriteLine("\n不同天气条件下的激光透过率测试");
|
||||
TestLaserTransmittanceInDifferentWeather();
|
||||
|
||||
Console.WriteLine("\n不同风速条件下的湍流效应测试");
|
||||
TestTurbulenceWithDifferentWindSpeeds();
|
||||
|
||||
Console.WriteLine("\n不同天气条件下的红外线透过率测试");
|
||||
TestIRTransmittanceInDifferentWeather();
|
||||
|
||||
Console.WriteLine("\n不同天气条件下的毫米波透过率测试");
|
||||
TestMillimeterWaveTransmittanceInDifferentWeather();
|
||||
|
||||
Console.WriteLine("\n不同天气条件下的紫外线透过率测试");
|
||||
TestUVTransmittanceInDifferentWeather();
|
||||
}
|
||||
|
||||
// 测试不同天气条件下的激光透过率
|
||||
static void TestLaserTransmittanceInDifferentWeather()
|
||||
{
|
||||
// 测试各种天气条件
|
||||
TestLaserTransmittance(WeatherType.Clear, "晴朗");
|
||||
TestLaserTransmittance(WeatherType.Rain, "小雨", relativeHumidity: 60, precipitation: 2.5, visibility: 5);
|
||||
TestLaserTransmittance(WeatherType.Rain, "大雨", relativeHumidity: 90, precipitation: 25, visibility: 2.5);
|
||||
TestLaserTransmittance(WeatherType.Fog, "雾", relativeHumidity: 80, visibility: 5);
|
||||
TestLaserTransmittance(WeatherType.Dust, "沙尘", visibility: 0.5);
|
||||
TestLaserTransmittance(WeatherType.Snow, "雪天", temperature: -5, relativeHumidity: 80, visibility: 1, precipitation: 2.5);
|
||||
}
|
||||
|
||||
// 测试特定天气条件下的激光透过率
|
||||
static void TestLaserTransmittance(WeatherType type, string description,
|
||||
double temperature = 25, double relativeHumidity = 50,
|
||||
double visibility = 23, double precipitation = 0,
|
||||
double latitude = 30, double windSpeed = 0)
|
||||
{
|
||||
double[] distances = [0.1, 0.5, 1, 5, 10]; // 测试不同距离(公里)
|
||||
|
||||
// 创建天气条件
|
||||
var weather = new Weather(
|
||||
type: type,
|
||||
temperature: temperature,
|
||||
relativeHumidity: relativeHumidity,
|
||||
visibility: visibility,
|
||||
precipitation: precipitation,
|
||||
windSpeed: windSpeed
|
||||
);
|
||||
|
||||
// 输出结果
|
||||
Console.WriteLine($"\n[{description}条件下的激光透过率]");
|
||||
Weather.PrintWeatherInfo(weather);
|
||||
foreach (var d in distances){
|
||||
double laserTransmittance = AtmosphericTransmittanceCalculator.CalcLaser(weather, d);
|
||||
|
||||
// 增加合理的光束传输高度,与传输距离和风速相关
|
||||
double height = 100 + windSpeed * 10; // 风速越大,光束平均高度越高
|
||||
double turbulenceEffect = AtmosphericTransmittanceCalculator.CalcTurbulenceEffect(weather, d, height);
|
||||
|
||||
Console.WriteLine($"距离:{d}公里, 1.06μm激光透过率为: {laserTransmittance:P2}, 湍流效应: {turbulenceEffect:P2}");
|
||||
}
|
||||
}
|
||||
|
||||
// 计算单程辐射能量
|
||||
static void CalculateSinglePathRadiation()
|
||||
{
|
||||
// 创建天气条件
|
||||
var weather = new Weather(
|
||||
type: WeatherType.Clear,
|
||||
temperature: 25,
|
||||
relativeHumidity: 60,
|
||||
visibility: 10
|
||||
);
|
||||
|
||||
double targetRadiation = 2E+006; // 100 W/Sr
|
||||
double receiverDistance = 3; // 3公里
|
||||
|
||||
// 计算透过率和接收功率
|
||||
double transmittance = AtmosphericTransmittanceCalculator.CalcLaser(weather, receiverDistance);
|
||||
double receivedPower = AtmosphericTransmittanceCalculator.CalculateReceivedRadiationSinglePath(transmittance, targetRadiation, receiverDistance);
|
||||
|
||||
Console.WriteLine($"\n导弹导引头接收到的辐射能量: {receivedPower:E2} W/Sr");
|
||||
}
|
||||
|
||||
// 测试特定天气条件下的红外线透过率
|
||||
static void TestIRTransmittance(WeatherType type, string description,
|
||||
double temperature = 25, double relativeHumidity = 50,
|
||||
double visibility = 10, double precipitation = 0)
|
||||
{
|
||||
double[] distances = [0.1, 0.5, 1, 5, 10]; // 测试不同距离(公里)
|
||||
|
||||
// 创建天气条件
|
||||
var weather = new Weather(
|
||||
type: type,
|
||||
temperature: temperature,
|
||||
relativeHumidity: relativeHumidity,
|
||||
visibility: visibility,
|
||||
precipitation: precipitation
|
||||
);
|
||||
|
||||
// 输出结果
|
||||
Console.WriteLine($"\n[{description}条件下的红外线透过率]");
|
||||
Weather.PrintWeatherInfo(weather);
|
||||
foreach (var d in distances)
|
||||
{
|
||||
double irTransmittance = AtmosphericTransmittanceCalculator.CalcIR(weather, d);
|
||||
Console.WriteLine($"距离:{d}公里, 红外线透过率为: {irTransmittance:P2}");
|
||||
}
|
||||
}
|
||||
|
||||
// 测试烟幕效应
|
||||
static void TestSmokeScreenEffect()
|
||||
{
|
||||
Console.WriteLine("\n测试烟幕对激光的影响:");
|
||||
Console.WriteLine("------------------------");
|
||||
|
||||
// 测试不同烟幕浓度下的透过率
|
||||
double[] smokeConcentrations = [0.05, 0.1, 0.2, 0.5, 1.0, 2.0]; // g/m³
|
||||
double smokeThickness = 10; // 米
|
||||
double wavelength = 1.06; // 微米 (1060nm)
|
||||
|
||||
foreach (double concentration in smokeConcentrations)
|
||||
{
|
||||
double transmittance = AtmosphericTransmittanceCalculator.CalculateSmokeScreenTransmittance(
|
||||
wavelength, concentration, smokeThickness);
|
||||
Console.WriteLine($"烟幕浓度: {concentration:F2} g/m³, 烟幕厚度: {smokeThickness}米, 透过率: {transmittance:F4}");
|
||||
}
|
||||
}
|
||||
|
||||
// 测试不同天气条件下的毫米波透过率
|
||||
static void TestMillimeterWaveTransmittanceInDifferentWeather()
|
||||
{
|
||||
// 测试各种天气条件
|
||||
TestMillimeterWaveTransmittance(WeatherType.Clear, "晴朗");
|
||||
TestMillimeterWaveTransmittance(WeatherType.Rain, "小雨", relativeHumidity: 60, precipitation: 2.5, visibility: 5);
|
||||
TestMillimeterWaveTransmittance(WeatherType.Rain, "大雨", relativeHumidity: 90, precipitation: 25, visibility: 2.5);
|
||||
TestMillimeterWaveTransmittance(WeatherType.Fog, "雾", relativeHumidity: 70, visibility: 1);
|
||||
TestMillimeterWaveTransmittance(WeatherType.Dust, "沙尘", visibility: 0.5);
|
||||
TestMillimeterWaveTransmittance(WeatherType.Snow, "雪天", temperature: -5, relativeHumidity: 80, visibility: 1, precipitation: 5);
|
||||
}
|
||||
|
||||
// 测试特定天气条件下的毫米波透过率
|
||||
static void TestMillimeterWaveTransmittance(WeatherType type, string description,
|
||||
double temperature = 25, double relativeHumidity = 50,
|
||||
double visibility = 10, double precipitation = 0)
|
||||
{
|
||||
double[] distances = [0.1, 0.5, 1, 5, 10]; // 测试不同距离(公里)
|
||||
|
||||
// 创建天气条件
|
||||
var weather = new Weather(
|
||||
type: type,
|
||||
temperature: temperature,
|
||||
relativeHumidity: relativeHumidity,
|
||||
visibility: visibility,
|
||||
precipitation: precipitation
|
||||
);
|
||||
|
||||
// 输出结果
|
||||
Console.WriteLine($"\n[{description}条件下的毫米波透过率]");
|
||||
Weather.PrintWeatherInfo(weather);
|
||||
foreach (var d in distances)
|
||||
{
|
||||
double mmWaveTransmittance = AtmosphericTransmittanceCalculator.CalcMillimeterWave(weather, d);
|
||||
Console.WriteLine($"距离:{d}公里, 毫米波透过率为: {mmWaveTransmittance:P2}");
|
||||
}
|
||||
}
|
||||
|
||||
// 测试不同天气条件下的红外线透过率
|
||||
static void TestIRTransmittanceInDifferentWeather()
|
||||
{
|
||||
// 测试各种天气条件
|
||||
TestIRTransmittance(WeatherType.Clear, "晴朗");
|
||||
TestIRTransmittance(WeatherType.Rain, "小雨", relativeHumidity: 60, precipitation: 2.5, visibility: 5);
|
||||
TestIRTransmittance(WeatherType.Rain, "大雨", relativeHumidity: 90, precipitation: 25, visibility: 2.5);
|
||||
TestIRTransmittance(WeatherType.Fog, "雾", relativeHumidity: 70, visibility: 1);
|
||||
TestIRTransmittance(WeatherType.Dust, "沙尘", visibility: 0.5);
|
||||
TestIRTransmittance(WeatherType.Snow, "雪天", temperature: -5, relativeHumidity: 80, visibility: 1, precipitation: 5);
|
||||
}
|
||||
|
||||
// 测试不同天气条件下的紫外线透过率
|
||||
static void TestUVTransmittanceInDifferentWeather()
|
||||
{
|
||||
// 测试各种天气条件
|
||||
TestUVTransmittance(WeatherType.Clear, "晴朗");
|
||||
TestUVTransmittance(WeatherType.Rain, "小雨", relativeHumidity: 60, precipitation: 2.5, visibility: 5);
|
||||
TestUVTransmittance(WeatherType.Rain, "大雨", relativeHumidity: 90, precipitation: 25, visibility: 2.5);
|
||||
TestUVTransmittance(WeatherType.Fog, "雾", relativeHumidity: 70, visibility: 1);
|
||||
TestUVTransmittance(WeatherType.Dust, "沙尘", visibility: 0.5);
|
||||
TestUVTransmittance(WeatherType.Snow, "雪天", temperature: -5, relativeHumidity: 80, visibility: 1, precipitation: 5);
|
||||
}
|
||||
|
||||
// 测试特定天气条件下的紫外线透过率
|
||||
static void TestUVTransmittance(WeatherType type, string description,
|
||||
double temperature = 25, double relativeHumidity = 50,
|
||||
double visibility = 10, double precipitation = 0)
|
||||
{
|
||||
double[] distances = [0.1, 0.5, 1, 5, 10]; // 测试不同距离(公里)
|
||||
|
||||
// 创建天气条件
|
||||
var weather = new Weather(
|
||||
type: type,
|
||||
temperature: temperature,
|
||||
relativeHumidity: relativeHumidity,
|
||||
visibility: visibility,
|
||||
precipitation: precipitation
|
||||
);
|
||||
|
||||
// 输出结果
|
||||
Console.WriteLine($"\n[{description}条件下的紫外线透过率]");
|
||||
Weather.PrintWeatherInfo(weather);
|
||||
foreach (var d in distances)
|
||||
{
|
||||
double uvTransmittance = AtmosphericTransmittanceCalculator.CalcUV(weather, d);
|
||||
Console.WriteLine($"距离:{d}公里, 紫外线透过率为: {uvTransmittance:P2}");
|
||||
}
|
||||
}
|
||||
|
||||
// 测试不同风速条件下的湍流效应
|
||||
static void TestTurbulenceWithDifferentWindSpeeds()
|
||||
{
|
||||
// 测试不同风速对湍流的影响
|
||||
TestLaserTransmittance(WeatherType.Clear, "晴朗无风", windSpeed: 0);
|
||||
TestLaserTransmittance(WeatherType.Clear, "晴朗轻微微风", windSpeed: 0.5);
|
||||
TestLaserTransmittance(WeatherType.Clear, "晴朗微风", windSpeed: 1);
|
||||
TestLaserTransmittance(WeatherType.Clear, "晴朗轻风", windSpeed: 2.5);
|
||||
TestLaserTransmittance(WeatherType.Clear, "晴朗中风", windSpeed: 5);
|
||||
TestLaserTransmittance(WeatherType.Clear, "晴朗强风", windSpeed: 10);
|
||||
TestLaserTransmittance(WeatherType.Clear, "晴朗大风", windSpeed: 15);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user