Example #1
0
        /// <summary>获取校准曲线方程</summary>
        /// <param name="coefficient">系数</param>
        /// <param name="pqm">定量参数</param>
        /// <returns>校准曲线方程字符串</returns>
        public static string GetFittingFormula(List <double> coefficient, PeakQuantificationMethod pqm)
        {
            switch (pqm.CurveFitting_Method)
            {
            case PeakQuantificationMethod.CurveFittingMethod.cfm_linear:
                return(CLeastSquareFitting.GetFormula(coefficient, 1));

            case PeakQuantificationMethod.CurveFittingMethod.cfm_quadratic:
                return(CLeastSquareFitting.GetFormula(coefficient, 2));

            case PeakQuantificationMethod.CurveFittingMethod.cfm_cubic:
                return(CLeastSquareFitting.GetFormula(coefficient, 3));

            case PeakQuantificationMethod.CurveFittingMethod.cfm_log:
                return(CLogFitting.GetFormula(coefficient));

            default:
                return(null);
            }
        }
Example #2
0
        /// <summary>获取曲线拟合后的系数</summary>
        /// <param name="point_list">待拟合点</param>
        /// <param name="pqm">定量参数</param>
        /// <returns>拟合系数列表</returns>
        public static List <Double> CurveFitting(List <PointF> point_list, PeakQuantificationMethod pqm)
        {
            switch (pqm.CurveFitting_Method)
            {
            case PeakQuantificationMethod.CurveFittingMethod.cfm_linear:
                return(CLeastSquareFitting.Fitting(point_list, 1, pqm.ZeroPassage));

            case PeakQuantificationMethod.CurveFittingMethod.cfm_quadratic:
                return(CLeastSquareFitting.Fitting(point_list, 2, pqm.ZeroPassage));

            case PeakQuantificationMethod.CurveFittingMethod.cfm_cubic:
                return(CLeastSquareFitting.Fitting(point_list, 3, pqm.ZeroPassage));

            case PeakQuantificationMethod.CurveFittingMethod.cfm_log:
                return(CLogFitting.Fitting(point_list, pqm.ZeroPassage));

            default:
                return(null);
            }
        }