lx
2025-07-02 cc63c8a1bf8f7f017f2f05c34f0d86f8acdfc295
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace ErrorAnalysis.Service
{
    public class PDEVCalcService
    {
        public static double GetMergePDEV(string connectionString, string modelId, int porosity)
        {
            var farC = COMergeCalcService.GetFarMergeCResult(connectionString, modelId, porosity);
            var farO = COMergeCalcService.GetFarMergeOResult(connectionString, modelId, porosity);
            var farPDEV = CalcPDEV(farC, farO);
 
            var nearC = COMergeCalcService.GetNearMergeCResult(connectionString, modelId, porosity);
            var nearO = COMergeCalcService.GetNearMergeOResult(connectionString, modelId, porosity);
            var nearPDEV = CalcPDEV(nearC, nearO);
 
            return nearPDEV * 0.65 + farPDEV * 0.35;
        }
 
        private static double CalcPDEV(double c, double o) => Math.Sqrt(Math.Pow(c / o, 2) * (1 / c + 1 / o));
    }
}