Compare commits

...

2 Commits

Author SHA1 Message Date
lvjunjie f43eb568d8 refactor(nmNum): 移除分层采样并按对数时间跨度确定采样点数
- 删除 LM 分层采样选项、逐层加密逻辑及专用诊断字段
- 每个对数时间数量级取 20 个间隔,采样点包含区间两端
- 整体误差、形状误差及前期指标共用采样网格
- 形状斜率跨度保持约为对数时间范围的 10%,同步适配残差维度和窗口权重
- 更新拟合记录中的采样策略描述,翻译资源留待统一调整
4 days ago
lvjunjie a8053b23a0 refactor(nmNum): 将井储和表皮调整统一为单参数 LM 策略
- 按第一时间窗口形状误差的预计下降量选择参数、方向和初始步长
- 改善后步长翻倍,拒绝后减半,连续拒绝三次后切换参数
- 移除间距定向及初始形状变差时的扩步试探逻辑
- 同步拟合策略记录和中文日志资源
4 days ago

Binary file not shown.

@ -1217,16 +1217,12 @@ Reason: %1</source>
<translation>没有其他勾选参数需要调整形状</translation>
</message>
<message>
<source>Early adjustment: adjust wellbore storage, then skin, to match the early pressure-derivative slope difference of the target.</source>
<translation>前期预调整:先调整井储,再调整表皮,使模拟压力与导数的前期斜率差接近目标曲线。</translation>
<source>Early adjustment: select storage or skin by predicted first-window shape reduction; halve the step after rejection and switch after 3 consecutive rejections.</source>
<translation>前期预调整:按第一时间窗口形状误差的预计下降量选择井储或表皮;拒绝后步长减半,连续拒绝三次换参数。</translation>
</message>
<message>
<source>Early adjustment: adjust skin to match the early pressure-derivative slope difference of the target.</source>
<translation>前期预调整:调整表皮,使模拟压力与导数的前期斜率差接近目标曲线。</translation>
</message>
<message>
<source>Wellbore storage adjustment ended: %1; now adjusting skin.</source>
<translation>井储调整结束:%1;开始单独调整表皮。</translation>
<source>all wellbore parameters visited once</source>
<translation>已勾选的井储、表皮参数均已完成一轮调整</translation>
</message>
<message>
<source>Early wellbore adjustment ended: %1</source>

