Example #1
0
        private void btnChengben_Click(object sender, EventArgs e)
        {
            RefreshInput();

            List <double[]> wallWidths = WallWidth.Genereate(input.m_FloorCount);

            Output[] outputs = new Output[wallWidths.Count];

            for (int i = 0; i < wallWidths.Count; i++)
            {
                input.SetWallWidth(wallWidths[i]);
                outputs[i] = new Output();
                outputs[i].SetWallWidth(wallWidths[i]);

                outputs[i].m_K = StiffnessMatrix.zonggangjuzhen(input.m_FloorCount, input.m_E, input.m_A, input.m_I, input.m_FloorHeights);
                outputs[i].m_Q = LoadCalculation.hezaijisuan(input.m_FloorCount, input.m_FloorHeights, input.m_r, input.m_FutuHeight, input.m_p0, input.m_rg, input.m_rq);
                double[] f01 = LoadCalculation.dengxiaojiedianhezai01(input.m_FloorCount, input.m_FloorHeights, outputs[i].m_Q);
                double[] f02 = LoadCalculation.dengxiaojiedianhezai02(input.m_FloorCount, input.m_FloorHeights, outputs[i].m_Q);
                outputs[i].m_f01 = new Vector(f01, VectorType.Column);
                outputs[i].m_f02 = new Vector(f02, VectorType.Column);
                outputs[i].m_K01 = BoundaryCondition.weiyibianjie01(input.m_FloorCount, outputs[i].m_K);
                outputs[i].m_K02 = BoundaryCondition.weiyibianjie02(input.m_FloorCount, outputs[i].m_K);
                outputs[i].m_M01 = InnerForceCalculation.neilijisuan(false,
                                                                     input.m_E, input.m_A, input.m_I, outputs[i].m_K01, outputs[i].m_f01, input.m_FloorCount, outputs[i].m_Q, input.m_FloorHeights);
                outputs[i].m_M02 = InnerForceCalculation.neilijisuan(true,
                                                                     input.m_E, input.m_A, input.m_I, outputs[i].m_K02, outputs[i].m_f02, input.m_FloorCount, outputs[i].m_Q, input.m_FloorHeights);

                outputs[i].m_MM   = InnerForceCalculation.neilitiaofu(outputs[i].m_M01, outputs[i].m_M02, input.m_T);
                outputs[i].m_Mmax = InnerForceCalculation.kuazhongzuidaM(outputs[i].m_MM, input.m_FloorCount, outputs[i].m_Q, input.m_FloorHeights);

                outputs[i].m_M = InnerForceCalculation.neilizuhe(input.m_FloorCount, outputs[i].m_MM, outputs[i].m_Mmax);

                List <double>[] As = ReinforcementCalculation.peijinjisuan(
                    outputs[i].m_M, input.m_cs, input.m_FloorCount, input.m_WallWidths, input.m_fy, input.m_fc, input.m_ft);
                outputs[i].m_As = As;

                List <double[]> zuhejin = Zuhezhengfujin.zuhezhengfujin(input.m_FloorCount, outputs[i].m_As[0], input.m_ft, input.m_fy, input.m_WallWidths, outputs[i].m_M, input.m_cs, input.m_ConcreteGrade, input.m_rg);
                outputs[i].m_Zuhejin = zuhejin;

                List <double[]> shuipingjin = Shuipingjin.shuipingjin(input.m_FloorCount, input.m_WallWidths);
                outputs[i].m_Shuipingjin = shuipingjin;

                double[] cb = Chengben.chengben(outputs[i].m_Zuhejin, outputs[i].m_Shuipingjin, input.m_FloorCount, input.m_ConcretePrice,
                                                input.m_RebarPrice, input.m_WallWidths, input.m_FloorHeights, input.m_cs, input.m_RoofThickness,
                                                input.m_SeismicGrade, input.m_ConcreteGrade, input.m_RebarGrade);
                outputs[i].m_Chengben = cb;

                if (cbxShowDetial.Checked == true)
                {
                    string strWidths   = Util.ToString(wallWidths[i]);
                    string strChengben = Util.ToString(cb);
                    rtbBrowser.AppendText(strWidths);
                    rtbBrowser.AppendText(strChengben);
                    rtbBrowser.AppendText("\n");
                }
            }

            pritResult(outputs);
        }
        public static double[,] neilijisuan(bool isHinge, double E, double[] A, double[] I, Matrix k, Vector f, int n, double[] Q, double[] H)
        {
            double[,] FF = new double[2, 2 * n];

            //本子函数用于求解节点位移和结构内力以及支座反力,适用于墙底固结
            //输入的k为总刚度矩阵(为引入位移边界条件划掉0行0列),f为等效节点荷载列向量(为引入位移边界条件划掉0行0列),n为挡土墙层数
            //Q = hezaijisuan(n, H, r, h, p0, rg, rq);    //调用荷载计算子程序,计算所有节点的荷载设计值
            Vector u = Vector.MatMulColVec(k.Inverse(), f);       //左除总刚度矩阵,求解未知位移

            List <Vector>   F0 = new List <Vector>();
            List <double[]> M  = new List <double[]>();
            List <double[]> F  = new List <double[]>();

            for (int j = 0; j < n; j++)
            {
                Matrix   kp   = StiffnessMatrix.PlaneFrameElementStiffness(E, A[j], I[j], H[j]);
                double[] arrU = new double[6];
                if (!isHinge)
                {
                    arrU = j == 0 ? new double[] { 0, 0, 0, u[2 * j], 0, u[2 * j + 1] } : new double[] { u[2 * j - 2], 0, u[2 * j - 1], u[2 * j], 0, u[2 * j + 1] };
                }
                else
                {
                    arrU = j == 0 ? new double[] { 0, 0, u[2 * j], u[2 * j + 1], 0, u[2 * j + 2] } : new double[] { u[2 * j - 1], 0, u[2 * j], u[2 * j + 1], 0, u[2 * j + 2] };
                }

                Vector up = new Vector(arrU, VectorType.Column);  //回带总体位移
                Vector Fp = Vector.MatMulColVec(kp, up);
                F0.Add(Fp);
            }
            for (int j = 0; j < n + 1; j++)
            {
                double Mlp = j == 0 ? 0 : -((Q[j - 1] - Q[j]) * Math.Pow(H[j - 1], 2) / 30 + Q[j] * Math.Pow(H[j - 1], 2) / 12);
                double Mrp = j == n ? 0 : (Q[j] - Q[j + 1]) * Math.Pow(H[j], 2) / 20 + Q[j + 1] * Math.Pow(H[j], 2) / 12;
                M.Add(new double[] { Mlp, Mrp });

                double Flp = j == 0 ? 0 : (Q[j - 1] - Q[j]) * H[j - 1] * 3 / 20 + 0.5 * Q[j] * H[j - 1];
                double Frp = j == n ? 0 : (Q[j] - Q[j + 1]) * H[j] * 7 / 20 + 0.5 * Q[j + 1] * H[j];
                F.Add(new double[] { Flp, Frp });
            }

            for (int i = 0; i < n; i++)
            {
                FF[0, 2 * i]     = F0[i][2] + M[i][1];
                FF[0, 2 * i + 1] = F0[i][5] + M[i + 1][0];

                FF[1, i]     += (F0[i][1] + F[i][1]);
                FF[1, i + 1] += (F0[i][4] + F[i + 1][0]);
            }

            return(FF);
        }