diff --git a/CHANGELOG.md b/CHANGELOG.md
index 68866aa..c9a5cd2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,11 @@
- 毫米波跟踪和锁定阶段采用脉冲多普勒制导
- 命中概率和系统随机噪声
+## [1.1.20] - 2025-05-19
+- 增加了SwerlingRCS回波模型
+- 在毫米波制导中使用SwerlingRCS回波模型获取目标RCS
+- 增加了扫描周期计时器,用于控制RCS的更新
+
## [1.1.19] - 2025-05-18
- 增加了装备的RCS特征矩阵
- 在毫米波末制导中,用RCS特征矩阵取值
diff --git a/ThreatSource/data/missiles/mmw/mmw_001.toml b/ThreatSource/data/missiles/mmw/mmw_001.toml
index 963958a..f499e7e 100644
--- a/ThreatSource/data/missiles/mmw/mmw_001.toml
+++ b/ThreatSource/data/missiles/mmw/mmw_001.toml
@@ -38,7 +38,7 @@ RecognitionSNRThreshold = -25.0 # 识别信噪比阈值 (分贝)
LockSNRThreshold = -10.0 # 锁定信噪比阈值 (分贝)
TargetLostTolerance = 0.2 # 目标丢失容忍时间 (秒)
-LockConfirmationTime = 0.3 # 锁定确认时间 (秒)
+LockConfirmationTime = 0.3 # 锁定确认时间 (秒)
PulseRepetitionFrequency = 1.0e-4 # 脉冲重复频率 (秒, JSON中为1e-4,通常PRT单位是秒,PRF是Hz。这里JSON的注释可能不准确,按数值和C#模型属性名推断,这里应为PulseRepetitionTime,即脉冲重复间隔)
TransmitPower = 0.3 # 发射功率 (瓦特)
diff --git a/ThreatSource/src/Equipment/EquipmentProperties.cs b/ThreatSource/src/Equipment/EquipmentProperties.cs
index aa72309..0e4cf9a 100644
--- a/ThreatSource/src/Equipment/EquipmentProperties.cs
+++ b/ThreatSource/src/Equipment/EquipmentProperties.cs
@@ -52,7 +52,7 @@ namespace ThreatSource.Equipment
///
/// 定义目标的种类(坦克、装甲车、直升机等)
///
- public string Type { get; set; } = string.Empty;
+ public EquipmentType Type { get; set; }
///
/// 获取或设置装备质量
@@ -172,7 +172,7 @@ namespace ThreatSource.Equipment
public EquipmentProperties()
{
SetDefaultValues();
- Type = "Tank"; // 默认类型为坦克
+ Type = EquipmentType.Tank; // 默认类型为坦克
ThermalPattern = new ThermalPattern(
new double[ThermalPattern.GRID_SIZE, ThermalPattern.GRID_SIZE],
new double[ThermalPattern.GRID_SIZE, ThermalPattern.GRID_SIZE]
@@ -192,6 +192,7 @@ namespace ThreatSource.Equipment
///
public void SetDefaultValues()
{
+ Type = EquipmentType.Tank;
Mass = 50000.0;
Length = 10.0;
Width = 3.5;
diff --git a/ThreatSource/src/Guidance/MillimeterWaveGuidanceSystem.cs b/ThreatSource/src/Guidance/MillimeterWaveGuidanceSystem.cs
index 5087a4b..9467a3c 100644
--- a/ThreatSource/src/Guidance/MillimeterWaveGuidanceSystem.cs
+++ b/ThreatSource/src/Guidance/MillimeterWaveGuidanceSystem.cs
@@ -48,15 +48,6 @@ namespace ThreatSource.Guidance
///
private readonly MillimeterWaveGuidanceConfig config;
- ///
- /// 随机数生成器实例
- ///
- ///
- /// 用于生成随机扰动
- /// 模拟系统噪声和识别概率
- ///
- private readonly Random random = new();
-
///
/// 上一次探测到的目标位置 (使用可空类型)
///
@@ -93,6 +84,11 @@ namespace ThreatSource.Guidance
///
private double lockConfirmationTimer = 0;
+ ///
+ /// 扫描周期计时器
+ ///
+ private double scanCycleTimer = 0;
+
///
/// 当前工作模式
///
@@ -121,10 +117,15 @@ namespace ThreatSource.Guidance
///
/// 最大扫描半径,单位:弧度
///
- private double maxScanRadius => config.FieldOfViewAngle * Math.PI / 180.0 / 2;
+ private double MaxScanRadius => config.FieldOfViewAngle * Math.PI / 180.0 / 2;
private const double SpeedOfLight = 299792458.0; // m/s
+ ///
+ /// Swerling模型实例
+ ///
+ private readonly SwerlingRcsModel swerlingRcsModel;
+
///
/// 初始化毫米波制导系统的新实例
///
@@ -154,6 +155,7 @@ namespace ThreatSource.Guidance
this.config = config;
InitializeJamming(config.JammingResistanceThreshold, SupportedJammingTypes, SupportedBlockingJammingTypes);
SwitchToSearchMode(); // 初始化为搜索模式
+ swerlingRcsModel = new SwerlingRcsModel();
}
///
@@ -313,7 +315,7 @@ namespace ThreatSource.Guidance
// 使用配置参数
currentScanAngle += config.ScanAngularSpeedDeg * Math.PI / 180.0 * deltaTime;
currentScanRadius += config.ScanRadiusGrowthRateDeg * Math.PI / 180.0 * deltaTime;
- currentScanRadius = Math.Min(currentScanRadius, maxScanRadius);
+ currentScanRadius = Math.Min(currentScanRadius, MaxScanRadius);
if (currentScanAngle >= 2 * Math.PI)
{
@@ -328,6 +330,17 @@ namespace ThreatSource.Guidance
// 非搜索模式时重置扫描参数
currentScanRadius = config.SearchBeamWidth * Math.PI / 720.0;
}
+
+ // 更新扫描周期计时器
+ if (scanCycleTimer < 360 / config.ScanAngularSpeedDeg)
+ {
+ scanCycleTimer += deltaTime;
+ }
+ else
+ {
+ scanCycleTimer = 0;
+ swerlingRcsModel.ClearAllCachedRcs();
+ }
}
///
@@ -559,6 +572,7 @@ namespace ThreatSource.Guidance
Vector3D targetUp = Vector3D.Zero;
Vector3D observerVector = Vector3D.Zero;
bool isTargetOrientationValid = false;
+ MotionStateType motionState = MotionStateType.Static;
if (target.KState != null)
{
@@ -580,6 +594,10 @@ namespace ThreatSource.Guidance
}
}
}
+ if(target.KState.Speed >0.1)
+ {
+ motionState = MotionStateType.ConstantVelocity;
+ }
}
if (!isTargetOrientationValid)
@@ -605,6 +623,11 @@ namespace ThreatSource.Guidance
rcsLinear = Math.Pow(10, rcsDbSm / 10.0);
Debug.WriteLine($"[RCS获取] Target {target.Id}: RCS_dBsm: {rcsDbSm}, RCS_Linear: {rcsLinear}, ");
+ // 采用Swerling模型计算RCS
+ rcsLinear = swerlingRcsModel.GetRealtimeRcs(target.Id, target.Properties.Type, motionState, rcsLinear, false);
+
+ Debug.WriteLine($"[RCS获取-Swerling模型] Target {target.Id}: RCS_Linear: {rcsLinear} ");
+
double snr_dB = CalculateSNR(distance, rcsLinear, liveSmokeTransmittance);
if (currentMode == WorkMode.Search)
diff --git a/ThreatSource/src/MIssile/CompositeGuidedMissile.cs b/ThreatSource/src/MIssile/CompositeGuidedMissile.cs
index ecb7596..37fefc5 100644
--- a/ThreatSource/src/MIssile/CompositeGuidedMissile.cs
+++ b/ThreatSource/src/MIssile/CompositeGuidedMissile.cs
@@ -494,8 +494,8 @@ namespace ThreatSource.Missile
else if (guidanceSystem != null) // 如果不是SimulationElement但非null,记录一个警告或默认值
{
string keyName = $"SubGuidanceSystem_Status_{i}";
- statusInfo.ExtendedProperties[keyName] = "Error: Guidance system is not a SimulationElement or is null.";
- Debug.WriteLine($"[CompositeGuidedMissile.GetStatusInfo] Warning: Guidance system at index {i} (type: {guidanceSystem.GetType().Name}) is not a SimulationElement or is null.");
+ statusInfo.ExtendedProperties[keyName] = "错误: 制导系统不是 SimulationElement 或为null.";
+ Debug.WriteLine($"[CompositeGuidedMissile.GetStatusInfo] 警告: 制导系统 at index {i} (type: {guidanceSystem.GetType().Name}) 不是 SimulationElement 或为null.");
}
}
return statusInfo;
diff --git a/ThreatSource/src/MIssile/MillimeterWaveTerminalGuidedMissile.cs b/ThreatSource/src/MIssile/MillimeterWaveTerminalGuidedMissile.cs
index 6467522..daff4f4 100644
--- a/ThreatSource/src/MIssile/MillimeterWaveTerminalGuidedMissile.cs
+++ b/ThreatSource/src/MIssile/MillimeterWaveTerminalGuidedMissile.cs
@@ -240,6 +240,7 @@ namespace ThreatSource.Missile
{
var statusInfo = base.GetStatusInfo();
statusInfo.ExtendedProperties["CurrentStage"] = currentStage.ToString();
+ statusInfo.ExtendedProperties["GuidanceSystem"] = guidanceSystem.GetStatusInfo().ToString();
return statusInfo;
}
}
diff --git a/ThreatSource/src/Utils/SwerlingRcsModel.cs b/ThreatSource/src/Utils/SwerlingRcsModel.cs
new file mode 100644
index 0000000..fdeac8d
--- /dev/null
+++ b/ThreatSource/src/Utils/SwerlingRcsModel.cs
@@ -0,0 +1,256 @@
+using System.Diagnostics;
+using ThreatSource.Equipment;
+
+namespace ThreatSource.Utils
+{
+ ///
+ /// 目标Swerling模型类型枚举,定义了目标可能的RCS起伏模型类型。
+ ///
+ public enum TargetSwerlingModelType
+ {
+ ///
+ /// 慢起伏, 指数分布
+ ///
+ Swerling_I,
+ ///
+ /// 快起伏, 指数分布
+ ///
+ Swerling_II,
+ ///
+ /// 慢起伏, 卡方4自由度 (Gamma k=2)
+ ///
+ Swerling_III,
+
+ ///
+ /// 快起伏, 卡方4自由度 (Gamma k=2)
+ ///
+ Swerling_IV
+ }
+
+ ///
+ /// 目标运动状态枚举,定义了目标可能的运动状态。
+ ///
+ public enum MotionStateType
+ {
+ ///
+ /// 静止
+ ///
+ Static,
+ ///
+ /// 匀速
+ ///
+ ConstantVelocity,
+ ///
+ /// 机动
+ ///
+ Maneuvering,
+ ///
+ /// 其他
+ ///
+ Other
+ }
+
+ ///
+ /// Swerling 雷达散射截面 (RCS) 模拟器类。
+ ///
+ ///
+ /// 此类根据Swerling模型理论,提供方法来模拟不同类型目标RCS值的随机起伏。
+ /// 支持Swerling I, II, III, IV 四种模型,并能处理慢起伏和快起伏特性。
+ ///
+ public class SwerlingRcsModel
+ {
+ private readonly Random _randomGenerator; // 随机数生成器
+ private readonly Dictionary _slowFluctuationRcsCache; // 用于存储慢起伏目标当前扫描周期的RCS
+
+ ///
+ /// 初始化 SwerlingRcsSimulator 类的新实例。
+ ///
+ /// 可选的随机数生成器种子,用于可复现的随机序列。
+ /// 如果未提供种子,则使用默认的、基于时间的随机数生成器。
+ public SwerlingRcsModel(int? seed = null) // 构造函数,可选随机数种子
+ {
+ if (seed.HasValue)
+ {
+ _randomGenerator = new Random(seed.Value);
+ }
+ else
+ {
+ _randomGenerator = new Random();
+ }
+ _slowFluctuationRcsCache = [];
+ }
+
+ ///
+ /// 从指数分布中采样一个RCS值,主要用于Swerling I型和II型模型。
+ ///
+ /// 目标的平均RCS值(指数分布的尺度参数)。
+ /// 一个根据指数分布采样得到的RCS值。
+ ///
+ /// 使用逆变换采样法。
+ /// 如果 非正,则返回0.0。
+ ///
+ private double SampleExponentialDistribution(double sigmaAverage)
+ {
+ if (sigmaAverage <= 0)
+ {
+ return 0.0;
+ }
+ double u = _randomGenerator.NextDouble();
+ return -sigmaAverage * Math.Log(1.0 - u);
+ }
+
+ ///
+ /// 从形状参数k=2的伽马分布中采样一个RCS值,主要用于Swerling III型和IV型模型。
+ ///
+ /// 目标的平均RCS值。伽马分布的尺度参数将是 / 2。
+ /// 一个根据伽马分布(k=2)采样得到的RCS值。
+ ///
+ /// 通过对两个独立的、尺度参数为 /2 的指数分布随机变量求和来实现。
+ /// 如果 非正,则返回0.0。
+ ///
+ private double SampleGammaDistributionK2(double sigmaAverage)
+ {
+ if (sigmaAverage <= 0)
+ {
+ return 0.0;
+ }
+ double scaleForComponent = sigmaAverage / 2.0;
+ if (scaleForComponent <= 0)
+ {
+ return 0.0;
+ }
+ double x1 = SampleExponentialDistribution(scaleForComponent);
+ double x2 = SampleExponentialDistribution(scaleForComponent);
+ return x1 + x2;
+ }
+
+ ///
+ /// 根据指定的目标参数(包括装备类型和运动状态),获取一个模拟的实时雷达散射截面(RCS)值。
+ /// Swerling模型类型会根据装备类型和运动状态在内部自动决定。
+ ///
+ /// 目标的唯一字符串标识符。对于慢起伏模型,此ID用于在同一扫描周期内缓存和复用RCS值。
+ /// 目标类型。
+ /// 目标的运动状态。
+ /// 目标的平均RCS值,作为所选统计分布的参数,单位为平方米。
+ /// 一个布尔值,指示当前调用是否代表一个新的扫描周期的开始。此参数仅对慢起伏模型有意义,用于决定是否应重新采样RCS值。
+ /// 模拟计算得到的瞬时RCS值。
+ /// 如果为慢起伏模型但未提供 。
+ /// 如果内部决定的Swerling模型类型是不支持的类型。
+ ///
+ /// 对于慢起伏模型,如果 为true或缓存中无此目标ID的RCS值,则会重新采样;否则返回缓存值。
+ /// 对于快起伏模型,每次调用都会重新采样。
+ /// 如果 非正,则返回0.0。
+ ///
+ public double GetRealtimeRcs(
+ string targetId,
+ EquipmentType equipmentType,
+ MotionStateType motionState,
+ double averageRcsValue,
+ bool isNewScanPeriod)
+ {
+ TargetSwerlingModelType modelType = DecideSwerlingModel(equipmentType, motionState);
+
+ if (string.IsNullOrEmpty(targetId) &&
+ (modelType == TargetSwerlingModelType.Swerling_I || modelType == TargetSwerlingModelType.Swerling_III))
+ {
+ throw new ArgumentNullException(nameof(targetId), "慢起伏模型 (Swerling I, III) 需要目标ID以保持状态。");
+ }
+ if (averageRcsValue <= 0)
+ {
+ return 0.0;
+ }
+
+ double currentRcs;
+
+ switch (modelType)
+ {
+ case TargetSwerlingModelType.Swerling_I:
+ if (isNewScanPeriod || !_slowFluctuationRcsCache.TryGetValue(targetId, out double swerling1Value))
+ {
+ currentRcs = SampleExponentialDistribution(averageRcsValue);
+ if (!string.IsNullOrEmpty(targetId)) _slowFluctuationRcsCache[targetId] = currentRcs;
+ }
+ else
+ {
+ currentRcs = swerling1Value;
+ }
+ break;
+ case TargetSwerlingModelType.Swerling_II:
+ currentRcs = SampleExponentialDistribution(averageRcsValue);
+ break;
+ case TargetSwerlingModelType.Swerling_III:
+ if (isNewScanPeriod || !_slowFluctuationRcsCache.TryGetValue(targetId, out double swerling3Value))
+ {
+ currentRcs = SampleGammaDistributionK2(averageRcsValue);
+ if (!string.IsNullOrEmpty(targetId)) _slowFluctuationRcsCache[targetId] = currentRcs;
+ }
+ else
+ {
+ currentRcs = swerling3Value;
+ }
+ break;
+ case TargetSwerlingModelType.Swerling_IV:
+ currentRcs = SampleGammaDistributionK2(averageRcsValue);
+ break;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(equipmentType), $"基于提供的 '{equipmentType}' 和运动状态生成的内部Swerling模型类型 '{modelType}' 不支持。" );
+ }
+ return currentRcs;
+ }
+
+ ///
+ /// (可选辅助函数)根据项目中定义的目标类型和运动状态,决定应采用的Swerling模型类型。
+ ///
+ /// 目标类型。
+ /// 目标的运动状态。
+ /// 推荐的Swerling模型类型。
+ ///
+ /// 此函数的具体选择逻辑基于对不同目标及其运动状态下RCS起伏特性的典型假设,
+ /// 可能需要根据实际项目需求进行调整和细化。
+ ///
+ private static TargetSwerlingModelType DecideSwerlingModel(
+ EquipmentType equipmentType,
+ MotionStateType motionState)
+ {
+ switch (equipmentType)
+ {
+ case EquipmentType.Tank:
+ case EquipmentType.APC:
+ return motionState == MotionStateType.Maneuvering ? TargetSwerlingModelType.Swerling_III : TargetSwerlingModelType.Swerling_I;
+ case EquipmentType.Helicopter:
+ return motionState == MotionStateType.Maneuvering ? TargetSwerlingModelType.Swerling_IV : TargetSwerlingModelType.Swerling_II;
+ case EquipmentType.Unknown:
+ default:
+ Trace.TraceWarning($"警告: DecideSwerlingModel 接收到未知EquipmentType: {equipmentType}. 返回默认模型 Swerling_I。");
+ return TargetSwerlingModelType.Swerling_I;
+ }
+ }
+
+ ///
+ /// 从慢起伏模型的RCS缓存中移除指定目标ID的条目。
+ ///
+ /// 要清除其缓存RCS的目标的唯一标识符。
+ ///
+ /// 主要用于当一个慢起伏目标不再被跟踪或其状态需要重置时,释放其占用的缓存资源。
+ /// 如果ID为空或缓存中不存在该ID,则此方法不执行任何操作。
+ ///
+ public void ClearCachedRcs(string targetId)
+ {
+ if (!string.IsNullOrEmpty(targetId) && _slowFluctuationRcsCache.ContainsKey(targetId))
+ {
+ _slowFluctuationRcsCache.Remove(targetId);
+ }
+ }
+
+ ///
+ /// 清除慢起伏模型RCS缓存中的所有条目。
+ ///
+ ///
+ /// 用于在仿真重置或需要完全刷新所有慢起伏目标状态时调用。
+ ///
+ public void ClearAllCachedRcs()
+ {
+ _slowFluctuationRcsCache.Clear();
+ }
+ }
+}
\ No newline at end of file
diff --git a/VERSION b/VERSION
index 3a21f22..0ee9c5d 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.1.19
\ No newline at end of file
+1.1.20
\ No newline at end of file
diff --git a/docs/project/develop_log.md b/docs/project/develop_log.md
index 91e30eb..121c437 100644
--- a/docs/project/develop_log.md
+++ b/docs/project/develop_log.md
@@ -7,6 +7,10 @@
- 事件描述
- 分析处理
+## 2025-05-19 增加了SwerlingRCS回波模型
+- 增加了SwerlingRCS回波模型
+- 在毫米波制导中,用RCS特征矩阵取值
+
## 2025-05-18 增加了装备的RCS特征矩阵
- 增加了装备的RCS特征矩阵
- 在毫米波末制导中,用RCS特征矩阵取值
diff --git a/docs/project/swerling_rcs_model_design.md b/docs/project/swerling_rcs_model_design.md
new file mode 100644
index 0000000..5c045af
--- /dev/null
+++ b/docs/project/swerling_rcs_model_design.md
@@ -0,0 +1,181 @@
+# Swerling RCS 模型设计文档
+
+## 1. 引言
+
+本文档详细描述了项目中 `SwerlingRcsModel.cs` 类的设计与实现,该类用于模拟雷达散射截面(RCS)的Swerling统计起伏模型。Swerling模型是雷达系统分析和目标探测性能评估中的重要工具,它描述了不同类型目标由于姿态微小变化或内部结构复杂性导致的RCS值随机波动特性。
+
+关于Swerling模型的更详细理论背景,请参考项目文档:[RCS统计模型理论](./theory.md#坦克装甲车和直升机的rcs统计模型选择与其运动特性结构复杂度及雷达观测条件密切相关以下是具体分析)。
+
+`SwerlingRcsModel` 类的具体实现位于以下路径:
+`ThreatSource/src/Utils/SwerlingRcsModel.cs`
+
+## 2. 设计目标
+
+`SwerlingRcsModel` 类的设计旨在满足以下目标:
+
+* **模拟RCS统计起伏**:提供一种机制来模拟目标RCS值的统计性波动,而不是使用固定的RCS值。
+* **支持标准Swerling模型**:实现对Swerling I、II、III、IV四种经典模型的支持。
+* **区分起伏速率**:能够区分慢起伏(slow fluctuation, Swerling I/III)和快起伏(fast fluctuation, Swerling II/IV)目标。
+* **可配置平均RCS**:允许用户为目标指定一个平均RCS值,作为所选统计分布的基准参数。
+* **支持可复现性**:通过可选的随机数生成器种子,确保在需要时能够获得可复现的RCS序列。
+* **自动化模型选择**:提供基于目标装备类型(`EquipmentType`)和运动状态(`MotionStateType`)自动选择合适Swerling模型的内部逻辑。
+
+## 3. 类详细设计: `SwerlingRcsModel`
+
+### 3.1 命名空间
+
+`ThreatSource.Utils`
+
+### 3.2 枚举 (Enums)
+
+#### `TargetSwerlingModelType`
+此枚举定义了支持的Swerling模型类型:
+* `Swerling_I`: 慢起伏模型,RCS值服从指数分布(卡方分布,2个自由度)。RCS值在一个扫描周期内保持不变,但在不同扫描周期之间独立变化。
+* `Swerling_II`: 快起伏模型,RCS值服从指数分布(卡方分布,2个自由度)。RCS值在每个雷达脉冲之间都独立变化。
+* `Swerling_III`: 慢起伏模型,RCS值服从卡方分布,4个自由度(等价于形状参数k=2的伽马分布)。RCS值在一个扫描周期内保持不变,但在不同扫描周期之间独立变化。
+* `Swerling_IV`: 快起伏模型,RCS值服从卡方分布,4个自由度(等价于形状参数k=2的伽马分布)。RCS值在每个雷达脉冲之间都独立变化。
+
+#### `MotionStateType`
+此枚举定义了目标可能的运动状态,用于辅助 `DecideSwerlingModel` 方法选择合适的Swerling模型:
+* `Static`: 目标静止。
+* `ConstantVelocity`: 目标进行匀速运动。
+* `Maneuvering`: 目标进行机动飞行/行驶。
+* `Other`: 其他未明确定义的运动状态。
+
+### 3.3 主要字段 (Fields)
+
+* `private readonly Random _randomGenerator;`
+ * 一个 `System.Random` 类的实例,用于生成模拟所需的随机数。其种子可以在构造函数中指定,以实现可复现的仿真结果。
+* `private readonly Dictionary _slowFluctuationRcsCache;`
+ * 一个字典,用于缓存慢起伏模型(Swerling I 和 III)在当前扫描周期内的RCS值。
+ * 键(`string`): 目标的唯一ID (`targetId`)。
+ * 值(`double`): 该目标在当前扫描周期缓存的RCS值(单位:平方米)。
+
+### 3.4 构造函数 (Constructor)
+
+* `public SwerlingRcsModel(int? seed = null)`
+ * 初始化 `_randomGenerator` 实例。如果提供了 `seed` 参数,则使用该种子;否则,使用默认的、基于时间的种子。
+ * 初始化 `_slowFluctuationRcsCache` 为一个新的空字典。
+
+### 3.5 核心公共方法 (Core Public Method)
+
+* `public double GetRealtimeRcs(string targetId, EquipmentType equipmentType, MotionStateType motionState, double averageRcsValue, bool isNewScanPeriod)`
+ * **参数**:
+ * `targetId (string)`: 目标的唯一标识符。对于慢起伏模型,此ID用于在同一扫描周期内缓存和复用RCS值。
+ * `equipmentType (EquipmentType)`: 目标类型(如Tank, Helicopter等),用于内部模型选择。
+ * `motionState (MotionStateType)`: 目标的运动状态,用于内部模型选择。
+ * `averageRcsValue (double)`: 目标的平均RCS值(单位:平方米),作为所选统计分布的参数。
+ * `isNewScanPeriod (bool)`: 指示当前调用是否代表一个新的扫描周期的开始。此参数仅对慢起伏模型有意义,用于决定是否应重新采样RCS值。
+ * **内部逻辑**:
+ 1. 调用 `DecideSwerlingModel(equipmentType, motionState)` 确定要使用的 `TargetSwerlingModelType`。
+ 2. 参数验证:
+ * 如果选择的是慢起伏模型(Swerling I 或 III)但 `targetId` 为空或null,则抛出 `ArgumentNullException`。
+ * 如果 `averageRcsValue` 小于或等于0,则直接返回0.0,不进行采样。
+ 3. 根据确定的 `TargetSwerlingModelType` 执行相应的采样逻辑:
+ * **`Swerling_I` (慢起伏, 指数分布)**:
+ * 如果 `isNewScanPeriod` 为 `true` 或者 `_slowFluctuationRcsCache` 中不存在 `targetId` 对应的项,则调用 `SampleExponentialDistribution(averageRcsValue)` 生成新的RCS值,并将其存储(或更新)到缓存中(以 `targetId` 为键)。
+ * 否则,直接从缓存中读取并返回之前存储的RCS值。
+ * **`Swerling_II` (快起伏, 指数分布)**:
+ * 每次调用都直接执行 `SampleExponentialDistribution(averageRcsValue)` 并返回新的RCS值,不使用缓存。
+ * **`Swerling_III` (慢起伏, 卡方4自由度/Gamma k=2)**:
+ * 与Swerling I类似,但调用 `SampleGammaDistributionK2(averageRcsValue)` 进行采样。同样处理缓存逻辑。
+ * **`Swerling_IV` (快起伏, 卡方4自由度/Gamma k=2)**:
+ * 每次调用都直接执行 `SampleGammaDistributionK2(averageRcsValue)` 并返回新的RCS值,不使用缓存。
+ * 如果内部确定的模型类型不被支持(理论上不应发生),则抛出 `ArgumentOutOfRangeException`。
+ * **返回值**:
+ * 模拟计算得到的瞬时RCS值(单位:平方米)。
+
+### 3.6 内部辅助方法 (Private Helper Methods)
+
+* `private double SampleExponentialDistribution(double sigmaAverage)`
+ * **用途**: 为Swerling I型和II型模型从指数分布中采样RCS值。
+ * **参数**: `sigmaAverage` (目标的平均RCS值,即指数分布的尺度参数)。
+ * **返回**: 一个根据指数分布采样得到的RCS值。如果 `sigmaAverage` 非正,则返回0.0。
+ * **实现**: 使用逆变换采样法 `(-sigmaAverage * Math.Log(1.0 - u))`,其中 `u` 是 `_randomGenerator.NextDouble()` 产生的 (0,1) 均匀分布随机数。
+
+* `private double SampleGammaDistributionK2(double sigmaAverage)`
+ * **用途**: 为Swerling III型和IV型模型从形状参数k=2的伽马分布中采样RCS值。
+ * **参数**: `sigmaAverage` (目标的平均RCS值)。
+ * **返回**: 一个根据伽马分布(k=2)采样得到的RCS值。如果 `sigmaAverage` 非正,则返回0.0。
+ * **实现**: 通过对两个独立的、尺度参数为 `sigmaAverage / 2.0` 的指数分布随机变量求和来实现。这两个指数分布的采样通过调用 `SampleExponentialDistribution` 完成。
+
+* `private static TargetSwerlingModelType DecideSwerlingModel(EquipmentType equipmentType, MotionStateType motionState)`
+ * **用途**: 根据目标类型和运动状态,决定应采用的Swerling模型类型。
+ * **输入**:
+ * `equipmentType (EquipmentType)`: 目标装备类型。
+ * `motionState (MotionStateType)`: 目标运动状态。
+ * **输出**: `TargetSwerlingModelType`。
+ * **决策规则**:
+ * `EquipmentType.Tank` 或 `EquipmentType.APC`:
+ * 若 `motionState` 为 `Maneuvering`,则返回 `TargetSwerlingModelType.Swerling_III`。
+ * 否则,返回 `TargetSwerlingModelType.Swerling_I`。
+ * `EquipmentType.Helicopter`:
+ * 若 `motionState` 为 `Maneuvering`,则返回 `TargetSwerlingModelType.Swerling_IV`。
+ * 否则,返回 `TargetSwerlingModelType.Swerling_II`。
+ * 对于 `EquipmentType.Unknown` 或其他未明确处理的 `equipmentType`:
+ * 返回 `TargetSwerlingModelType.Swerling_I` 并通过 `Trace.TraceWarning` 记录一条警告信息。
+
+### 3.7 缓存管理方法 (Cache Management Methods)
+
+* `public void ClearCachedRcs(string targetId)`
+ * **功能**: 从慢起伏模型的RCS缓存 (`_slowFluctuationRcsCache`) 中移除指定 `targetId` 的条目。
+ * 主要用于当一个慢起伏目标不再被跟踪或其状态需要重置时。
+
+* `public void ClearAllCachedRcs()`
+ * **功能**: 清除慢起伏模型RCS缓存中的所有条目。
+ * 用于在仿真重置、扫描周期结束或需要完全刷新所有慢起伏目标状态时调用。
+
+## 4. 集成与使用场景 (以 `MillimeterWaveGuidanceSystem` 为例)
+
+`SwerlingRcsModel` 类主要被 `MillimeterWaveGuidanceSystem` 用于在目标探测过程中为每个潜在目标计算一个动态的RCS值。
+
+### 4.1 实例化
+
+在 `MillimeterWaveGuidanceSystem` 的构造函数中,会创建一个 `SwerlingRcsModel` 的实例:
+```csharp
+swerlingRcsModel = new SwerlingRcsModel();
+```
+这里使用了无参构造函数,因此随机数生成器会使用默认种子。
+
+### 4.2 `GetRealtimeRcs` 调用
+
+在 `MillimeterWaveGuidanceSystem` 的 `TryDetectAndTrackTarget` 方法内部,当计算每个目标的SNR之前,会调用 `GetRealtimeRcs` 来获取其波动后的RCS值:
+```csharp
+// 假设 rcsLinear 是从目标 RcsPattern 或默认值获取的平均RCS
+rcsLinear = swerlingRcsModel.GetRealtimeRcs(
+ target.Id, // 目标唯一ID
+ target.Properties.Type, // 目标装备类型
+ motionState, // 运动状态 (根据目标速度判断为 Static 或 ConstantVelocity)
+ rcsLinear, // 平均RCS值
+ false // <<-- 注意:isNewScanPeriod 当前硬编码为 false
+);
+```
+**关键点**:
+* **`motionState` 参数**: 在 `MillimeterWaveGuidanceSystem` 的当前实现中,`motionState` 参数在调用 `GetRealtimeRcs` 前被确定。它首先被初始化为 `MotionStateType.Static`。如果检测到目标 `target.KState.Speed` 大于 `0.1`,则 `motionState` 被更新为 `MotionStateType.ConstantVelocity`。这意味着 `SwerlingRcsModel` 内部的 `DecideSwerlingModel` 方法会根据这一(有限的)动态信息选择Swerling模型(例如,坦克/APC 会在 `Static` 和 `ConstantVelocity` 两种情况下都选用Swerling I,直升机则都选用Swerling II,因为 `DecideSwerlingModel` 中 `ConstantVelocity` 未被特殊处理以触发Swerling III/IV)。
+* **`averageRcsValue` 参数**: 使用的是从目标自身 `RcsPattern` (如果存在且有效) 计算得到的、或一个默认的RCS值(线性单位,平方米)作为输入。Swerling模型在此基础上施加统计波动。
+* **`isNewScanPeriod` 参数**: 此参数在 `MillimeterWaveGuidanceSystem` 的调用中硬编码为 `false`。
+
+### 4.3 慢起伏缓存管理与扫描周期
+
+尽管 `isNewScanPeriod` 在单次 `GetRealtimeRcs` 调用时被硬编码为 `false`,但慢起伏模型的RCS值并不会永久不变。`MillimeterWaveGuidanceSystem` 通过其自身的扫描逻辑间接管理RCS的刷新:
+* 在 `UpdateConicalScan` 方法中,有一个 `scanCycleTimer` 用于跟踪当前扫描的持续时间。
+* 当 `scanCycleTimer` 达到一个完整扫描周期所需的时间 (由 `360 / config.ScanAngularSpeedDeg` 计算得到) 时,会调用 `swerlingRcsModel.ClearAllCachedRcs()`。
+* 这个调用会清空所有慢起伏目标的缓存RCS值。因此,在下一个扫描周期开始后,当这些目标再次被 `GetRealtimeRcs` 处理时,由于缓存中已无它们的数据(即使 `isNewScanPeriod` 仍为 `false`),`SwerlingRcsModel` 内部的逻辑 (`!_slowFluctuationRcsCache.TryGetValue(...)`) 会触发一次新的采样。
+
+这种机制有效地为所有慢起伏目标实现了基于扫描周期的RCS刷新。
+
+### 4.4 对SNR计算的影响
+
+由 `SwerlingRcsModel` 生成的波动RCS值(`rcsLinear`)随后被用于 `MillimeterWaveGuidanceSystem.CalculateSNR` 方法中。RCS值的波动会直接导致计算出的信噪比(SNR)产生相应的波动,这进一步影响了目标的探测概率、进入跟踪模式的条件以及最终的锁定稳定性,使得仿真更接近实际雷达系统面临的情况。
+
+## 5. 当前实现的假设与限制
+
+* **运动状态硬编码**: 如前所述,`MillimeterWaveGuidanceSystem` 在调用 `GetRealtimeRcs` 时,将 `motionState` 参数硬编码为 `MotionStateType.Static`。这限制了 `SwerlingRcsModel` 根据目标实际运动状态动态选择Swerling I/III或II/IV模型的能力。当前,选择主要基于 `equipmentType`,且总是对应于非机动情况(Swerling I 或 II)。
+* **运动状态判断的局限性**: `MillimeterWaveGuidanceSystem` 目前根据目标速度是否大于一个阈值 (`0.1`) 来区分 `MotionStateType.Static` 和 `MotionStateType.ConstantVelocity`。它尚未实现对 `MotionStateType.Maneuvering` (机动)状态的判断。因此,`SwerlingRcsModel` 的 `DecideSwerlingModel` 方法目前无法根据目标是否在进行机动来选择Swerling III 或 IV 模型;对于非机动(包括Static和ConstantVelocity),它将为坦克/APC选择Swerling I,为直升机选择Swerling II。
+* **`isNewScanPeriod` 硬编码**: `isNewScanPeriod` 参数在调用时硬编码为 `false`。慢起伏模型的RCS刷新完全依赖于 `MillimeterWaveGuidanceSystem` 内部周期性地调用 `ClearAllCachedRcs()`。
+* **基于平均RCS的波动**: Swerling模型是在一个外部提供的 `averageRcsValue` 基础上引入统计波动。该 `averageRcsValue` 本身可能是一个静态值或基于目标朝向的确定性计算结果,Swerling模型则在此确定性平均值周围产生随机起伏。
+
+## 6. 未来可能的改进 (可选)
+
+* **增强运动状态判断**: 当前 `motionState` 主要区分静止和(广义的)非机动匀速。未来可以考虑引入更复杂的逻辑来判断目标的 `MotionStateType.Maneuvering` (机动)状态,例如基于目标加速度或角速度的变化。这将使得 `SwerlingRcsModel` 能够更精确地为机动目标选择Swerling III/IV模型。
+* **细化 `isNewScanPeriod` 控制**: 如果未来需要更精细或针对特定目标的RCS刷新控制(例如,某些目标可能比其他目标更快地改变其统计特性),可以考虑更灵活地使用 `isNewScanPeriod` 参数,而不是仅依赖全局的 `ClearAllCachedRcs()`。
\ No newline at end of file
diff --git a/docs/project/theory.md b/docs/project/theory.md
index 5e73059..b665d21 100644
--- a/docs/project/theory.md
+++ b/docs/project/theory.md
@@ -323,3 +323,41 @@ iii. coeff_c = DeltaPos.MagnitudeSquared()
+## 坦克、装甲车和直升机的RCS统计模型选择与其运动特性、结构复杂度及雷达观测条件密切相关,以下是具体分析:
+一、坦克与装甲车
+适用模型:Swerling I/III型或对数正态分布
+运动特性
+地面装甲目标移动速度较慢,姿态变化平缓,RCS起伏周期较长,属于慢起伏目标。其RCS统计特性符合扫描间不相关、扫描内相关的特点。
+结构特征
+坦克表面存在炮塔、反应装甲等复杂结构,散射源包含镜面反射、边缘绕射和行波散射。这类目标在光学区的RCS分布可能呈现长拖尾特性,适合对数正态分布(高分辨率雷达场景)或卡方分布(多散射中心叠加)。
+典型应用
+Swerling I型:适用于单次扫描内RCS完全相关的情况,如固定姿态下的静态测量。Swerling III型:针对多散射中心且起伏幅度较大的场景,如坦克在崎岖地形中运动时的动态RCS。对数正态分布:用于高分辨率雷达对细节散射(如炮管、履带)的建模。
+二、直升机
+适用模型:Swerling II/IV型或混合分布
+运动特性
+直升机旋翼高速旋转导致RCS快速变化,属于快起伏目标。其动态散射特性表现为扫描内脉冲间不相关,需使用快起伏模型。
+结构特征
+直升机包含旋翼、机身、挂架等多散射源,旋翼运动引发周期性调制效应,导致RCS呈现时变波动。主旋翼的周期性遮挡与散射需结合动态相位干涉模型分析。
+典型应用
+Swerling II型:适用于旋翼旋转引起的脉冲间独立起伏,如旋翼叶片周期性反射。Swerling IV型:针对高机动状态下的复杂起伏,如直升机规避动作引发的多散射源快速变化。混合分布:旋翼动态散射(卡方分布)与机身静态散射(对数正态分布)的叠加。
+
+三、模型选择依据对比
+坦克/装甲车
+慢速、姿态稳定
+炮塔、履带、反应装甲
+Swerling I/III、对数正态分布
+地面战场静态检测、低分辨率雷达
+
+直升机
+高速旋翼、机动性强
+旋翼、机身、挂架、导弹挂载
+Swerling II/IV、混合分布
+低空突防、高分辨率雷达动态跟踪
+
+四、补充说明
+复杂目标的扩展模型
+卡方分布:适用于多散射中心叠加的复杂目标(如带附加装甲的坦克)。赖斯分布:若存在主导散射源(如直升机旋翼毂),需在瑞利分布基础上叠加稳定分量。
+极化与频率影响
+坦克的倾斜装甲可能引发极化敏感性,需结合交叉极化模型修正。直升机旋翼的谐振效应在低频段(L波段)可能增强RCS起伏幅度。
+通过结合目标运动特性与散射机理,可更精准地选择RCS统计模型,为雷达探测算法设计提供理论支撑。
+
diff --git a/docs/project/tunning.md b/docs/project/tunning.md
index b99efd2..cd50b55 100644
--- a/docs/project/tunning.md
+++ b/docs/project/tunning.md
@@ -475,5 +475,16 @@
- 毫米波跟踪不稳定,适当加大搜索和跟踪波束宽度,可以提高跟踪稳定性。
- 将MinTimeWithGuidanceBeforeSwitchSeconds设置为0.2秒,可以稳定切换到红外制导。
+## 毫米波制导系统实验记录(v1.1.20)
+时间:2025-05-19 10:00:00
+版本:v1.1.20
+
+### 实验目的
+- 使用SwerlingRCS回波模型获取目标RCS
+- 观察获取到的RCS值,对跟踪和锁定的影响
+
+### 实验结果
+- 使用SwerlingRCS回波模型获取到的目标RCS,起伏比较大,有一定概率出现几倍的误差。实际观察,从 60%到 200% 都有。
+- 因为扫描周期较长(360度每秒),所以偏离较大的RCS,对跟踪和锁定有一定影响。
diff --git a/tools/ComprehensiveMissileSimulator.cs b/tools/ComprehensiveMissileSimulator.cs
index 6449c3c..a165e84 100644
--- a/tools/ComprehensiveMissileSimulator.cs
+++ b/tools/ComprehensiveMissileSimulator.cs
@@ -233,7 +233,7 @@ namespace ThreatSource.Tools.MissileSimulation
{
Position = new Vector3D(0, 1.2, 0),
Orientation = new Orientation(0.0, 0.0, 0.0),
- Speed = 0.0
+ Speed = 1.0
};
string targetId = "Tank_1";
var target = _threatSourceFactory.CreateEquipment(targetId, "mbt_001", motionParameters);