Пример #1
0
        public SavijanjePravougaonogPresekaEC2V2(
            double b, double h,
            double d1, double d2,
            BetonModelEC beton, ReinforcementTypeModelEC armatura,
            double Mg, double Mq, double Ng = 0, double Nq = 0, KofZaProracunPravougaonogPresekaModelEC kof = null)
        {
            InitValidations(b, h, beton, armatura, d1, d2);
            this.Mg       = Mg;
            this.Mq       = Mq;
            this.Msd      = 1.35 * Mg + 1.5 * Mq;
            this.Ng       = Ng;
            this.Nq       = Nq;
            this.Nsd      = 1.35 * Ng + 1.5 * Nq;
            this.b        = b;
            this.h        = h;
            this.d1       = d1;
            this.d2       = d2;
            this.beton    = beton;
            this.armatura = armatura;
            if (kof != null)
            {
                KofZaProracunPravougaonogPreseka = kof; μSd = kof.μRd;
            }

            Start();
        }
Пример #2
0
 private void InitValidations(double b, double h, BetonModelEC beton, ReinforcementTypeModelEC armatura, ReinforcementModelEC as1_model, double d1)
 {
     if (b <= 0)
     {
         throw new Exception("b must be greater 0");
     }
     if (h <= 0)
     {
         throw new Exception("h must be greater 0");
     }
     if (d1 <= 0)
     {
         throw new Exception("d1 must be greater 0");
     }
     if (2 * d1 >= h)
     {
         throw new Exception("2 x d1 must be smoller then h");
     }
     if (beton == null)
     {
         throw new Exception("Beton not defined!");
     }
     if (armatura == null)
     {
         throw new Exception("Armatura not defined!");
     }
     if (as1_model == null)
     {
         throw new Exception("Longitudinal reinforcement not defined!");
     }
 }
Пример #3
0
        public SavijanjePravougaonogPresekaEC2V2(

            double b, double h,
            double d1, double d2,
            BetonModelEC beton, ReinforcementTypeModelEC armatura,
            double Msd,
            double Nsd = 0,
            KofZaProracunPravougaonogPresekaModelEC kof = null)
        {
            InitValidations(b, h, beton, armatura, d1, d2);
            this.Msd      = Msd;
            this.Nsd      = Nsd;
            this.b        = b;
            this.h        = h;
            this.d1       = d1;
            this.d2       = d2;
            this.beton    = beton;
            this.armatura = armatura;
            if (kof != null)
            {
                KofZaProracunPravougaonogPreseka = kof; μSd = kof.μRd;
            }

            Start();
        }
 private void InitValidations(double b, double h, BetonModelEC beton, ReinforcementTypeModelEC armatura, double d1, double d2)
 {
     if (b <= 0)
     {
         throw new Exception("b must be greater 0");
     }
     if (h < 0)
     {
         throw new Exception("h must be greater or equal to 0");
     }
     if (d1 <= 0)
     {
         throw new Exception("d1 must be greater 0");
     }
     if (d2 <= 0)
     {
         throw new Exception("d2 must be greater 0");
     }
     if (2 * d1 >= h && h != 0)
     {
         throw new Exception("2 x d1 must be smoller then h");
     }
     if (beton == null)
     {
         throw new Exception("Beton not defined!");
     }
     if (armatura == null)
     {
         throw new Exception("Armatura not defined!");
     }
 }
Пример #5
0
        public VitkostEC2(Izvijanja izvijanje, double Ng_sila,
                          double Nq_sila, double L_visina, double b_sirina_x, double b_sirina_y,
                          BetonModelEC beton, ReinforcementTypeModelEC armatura, double d1, double Mg_sila = 0, double Mq_sila = 0)
        {
            this.beton    = beton;
            this.armatura = armatura;
            Ng            = Ng_sila;
            Nq            = Nq_sila;
            Mg            = Mg_sila;
            Mq            = Mq_sila;
            L             = L_visina;
            bx            = b_sirina_x;
            by            = b_sirina_y;
            this.d1       = d1;
            k             = OjleroviSlucajeviIzvijanja.GetK(izvijanje);
            li            = k * L;
            λ             = li / (by / 2 / Math.Sqrt(3));
            λ_lim         = Lamda_lim();



            Calculate();
            ProracunArmature();
            KontrolaCentPritPreseka();
        }
Пример #6
0
 public override bool IsValid(object value)
 {
     if (value is string)
     {
         var b = value as string;
         return(BetonModelEC.ListOfBetonClasses()
                .Any(x => x.name == (string)value));;
     }
     return(false);
 }
