Beispiel #1
0
 public double Calc_a_Bi_Bj(int i)
 {
     return((Mu(i) * B_BasisFunc.integrate_d_dx_2(i, Elements))
            + (Beta(i) * B_BasisFunc.integrate_d_dx_fx(i, Elements))
            + (Sigma(i) * B_BasisFunc.integrate_fx_pow2(i, Elements))
            + (Alpha * Pow(B_BasisFunc.B_i(1, i, Elements), 2)));
 }
Beispiel #2
0
        public double Error(double x)
        {
            double sum = 0.0;

            for (int i = 0; i < e_coefficients.Count; i++)
            {
                sum += e_coefficients[i] * B_BasisFunc.B_i(x, i, Elements);
            }
            return(sum);
        }
Beispiel #3
0
        /// <summary>
        /// Функціонал <p(Uh),v>
        /// </summary>
        public double Calc_RO_Uh(int j)
        {
            double h    = Elements[j + 1] - Elements[j];
            double xj12 = (Elements[j + 1] + Elements[j]) / 2.0;
            var    l_bj = ((2.0 * h * F(xj12)) / 3.0) +
                          (Alpha * Condition.U_);


            /////Білінійна форма c(Fi_i,B_i+12)
            double c(int i, int k)
            {
                double ret = 0.0;

                if (i == k - 1)
                {
                    ret = ((Beta(i) * 2.0) / 3.0) + (Sigma(i) * (Elements[i + 1] - Elements[i]) / 3.0);
                }
                if (i == k)
                {
                    ret = ((-Beta(i) * 2.0) / 3.0) + (Sigma(i) * (Elements[i + 1] - Elements[i]) / 3.0);
                }
                return(ret);
            }

            double a_uh_v = 0.0;

            if (j == 0)
            {
                a_uh_v = (u[0] * c(0, 1)) + (Alpha * Condition.U1 * B_BasisFunc.B_i(1, j, Elements));
            }
            else if (j == N - 2)
            {
                a_uh_v = (u[j - 1] * c(j, j)) + (Alpha * Condition.U1 * B_BasisFunc.B_i(1, j, Elements));
            }
            else
            {
                a_uh_v = (u[j - 1] * c(j, j)) + (u[j] * c(j, j + 1)) + (Alpha * Condition.U1 * B_BasisFunc.B_i(1, j, Elements));
            }

            return(l_bj - a_uh_v);
        }