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;
@@ -12,22 +14,30 @@ namespace StructureHelperLogics.NdmCalculations.Buckling
public double LongitudinalForce { get; set; }
public double StiffnessEI { get; set; }
public double DesignLength { get; set; }
public IShiftTraceLogger? TraceLogger { get; set; }
public double GetCriticalForce()
{
double Ncr = - Math.Pow(Math.PI, 2) * StiffnessEI / (Math.Pow(DesignLength, 2));
double Ncr = - Math.Pow(Math.PI, 2) * StiffnessEI / Math.Pow(DesignLength, 2);
string message = string.Format("Ncr = - (PI ^ 2) * D / L0 ^2 = - ({0} * {1} / ({2} ^2)) = {3}, N", Math.PI, StiffnessEI, DesignLength, Ncr);
TraceLogger?.AddMessage(message);
return Ncr;
}
public double GetEtaFactor()
{
TraceLogger?.AddMessage(LoggerStrings.CalculatorType(this), TraceLogStatuses.Service);
if (LongitudinalForce >= 0d) return 1d;
var Ncr = GetCriticalForce();
if (LongitudinalForce <= Ncr)
{
string error = string.Format("Absolute value of longitudinalForce is greater or equal than critical force N = {0} => Ncr = {1}", Math.Abs(LongitudinalForce), Ncr);
TraceLogger?.AddMessage(error, TraceLogStatuses.Error);
throw new StructureHelperException(ErrorStrings.LongitudinalForceMustBeLessThanCriticalForce);
}
double eta = 1 / (1 - LongitudinalForce / Ncr);
string message = string.Format("Eta factor Eta = 1 / (1 - N / Ncr) = 1 / (1 - {0} / {1}) = {2}, {3}", (-1) * LongitudinalForce, (-1) * Ncr, eta, LoggerStrings.DimensionLess);
TraceLogger?.AddMessage(message);
return eta;
}
}