lixiaojun
2023-11-02 cee1c6bf2c5c03c0beadcc9c8f720b03589f83a3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
namespace Yw.Curve
{
    /// <summary>
    /// 泵特性曲线辅助类
    /// </summary>
    public class PumpFeatHelper
    {
        /// <summary>
        /// 通过 频率 计算流量扬程曲线表达式
        /// </summary>
        public static CurveExpress CalcuCurveQhByHz(List<CurvePoint> pts, eFitType fit, double hz)
        {
            if (pts == null || pts.Count < 1)
            {
                return default;
            }
            var fitPow = FitHelper.GetFitPow(fit);
            if (pts.Count < fitPow + 1)
            {
                return default;
            }
            double f_ratio = hz / 50.0;
            var list = pts.Select(x => new CurvePoint(x.X * f_ratio, x.Y * f_ratio * f_ratio)).ToList();
            return FitHelper.BuildCurveExpress(list, fit);
        }
 
        /// <summary>
        /// 通过 频率 计算流量功率曲线表达式
        /// </summary>
        public static CurveExpress CalcuCurveQpByHz(List<CurvePoint> pts, eFitType fit, double hz)
        {
            if (pts == null || pts.Count < 1)
            {
                return default;
            }
            var fitPow = FitHelper.GetFitPow(fit);
            if (pts.Count < fitPow + 1)
            {
                return default;
            }
            double f_ratio = hz / 50.0;
            var list = pts.Select(x => new CurvePoint(x.X * f_ratio, x.Y * f_ratio * f_ratio * f_ratio)).ToList();
            return FitHelper.BuildCurveExpress(list, fit);
        }
 
 
    }
}