This commit is contained in:
@@ -68,8 +68,8 @@ public class TestParameters
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
public double FitStartTime { get; set; } = 0.01; // 默认0.35秒,避开早期扰动
|
public double FitStartTime { get; set; } = 0.01; // 默认0.35秒,避开早期扰动
|
||||||
public double FitEndTime { get; set; } = 0.3;
|
public double FitEndTime { get; set; } = 0.1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -90,10 +90,9 @@ public partial class D7896ViewModel : ObservableObject
|
|||||||
|
|
||||||
private const double EulerGamma = 0.5772156649; // 欧拉常数
|
private const double EulerGamma = 0.5772156649; // 欧拉常数
|
||||||
//private const double WireRadius = 0.00003; // 铂丝半径 (0.03 mm)
|
//private const double WireRadius = 0.00003; // 铂丝半径 (0.03 mm)
|
||||||
private const double WireRadius = 0.00010; // 铂丝半径 (0.03 mm)
|
|
||||||
[ObservableProperty] private double _sampleDensity = 1000.0; // 新增,密度默认值1000 kg/m³(水)
|
[ObservableProperty] private double _sampleDensity = 1000.0; // 新增,密度默认值1000 kg/m³(水)
|
||||||
int samples = 1000; // 1秒 * 1000点/秒
|
int samples = 1000; // 1秒 * 1000点/秒
|
||||||
double heatingDuration = 1; // 加热时间 0.8 秒(需与您的加热脉冲宽度一致)
|
double heatingDuration =1; // 加热时间 0.8 秒(需与您的加热脉冲宽度一致)
|
||||||
double totalDuration = 2; // 总采样时间(加热 + 冷却)
|
double totalDuration = 2; // 总采样时间(加热 + 冷却)
|
||||||
public D7896ViewModel()
|
public D7896ViewModel()
|
||||||
{
|
{
|
||||||
@@ -409,7 +408,7 @@ public partial class D7896ViewModel : ObservableObject
|
|||||||
|
|
||||||
if (i < _config.TestParameters.MeasurementCount && !_stopRequested)
|
if (i < _config.TestParameters.MeasurementCount && !_stopRequested)
|
||||||
{
|
{
|
||||||
try { await Task.Delay(_config.TestParameters.IntervalSeconds * 1000, _testCts.Token); } catch (OperationCanceledException) { break; }
|
try { await Task.Delay(_config.TestParameters.IntervalSeconds * 500, _testCts.Token); } catch (OperationCanceledException) { break; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -550,7 +549,7 @@ public partial class D7896ViewModel : ObservableObject
|
|||||||
// 计算热扩散率
|
// 计算热扩散率
|
||||||
double exponent = intercept / slope + EulerGamma;
|
double exponent = intercept / slope + EulerGamma;
|
||||||
if (exponent > 30) exponent = 30;
|
if (exponent > 30) exponent = 30;
|
||||||
double alpha = (WireRadius * WireRadius / 4.0) * Math.Exp(exponent);
|
double alpha = (_config.TestParameters.PlatinumWireDiameter / 2 * _config.TestParameters.PlatinumWireDiameter / 2 / 4.0) * Math.Exp(exponent);
|
||||||
if (_config.TestParameters.UseFixedAlpha)
|
if (_config.TestParameters.UseFixedAlpha)
|
||||||
{
|
{
|
||||||
alpha = _config.TestParameters.FixedAlpha;
|
alpha = _config.TestParameters.FixedAlpha;
|
||||||
@@ -635,7 +634,7 @@ public partial class D7896ViewModel : ObservableObject
|
|||||||
for (int i = 0; i < n; i++)
|
for (int i = 0; i < n; i++)
|
||||||
{
|
{
|
||||||
bool inFit = (i >= fitStart && i <= fitEnd);
|
bool inFit = (i >= fitStart && i <= fitEnd);
|
||||||
sw.WriteLine($"{i},{time[i]:F6},{ustd[i]:F6},{upt[i]:F6},{(double.IsNaN(deltaT[i])?0:deltaT[i]):F6},{(inFit?1:0)}");
|
sw.WriteLine($"{i},{time[i]:F6},{ustd[i]:F6},{upt[i]:F6},{(double.IsNaN(deltaT[i]) ? 0 : deltaT[i]):F6},{(inFit ? 1 : 0)}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,9 @@
|
|||||||
"MeasurementCount": 10,
|
"MeasurementCount": 10,
|
||||||
"IntervalSeconds": 30,
|
"IntervalSeconds": 30,
|
||||||
//"PlatinumWireLength": 0.056, //铂丝长度(单位:米)
|
//"PlatinumWireLength": 0.056, //铂丝长度(单位:米)
|
||||||
|
//"PlatinumWireDiameter": 0.00006,
|
||||||
"PlatinumWireLength": 0.41, //铂丝长度(单位:米)
|
"PlatinumWireLength": 0.41, //铂丝长度(单位:米)
|
||||||
"PlatinumWireDiameter": 0.000025,
|
"PlatinumWireDiameter": 0.00018,
|
||||||
"ReportOutputPath": "Reports\\",
|
"ReportOutputPath": "Reports\\",
|
||||||
"DefaultSampleVolume": 40.0,
|
"DefaultSampleVolume": 40.0,
|
||||||
"DefaultPressure": 0.0,
|
"DefaultPressure": 0.0,
|
||||||
|
|||||||
Reference in New Issue
Block a user