This commit is contained in:
@@ -90,10 +90,9 @@ public partial class D7896ViewModel : ObservableObject
|
||||
|
||||
private const double EulerGamma = 0.5772156649; // 欧拉常数
|
||||
//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³(水)
|
||||
int samples = 1000; // 1秒 * 1000点/秒
|
||||
double heatingDuration = 1; // 加热时间 0.8 秒(需与您的加热脉冲宽度一致)
|
||||
double heatingDuration =1; // 加热时间 0.8 秒(需与您的加热脉冲宽度一致)
|
||||
double totalDuration = 2; // 总采样时间(加热 + 冷却)
|
||||
public D7896ViewModel()
|
||||
{
|
||||
@@ -409,7 +408,7 @@ public partial class D7896ViewModel : ObservableObject
|
||||
|
||||
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;
|
||||
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)
|
||||
{
|
||||
alpha = _config.TestParameters.FixedAlpha;
|
||||
@@ -635,7 +634,7 @@ public partial class D7896ViewModel : ObservableObject
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
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)}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user