Buckling calculator was changed, accidental eccentricity logic was added

This commit is contained in:
Evgeny Redikultsev
2024-02-25 15:31:09 +05:00
parent 541f23c0a8
commit bf72f6d347
28 changed files with 676 additions and 145 deletions

View File

@@ -1,4 +1,6 @@
using StructureHelperCommon.Infrastructures.Exceptions;
using StructureHelperCommon.Models;
using StructureHelperCommon.Models.Loggers;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -14,21 +16,31 @@ namespace StructureHelperLogics.NdmCalculations.Buckling
readonly double eccentricity;
readonly double size;
public IShiftTraceLogger? TraceLogger { get; set; }
public DeltaELogicSP63(double eccentricity, double size)
{
if (size <= 0 )
{
TraceLogger?.AddMessage(string.Format("Height of cross-section is less or equal to zero, h = {0}", size));
throw new StructureHelperException(ErrorStrings.SizeMustBeGreaterThanZero + $", actual size: {size}");
}
this.eccentricity = eccentricity;
this.size = size;
}
public double GetDeltaE()
{
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
TraceLogger?.AddMessage(string.Format("Eccentricity e = {0}", eccentricity));
TraceLogger?.AddMessage(string.Format("Height h = {0}", size));
var deltaE = Math.Abs(eccentricity) / size;
string message = string.Format("Relative eccentricity DeltaE = eccentricity / height = {0} / {1} = {2} (dimensionless)", eccentricity, size, deltaE);
TraceLogger?.AddMessage(message);
deltaE = Math.Max(deltaE, deltaEMin);
deltaE = Math.Min(deltaE, deltaEMax);
TraceLogger?.AddMessage(string.Format("But not less than {0}, and not greater than {1}", deltaEMin, deltaEMax));
TraceLogger?.AddMessage(string.Format("Relative eccentricity DeltaE = {0}", deltaE));
return deltaE;
}
}