Пример #7
0
        private static void EC_T_Presek_PomocuFormule()
        {
            double Msd   = 6100;
            double b_eff = 175;
            double b_w   = 35;
            double h_f   = 15;
            double d     = 143;
            double s;
            double δ   = h_f / d;
            var    μSd = 0.0;
            var    bi  = b_eff;

            BetonModelEC             beton = BetonClasses.GetBetonClassListEC().Single(b => b.name == "C25/30");
            ReinforcementTypeModelEC arm   = ReinforcementType.GetArmatura().Single(a => a.name == "B500B");
            var fcd = beton.fcd / 10;

            KofZaProracunPravougaonogPresekaModelEC kof1         = new KofZaProracunPravougaonogPresekaModelEC();
            KofZaProracunPravougaonogPresekaModelEC kof2         = new KofZaProracunPravougaonogPresekaModelEC();
            KofZaProracunPravougaonogPresekaModelEC kof_zvezdica = new KofZaProracunPravougaonogPresekaModelEC();

            //kof1.
            bool done = false;

            s = δ;
            kof1.SetByξ(s);
            kof2 = kof1;
            int i = 0;

            //var s_add = 0.1;
            do
            {
                var x  = kof2.ξ * d;
                var Eb = ((x - h_f) / x) * kof2.εc;
                kof_zvezdica.SetByEcEs1(Eb, 20);
                if (kof2.εc == 0)///na pocetku ce uvek biti kof2 0;
                {
                    bi = 1 * b_eff;
                }
                else
                {
                    bi = (1 - (kof_zvezdica.αv / kof1.αv) * (1 - (h_f / (kof2.ξ * d))) * (1 - (b_w / b_eff))) * b_eff;
                }


                μSd = Msd * 100 / (bi * Math.Pow(d, 2) * fcd);
                var kof3 = KofZaProracunPravougaonogPresekaEC.Get_Kof_From_μ(μSd);
                if (Math.Round(kof2.ξ, 3) == Math.Round(kof3.ξ, 3))
                {
                    done = true;
                    continue;
                }
                kof2 = kof3;
            } while (!done);
        }
        public async Task <IEnumerable <BetonModelEC> > GetBetonClassesAsync()
        {
            IEnumerable <BetonModelEC> betonclass = null;
            await Task.Run(() =>
            {
                //betonclass = TabeleEC2.BetonClasses.GetBetonClassListEC();
                betonclass = BetonModelEC.ListOfBetonClasses();
            });

            return(betonclass);
        }
Пример #9
0
        public TransverzalneSileEC2(
            double b,
            double h,
            BetonModelEC beton,
            ReinforcementTypeModelEC armatura,
            ReinforcementModelEC As1_model,
            double Vg,
            double Vq,
            double d1,
            double Ng = 0,
            double Nq = 0
            )
        {
            InitValidations(b, h, beton, armatura, As1_model, d1);
            this.b        = b;
            this.h        = h;
            this.beton    = beton;
            this.armatura = armatura;
            as1_Model     = As1_model;
            As1           = as1_Model.cm2_total;
            this.Vg       = Vg;
            this.Vq       = Vq;
            this.d1       = d1;
            this.Ng       = Ng;
            this.Nq       = Nq;

            Validations();
            Calc_Vrd_c();

            //if (Errors.Count() != 0)
            //return;
            GetS();
            GetSp();
            GetListOfM();

            if (Ved <= Vrd_c && Errors.Count() == 0)
            {
                minArmatura();
                CalAdditionalTransverseReinforcement();
            }
        }
        public SavijanjePravougaonogPresekaEC2_V2(double b, double h,
                                                  double d1, double d2,
                                                  BetonModelEC beton, ReinforcementTypeModelEC armatura,
                                                  double Msd, double Nsd = 0, KofZaProracunPravougaonogPresekaModelEC kof = null)
        {
            this.b = b;
            this.h = h;
            if (h == 0)
            {
                TipDim = TipDimenzionisanja.Slobodno;
            }
            this.d1       = d1;
            this.d2       = d2;
            this.beton    = beton;
            this.armatura = armatura;
            this.Msd      = Msd;
            this.Nsd      = Nsd;
            Kof           = kof;

            InitValidation();
            //Calc();
        }
