Crack Calculator was added

This commit is contained in:
Evgeny Redikultsev
2023-07-16 17:21:28 +05:00
parent 3e0e51d0c9
commit d7a4b1f0a7
108 changed files with 1523 additions and 565 deletions

View File

@@ -0,0 +1,59 @@
using StructureHelperCommon.Infrastructures.Exceptions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StructureHelperLogics.NdmCalculations.Cracking
{
public class ExponentialSofteningLogic : ICrackSofteningLogic
{
private double forceRatio;
private double powerFactor;
public double PowerFactor
{
get => powerFactor;
set
{
if (value < 0)
{
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": Power Factor must not be less than zero");
}
powerFactor = value;
}
}
public double BettaFactor { get; set; }
public double ForceRatio
{
get => forceRatio;
set
{
if (value < 0)
{
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": Force Ratio must not be less than zero");
}
else if (value > 1)
{
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": Force Ratio must not be greater than 1.0");
}
forceRatio = value;
}
}
public double FiMin {get;set;}
public ExponentialSofteningLogic()
{
FiMin = 0.2d;
PowerFactor = 2d;
BettaFactor = 0.8;
}
public double SofteningFactor()
{
double fi;
fi = 1 - BettaFactor * Math.Pow(ForceRatio, PowerFactor);
fi = Math.Max(fi, FiMin);
return fi;
}
}
}