@ -12,7 +12,7 @@
#include "nmCalculation_global.h"
// 固定对数时间窗口的误差诊断。时间边界为不含重叠区的基础边界;
// rmsError 是局部加权均方根,energy 是对当前层残差能量的贡献。
// rmsError 是局部加权均方根,energy 是对整体残差能量的贡献。
struct AutoFitTimeWindowLM {
double timeMin;
double timeMax;
@ -33,11 +33,6 @@ struct AutoFitObjectiveBreakdownLM {
double pressureLoss;
double derivativeLoss;
QVector<double> residualVector;
// 分层模式的残差属于当前层,total 属于全部目标点;固定模式坐标数组为空。
QVector<double> sampleCoordinates;
int samplingStride;
int fullPointCount;
double layerError;
QVector<AutoFitTimeWindowLM> timeWindows;
double verticalCommonBias;
double verticalLoss;
@ -46,9 +41,9 @@ struct AutoFitObjectiveBreakdownLM {
double horizontalLoss;
bool horizontalReliable;
bool registrationAmbiguous;
// 固定 log-time 网格上的双曲线斜率残差,独立于数值残差的采样层级。
// 与整体误差共用 log-time 采样网格,斜率跨度约为完整对数时域的 10%。
QVector<double> shapeResiduals;
// 前期数值残差为 81 点,形状残差为 73 个斜率区间,均含第一窗口权重。
// 前期数值和形状残差沿用同一网格与斜率跨度,均含第一窗口权重。
// earlyParallelResiduals/Loss 沿用历史字段名,现为压力、导数分别匹配目标的形状误差。
// earlyParallelBias 仍记录相对斜率偏差,仅供诊断。
QVector<double> earlyValueResiduals;
@ -68,9 +63,6 @@ struct AutoFitObjectiveBreakdownLM {
, total(1.0e10)
, pressureLoss(std::numeric_limits<double>::quiet_NaN())
, derivativeLoss(std::numeric_limits<double>::quiet_NaN())
, samplingStride(1)
, fullPointCount(80)
, layerError(1.0e10)
, verticalCommonBias(std::numeric_limits<double>::quiet_NaN())
, verticalLoss(std::numeric_limits<double>::quiet_NaN())
, verticalReliable(false)
@ -122,7 +114,6 @@ public:
int getTotalEvaluations() const;
void resetOptimizer();
void setTargetWellName(const QString& wellName);
void setLayeredSamplingEnabled(bool enabled);
signals:
void progressUpdated(int iteration, double bestFitness);
@ -217,9 +208,6 @@ private:
double m_comparisonTimeMin;
double m_comparisonTimeMax;
QString m_targetWellName;
// 此开关由拟合界面传入;每轮重置层级,固定模式仍使用原来的 80 点目标。
bool m_layeredSampling;
int m_samplingStride;
int m_maxIterations;
double m_targetError;

@ -82,8 +82,6 @@ private:
QLineEdit* m_errorLimitEdit;
QComboBox* m_targetWellCombo;
QComboBox* m_algorithmCombo;
QLabel* m_samplingLabel;
QComboBox* m_samplingCombo;
QLabel* m_surrogateLabel;
QComboBox* m_surrogateCombo;

File diff suppressed because it is too large Load Diff

@ -729,13 +729,6 @@ void nmWxAutomaticFitting::setupControlPanel()
m_surrogateCombo->setCurrentIndex(automaticFittingData.getSurrogateScreeningEnabled() ? 1 : 0);
m_surrogateCombo->setMaximumWidth(160);
m_surrogateCombo->setMinimumWidth(160);
// 分层采样用于 LM 对比试验,每次打开默认使用原来的固定 80 点模式。
m_samplingLabel = new QLabel(tr("LM sampling:"));
m_samplingCombo = new QComboBox();
m_samplingCombo->addItem(tr("Fixed sampling (80 points)"));
m_samplingCombo->addItem(tr("Layered target sampling"));
m_samplingCombo->setMinimumWidth(180);
m_samplingCombo->setToolTip(tr("Layered sampling uses target-point subsets for directions and all valid target points for acceptance."));
connect(m_algorithmCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(onAlgorithmChanged(int)));
onAlgorithmChanged(m_algorithmCombo->currentIndex());
@ -793,10 +786,6 @@ void nmWxAutomaticFitting::setupControlPanel()
m_controlLayout->addWidget(m_surrogateCombo);
m_controlLayout->addSpacing(15);
m_controlLayout->addWidget(m_samplingLabel);
m_controlLayout->addWidget(m_samplingCombo);
m_controlLayout->addSpacing(15);
m_controlLayout->addWidget(iterationLabel);
m_controlLayout->addWidget(m_iterationEdit);
m_controlLayout->addSpacing(15);
@ -818,8 +807,6 @@ void nmWxAutomaticFitting::onAlgorithmChanged(int index)
const bool usePSO = (index == 0);
m_surrogateLabel->setEnabled(usePSO);
m_surrogateCombo->setEnabled(usePSO);
m_samplingLabel->setEnabled(!usePSO);
m_samplingCombo->setEnabled(!usePSO);
}
void nmWxAutomaticFitting::setupButtons()
@ -1207,7 +1194,6 @@ void nmWxAutomaticFitting::startAutoFitting(const QVector<QVector<double>>& targ
m_autoFitterLM = new nmCalculationAutoFitLM(this);
m_autoFitterLM->setTargetLogLogData(targetData);
m_autoFitterLM->setTargetWellName(targetWellName);
m_autoFitterLM->setLayeredSamplingEnabled(m_samplingCombo->currentIndex() == 1);
} else {
DEBUG_UI("Creating PSO auto fitter");
m_autoFitterPSO = new nmCalculationAutoFitPSO(this);

Loading…
Cancel
Save