Пример #11
0
 public SavijanjeTPresekaEC2(
     double b_w, double b_eff,
     double h, double h_f,
     double d1, double Mg,
     double Mq, BetonModelEC beton,
     ReinforcementTypeModelEC armatura,
     double d2 = 0, double Ng = 0,
     double Nq = 0,
     KofZaProracunPravougaonogPresekaModelEC kof = null)
 {
     this.b_w   = b_w;
     this.b_eff = b_eff;
     this.h     = h;
     this.h_f   = h_f;
     this.d1    = d1;
     this.d2    = d2;
     this.Msd   = 1.35 * Mg + 1.5 * Mq;
     this.Nsd   = 1.35 * Ng + 1.5 * Nq;
     this.Msds  = Msd + Nsd * (h / 100 / 2 - d1 / 100);
     if (kof != null)
     {
         KofZaProracunPravougaonogPreseka = kof; μSd = kof.μRd;
     }
 }
Пример #12
0
        private double Getω(KofZaProracunPravougaonogPresekaModelEC Kof, double Vsd, double b, double d1, double h, BetonModelEC beton)
        {
            var zs = (h / 2 - d1);

            var Kof_lim = KofZaProracunPravougaonogPresekaEC.GetLimitKofZaProracunPravougaonogPresekaEC(beton);

            var Mrd_limit = (Kof_lim.μRd * b * Math.Pow((h - d1), 2) * beton.fcd / 10) / 100;

            var ω1 = Kof_lim.μRd * ((1 / Kof_lim.ζ) - (1 / 0.89)) + Kof.μRd * 1 / 0.89 + Vsd * (zs / (0.89 * (h - d1)) - 1);

            return(ω1);
        }
        public ActionResult PostIzracunaj([FromBody] VitkostModel model)
        {
            if (!ModelState.IsValid)
            {
                var allErrors = ModelState.Values.SelectMany(x => x.Errors);
                return(BadRequest(
                           new
                {
                    message = "Invalid model",
                    error = allErrors.Select(x => x.ErrorMessage),
                    modelExp = new VitkostModel()
                    {
                        Slenderness = "Ukljesten sa jedne",
                        k = 2,
                        N = 1620,
                        M_top = -38.5,
                        M_bottom = 38.5,
                        L = 375,
                        b = 30,
                        h = 30,
                        d1 = 4,
                        armtype = "B500B",
                        betonClass = "C25/30",
                        result = null
                    },
                }));
            }
            try
            {
                var geo = new ElementGeometySlenderness()
                {
                    b    = model.b,
                    h    = model.h,
                    d1   = model.d1,
                    d2   = model.d1,
                    L    = model.L,
                    k    = model.k,
                    unit = UnitDimesionType.cm
                };
                var forces = new ForcesSlenderness(geo.li, geo.h)
                {
                    NEd      = model.N,
                    M_bottom = model.M_bottom,
                    M_top    = model.M_top
                };
                var beton = new BetonModelEC(model.betonClass);
                beton.ni = 0.85;
                var material = new Material()
                {
                    beton    = beton,
                    armatura = ReinforcementType
                               .GetArmatura()
                               .Single(a => a.name == model.armtype)
                };
                var v = new SlendernessEC2(geo, forces, material);

                v.Calculate();
                v.KontrolaCentPritPreseka();
                v.ProracunArmature();

                model.result = v.ToString();

                return(Ok(model));
            }
            catch (System.Exception ex)
            {
                return(BadRequest(new { error = ex.Message }));
            }
        }
Пример #14
0
        public TransverzalneSileEc2ResultModel CalculateInit(TransverzalneSileEc2Model trans)
        {
            TransverzalneSileEc2ResultModel Result;
            var beton = new BetonModelEC(trans.betonClass, 1);
            var arm   = ReinforcementType.GetArmatura().Where(n => n.name == trans.armtype).SingleOrDefault();

            if (trans.settings != null)
            {
                beton = new BetonModelEC(trans.betonClass, trans.settings.alfa_cc, trans.settings.alfa_ct, trans.settings.y_c);
                arm   = ReinforcementType.GetArmatura(trans.settings.y_s).Where(n => n.name == trans.armtype).SingleOrDefault();
            }


            beton.ni = 0.85;

            var  armLong = new ReinforcementModelEC(trans.armLongitudinal.diametar, trans.armLongitudinal.kom);
            bool armCalc = false;

            if (trans.u_diametar != 0 && trans.m != 0 && trans.s != 0)
            {
                armCalc = true;
            }


            var g = new ElementGeometryTransversal()
            {
                b    = trans.b,
                h    = trans.h,
                d1   = trans.d1,
                d2   = trans.d1,
                As1  = new ReinforcementModelEC(trans.armLongitudinal.diametar, trans.armLongitudinal.kom),
                unit = UnitDimesionType.cm
            };
            var f = new ForcesTransversal()
            {
                Ved = trans.Ved,
                Vg  = trans.Vg,
                Vq  = trans.Vq
            };
            var m = new Material()
            {
                beton    = beton,
                armatura = arm,
            };

            using (var t = new TransversalCalcEC2(g, f, m))
            {
                if (armCalc)
                {
                    if (trans.alfa == null)
                    {
                        t.CalculateArmature(trans.m, trans.s, new ReinforcementModelEC(trans.u_diametar, 1));
                    }
                    else
                    {
                        t.CalculateArmature(trans.m, trans.s, new ReinforcementModelEC(trans.u_diametar, 1), trans.teta, (double)trans.alfa);
                    }
                }
                Result = new TransverzalneSileEc2ResultModel()
                {
                    Result       = t.ToString(),
                    s            = t.Asw_min == 0 ? trans.s : t.s,
                    ListS        = t.List_s,
                    ListM        = t.List_m,
                    m            = t.Asw_min == 0 ? trans.m : t.m,
                    teta         = t.Θ,
                    alfa         = t.alfa,
                    u_diametar   = trans.u_diametar,
                    addArm_pot   = t.As_add,
                    TransArm_pot = t.Asw,
                    minArm_pot   = t.Asw_min,
                    IskorArm     = t.IskoriscenostArmature / 100,
                    IskorBeton   = t.IskoriscenostBetona / 100,
                    Errors       = t.Errors
                };
            }
            return(Result);
        }
Пример #15
0
        public TransversalReinf_EC2ViewModel(double Vg, double Vq, double b, double h, double d1, ReinforcementTypeModelEC armatura, BetonModelEC beton, ReinforcementModelEC Longitud_As1)
        {
            this.Vg           = Vg;
            this.Vq           = Vq;
            this.b            = b;
            this.h            = h;
            this.d1           = d1;
            this.armatura     = armatura;
            this.beton        = beton;
            this.Longitud_As1 = Longitud_As1;

            CalculateCommand    = new CommandHandler(async() => await Calculate());
            CalculateArmCommand = new CommandHandler(async() => await CalculateArm());
        }
Пример #16
0
        private static void ec2_TacnPostupak()
        {
            double Msd = 180;
            double Mu;
            double Du    = 0;
            double b_eff = 20;
            double b_w   = 20;
            double h_f   = 15;
            double d     = 44;
            double s;
            double δ  = h_f / d;
            double Nu = 0;
            double bi = 0;

            BetonModelEC             beton = BetonClasses.GetBetonClassListEC().Single(b => b.name == "C25/30");
            ReinforcementTypeModelEC arm   = ReinforcementType.GetArmatura().Single(a => a.name == "B500B");
            //var fcd = 2.05;
            double As = (Du - Nu) / arm.fyd;

            KofZaProracunPravougaonogPresekaModelEC kof1 = new KofZaProracunPravougaonogPresekaModelEC();
            KofZaProracunPravougaonogPresekaModelEC kof2 = new KofZaProracunPravougaonogPresekaModelEC();

            bool done = false;

            s = δ;
            int i        = 0;
            var x        = 0.0;
            var s_add    = 0.1;
            var μSd      = (Msd * 100) / (b_eff * Math.Pow(d, 2) * beton.fcd / 10);
            var kof_test = KofZaProracunPravougaonogPresekaEC.Get_Kof_From_μ(μSd);

            if (kof_test.ξ <= s)
            {
                var kof = kof_test;
                x  = kof.ξ * d;
                As = (Msd * 100) / (kof.ζ * d * arm.fyd);
            }
            do
            {
                i++;
                kof1.SetByξ(s);
                x = s * d;
                var Du1 = kof1.αv * b_eff * s * d * beton.fcd / 10;
                var zb1 = d * (1 - kof1.ka * s);
                var Ebd = ((s - δ) / s) * kof1.εc;
                kof2.SetByEcEs1(Ebd, 20);

                var Du2 = kof2.αv * (b_eff - b_w) * (x - h_f) * beton.fcd / 10;
                var zb2 = d - h_f - kof2.ka * (x - h_f);

                Mu = Du1 * zb1 / 100 - Du2 * zb2 / 100;

                if (i > 30)
                {
                    break;
                }


                if (Mu * 1.0005 < Msd)
                {
                    s += s_add; continue;
                }
                if (Mu > Msd * 1.001)
                {
                    s_add = s_add / 2; s -= s_add; continue;
                }

                if (Mu * 1.0005 >= Msd && Mu <= Msd * 1.001)
                {
                    Du = Du1 - Du2; As = (Du - Nu) / arm.fyd; done = true;
                }
            } while (!done);
            if (i > 30 && done == false)
            {
                Console.WriteLine("Can't calculate!");
                Console.ReadKey();
                return;
            }
            bi = Mu / (kof1.μRd * Math.Pow(d, 2) * beton.fcd / 10);
            As = (Du - Nu) / arm.fyd;
            x  = kof1.ξ * d;
            Console.WriteLine("n= " + i);
            Console.WriteLine("As= " + As);
            Console.WriteLine("x= " + x);
            Console.WriteLine("Mu= " + Mu);
            Console.ReadKey();

            GC.Collect();
        }
        public SavijanjePravougaonogPresekaEC2Model Calculate(SavijanjePravougaonogPresekaEC2Model input)
        {
            IBetonModel             beton;
            IReinforcementTypeModel armatura;
            SavijanjePravougaonogPresekaEC2Model result = input;

            if (input.settings != null)
            {
                beton    = new BetonModelEC(input.betonClass, input.settings.alfa_cc, input.settings.alfa_ct, input.settings.y_c);
                armatura = ReinforcementType.GetArmatura(input.settings.y_s).Single(a => a.name == input.armtype);
            }

            else
            {
                beton    = new BetonModelEC(input.betonClass);
                armatura = ReinforcementType.GetArmatura().Single(a => a.name == input.armtype);
            }


            if (beton == null)
            {
                throw new System.ArgumentNullException(nameof(beton), "cant be null");
            }

            if (armatura == null)
            {
                throw new System.ArgumentNullException(nameof(armatura), "cant be null");
            }

            var geometry = new ElementGeometry()
            {
                b  = input.b,
                h  = input.h,
                d1 = input.d1,
                d2 = input.d2
            };
            var cs = new CoeffService(new Material {
                armatura = armatura, beton = beton
            }, geometry);

            using (CalculatorEC2Logic.BendingRectangularCrossSectionEC2 sav = new CalculatorEC2Logic.BendingRectangularCrossSectionEC2(

                       material: new Material()
            {
                beton = beton,
                armatura = armatura
            },

                       geometry: geometry,
                       forces: input.Msd == 0 ?
                       new CalculatorEC2Logic.ForcesBendingAndCompressison(1.35 * input.Mg + 1.5 * input.Mq, 1.35 * input.Ng + 1.5 * input.Nq) :
                       new CalculatorEC2Logic.ForcesBendingAndCompressison(input.Msd, input.Nsd),
                       kof: input.h == 0 ? cs.GetByμ(input.mu) : null))
            {
                ///Doo some thing
                result.result = new SavijanjePravougaonogPresekaEC2Model.ResultModel()
                {
                    coef    = sav.KofZaProracunPravougaonogPreseka,
                    As1_req = sav.As1_pot,
                    As2_req = sav.As2_pot,
                    Msd     = sav.Forces.Msd,
                    Msds    = sav.Forces.Msds(sav.Geometry.h, sav.Geometry.d1),
                    Nsd     = sav.Forces.Nsd,
                    μSd     = sav.KofZaProracunPravougaonogPreseka.μRd,
                    Result  = sav.ToString(),
                };
                result.h = input.h == 0 ? sav.Geometry.h : result.h;
            }
            return(result);
        }
 public static KofZaProracunPravougaonogPresekaModelEC GetLimitKofZaProracunPravougaonogPresekaEC(BetonModelEC beton)
 {
     if (beton.fck <= 35)
     {
         return(new KofZaProracunPravougaonogPresekaModelEC()
         {
             εc = -3.5, εs1 = 4.278, ζ = 0.813, ξ = 0.45, μRd = 0.252, ω = 0                                                   /*, kd = 0*/
         });
     }
     else
     {
         return new KofZaProracunPravougaonogPresekaModelEC()
                {
                    εc = -3.5, εs1 = 6.5, ζ = 0.854, ξ = 0.35, μRd = 0.206, ω = 0                                              /*, kd = 0*/
                }
     };
 }