private static void test12() { var g = new ElementGeometySlenderness() { b = 30, h = 40, izvijanje = Izvijanja.Ukljesten_Sa_Jedne, d1 = 4, L = 350, }; var f = new ForcesSlenderness() { N = 457.5, M_top = 20.25, //M_bottom = 50, }; var m = new Material() { beton = TabeleEC2.BetonClasses.GetBetonClassListEC().First(n => n.name == "C25/30"), armatura = ReinforcementType.GetArmatura().First(n => n.name == "B500B"), }; var v = new VitkostEC2_V2(g, f, m); //v.φ_ef = 3; v.Calculate(); v.KontrolaCentPritPreseka(); v.ProracunArmature(); }
public IActionResult SearchForLine([FromBody] MiNi model) { if (model == null) { throw new System.ArgumentNullException(nameof(model)); } try { var material = new Material() { beton = new BetonModelEC(model.material.betonClass), armatura = ReinforcementType.GetArmatura().First(n => n.name == model.material.armtype), }; var geometry = new ElementGeometry() { b = model.geometry.b, d1 = model.geometry.d1, h = model.geometry.h, }; var w = new SymmetricalReinfByClassicMethod(material, geometry); w.Get_ω(model.mi, model.ni); return(Ok(new { w = w.searchingOf_ω.ω, List = w.searchingOf_ω.ListOfDotsInLineOfDiagram, textResulte = w.TextResult() })); } catch (System.Exception ex) { return(BadRequest(new { error = ex.Message })); } }
public IActionResult GetListOfAllLines([FromBody] MiNi model) { if (model == null) { throw new System.ArgumentNullException(nameof(model)); } try { var material = new Material() { beton = new BetonModelEC(model.material.betonClass), armatura = ReinforcementType.GetArmatura().First(n => n.name == model.material.armtype), }; var geometry = new ElementGeometry() { b = model.geometry.b, d1 = model.geometry.d1, d2 = model.geometry.d1, h = model.geometry.h, }; var cs = new CoeffService(material, geometry); return(Ok(new SymmetricalReinfByClassicMethod(material, geometry).GetAllLines(cs))); } catch (System.Exception ex) { return(BadRequest(new { error = ex.Message })); } }
public async Task CalcTSectionTest() { Section = new SectionStrainsFactory( new Material { beton = new BetonModelEC("C25/30"), armatura = ReinforcementType.GetArmatura().Single(r => r.name == "B500B") }, new ElementGeometryWithReinfI { b_eff_top = 50, h_f_top = 8, b = 30, h = 30, d1 = 6, d2 = 6, As_1 = 6.8, As_2 = 6.8 } ); Stopwatch sw = new Stopwatch(); var Calc = new CalcForces(new ConcreteForceCalc(Section)); Section.SetByEcEs1(-2); var Fc = Calc.Calc(CalcForcesType.ConcreteForces); var Fs1 = Calc.Calc(CalcForcesType.ReinforcementForces1); var Fs2 = Calc.Calc(CalcForcesType.ReinforcementForces2); Assert.IsTrue(Fc.F.Round(2) == -1275 && Fc.Z.Round(2) == 0.0); Assert.IsTrue(Fs1.F.Round(2) == -272.0 && Fs1.Z.Round(2) == 9.0); Assert.IsTrue(Fs2.F.Round(2) == -272.0 && Fs2.Z.Round(2) == 9.0); }
public ReinforcementModelPBAB(int Ø, int Number) { this.Ø = Ø; armatura = ReinforcementType.GetAramturaList().Single(n => n.diameter == Ø); this.Number = Number; this.Type = ReinforcementType.GetArmatura().First(); }
public ReinforcementModelPBAB(ReinforcementTabelModel armatura, int Number) { this.Ø = armatura.diameter; this.armatura = armatura; this.Number = Number; this.Type = ReinforcementType.GetArmatura().First(); }
private static void test22() { var g = new ElementGeometySlenderness() { b = 25, h = 25, izvijanje = Izvijanja.Pokretan_I_Ukljeste, d1 = 4, L = 400, }; var f = new ForcesSlenderness() { N = 85.725, M_top = 0, M_bottom = 0, }; var m = new Material() { beton = TabeleEC2.BetonClasses.GetBetonClassListEC().First(n => n.name == "C30/37"), armatura = ReinforcementType.GetArmatura().First(n => n.name == "B500B"), }; var v = new VitkostEC2_V2(g, f, m); v.Calculate(); v.KontrolaCentPritPreseka(); v.ProracunArmature(); }
private static void PBAB_TacnPostupak() { double Msd = 770; double Mu; double Du; double b_eff = 60; double b_w = 30; double h_f = 10; double d = 51; double s; double δ = h_f / d; //BetonModel beton = BetonClasses.GetBetonClassList().Single(b => b.name == "C25/30"); ReinforcementTypeModelEC arm = ReinforcementType.GetArmatura().Single(a => a.name == "B500B"); var fcd = 2.05; KofZaProracunPravougaonogPresekaModelEC kof1 = new KofZaProracunPravougaonogPresekaModelEC(); KofZaProracunPravougaonogPresekaModelEC kof2 = new KofZaProracunPravougaonogPresekaModelEC(); bool done = false; s = δ; int i = 0; var s_add = 0.1; do { i++; //kof1.SetByS_PBAB(s); var x = s * d; var Du1 = kof1.αv * b_eff * s * d * fcd; var zb1 = d * (1 - kof1.ka * s); var Ebd = ((s - δ) / s) * kof1.εc; kof2.SetByEcEs1(Ebd, 10); var Du2 = kof2.αv * (b_eff - b_w) * (x - h_f) * fcd; var zb2 = d - h_f - kof2.ka * (x - h_f); Mu = Math.Round(Du1 * zb1 / 100 - Du2 * zb2 / 100, 2); if (Mu < Msd) { s += s_add; continue; } //if (Mu > Msd) { s -= 0.09; continue; } if (Mu > Math.Round(Msd * 1.001, 2)) { s_add = s_add / 2; s -= s_add; continue; } if (Mu >= Msd && Mu <= Math.Round(Msd * 1.001, 2)) { done = true; } } while (!done); Console.WriteLine(i); Console.ReadKey(); GC.Collect(); }
public async Task <IActionResult> SearchForLineAsync([FromBody] MN model) { if (model == null) { throw new ArgumentNullException(nameof(model)); } try { var material = new Material() { beton = new BetonModelEC(model.material.betonClass), armatura = ReinforcementType .GetArmatura() .First(n => n.name == model.material.armtype), }; var geometry = new ElementGeometryWithReinfI() { b_eff_top = model.geometry.b_eff, h_f_top = model.geometry.h_f, b = model.geometry.b, d1 = model.geometry.d1, d2 = model.geometry.d2, h = model.geometry.h, As_1 = model.geometry.as1, As_2 = model.geometry.as2, }; var s = new Solver(material, geometry); await s.CalcAsync(); //s.GetWorrnings(model.m, model.n); var isValid = s.List.IsMNValid(model.m, model.n); var listMaxMin = new List <SectionStrainsModel>(); listMaxMin.AddRange( s.List .OrderBy(n => Math.Abs(n.M_Rd - model.m)) .Take(2) ); listMaxMin.AddRange(s.List.OrderBy(n => Math.Abs(n.N_Rd - model.n)) .Take(2)); return(Ok( new { extrims = InfoDetailModel.Converts(listMaxMin.ToArray()), isValid = isValid, worrnings = s.Worrnings, })); } catch (Exception ex) { return(BadRequest(new { error = ex.Message })); } }
public override bool IsValid(object value) { if (value is string) { var b = value as string; return(ReinforcementType.GetArmatura() .Any(x => x.name == (string)value));; } return(false); }
protected override void OnInitialized() { MaterialModel = new MaterialModel(); ListBeton = new List <string>(betonService.GetNameList()); ListArmatura = new List <string>(ReinforcementType.GetArmatura().Select(x => x.name)); MaterialModel.SelectedReinf = ListArmatura.FirstOrDefault(x => x == "B500B"); MaterialModel.SelectedConcrete = ListBeton.FirstOrDefault(x => x == "C25/30"); }
public async Task <List <IReinforcementTypeModel> > GetReinforcementTypesAsync() { var reinforcementTypes = new List <IReinforcementTypeModel>(); await Task.Run(() => { reinforcementTypes = ReinforcementType.GetArmatura(); }); return(reinforcementTypes); }
public ReinforcementModelEC(int Ø, int Number, ReinforcementTypeModelEC Type = null) { this.Ø = Ø; armatura = ReinforcementType.GetAramturaList().Single(n => n.diameter == Ø); this.Number = Number; if (Type == null) { this.Type = ReinforcementType.GetArmatura().First(); } }
private static void test() { var m = new Material() { beton = TabeleEC2.BetonClasses.GetBetonClassListEC().First(n => n.name == "C30/37"), armatura = ReinforcementType.GetArmatura().First(n => n.name == "B500B"), }; var s = new SymmetricalReinforsmentOfColumn(m); var r = s.Get_ρ(457.5, 67.83, 40, 30); }
private static void testqq() { var m = new Material() { beton = TabeleEC2.BetonClasses.GetBetonClassListEC().First(n => n.name == "C30/37"), armatura = ReinforcementType.GetArmatura().First(n => n.name == "B500B"), }; var s = new Generate_ρ_LineForDiagram(m); var r = s.ListOfDotsInLineOfDiagram; }
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 void CreckTest() { var a = new CreckingENCalc.Solver( new Material { beton = new BetonModelEC("C40/50"), armatura = ReinforcementType.GetArmatura().Single(r => r.name == "B500B") }, beam, new Forces { M3 = 43.90 }); Assert.IsTrue(a.CalcValid); }
private static void testSteper() { var beton = TabeleEC2.BetonClasses.GetBetonClassListEC().First(n => n.name == "C25/30"); var arm = ReinforcementType.GetArmatura().First(n => n.name == "B500B"); //var b = new SavijanjePravougaonogPresekaEC2_V2(25,40,4,4, beton,arm,30,20,20); var b = new SavijanjePravougaonogPresekaEC2_V2(25, 40, 6, 6, beton, arm, 50, 30, 50); b.Calc(); foreach (var item in b.Steper.Steps) { Console.WriteLine("Step number " + item.StepNumber); Console.WriteLine("--" + item.Description + "--"); Console.WriteLine(" " + item.StepText); Console.WriteLine(); } Console.ReadKey(); }
private void testqq() { var m = new Material() { beton = TabeleEC2.BetonClasses.GetBetonClassListEC().First(n => n.name == "C30/37"), armatura = ReinforcementType.GetArmatura().First(n => n.name == "B500B"), }; var s = new Generate_ρ_LineForDiagram(m); s.GetLineForDiagram(); var r = s.ListOfDotsInLineOfDiagram; var points = r.Select(n => new Point(n.Mbh, n.NbhPower2)).AsEnumerable(); var l = new List <IEnumerable <Point> >(); l.Add(points); list.ItemsSource = l; }
public static void Init(TestContext tc) { Section = new SectionStrainsFactory( new Material { beton = new BetonModelEC("C25/30"), armatura = ReinforcementType.GetArmatura().Single(r => r.name == "B500B") }, new ElementGeometryWithReinfT { b = 30, h = 30, d1 = 6, d2 = 6, As_1 = 6.8, As_2 = 6.8 } ); }
public async Task <List <CoeffForCalcRectCrossSectionModelEC> > GetKofZaProracunPravougaonogPresekaAsync([FromBody] MaterialModel model) { var kofList = new List <CoeffForCalcRectCrossSectionModelEC>(); var material = new Material() { beton = new BetonModelEC(model.betonClass), armatura = ReinforcementType.GetArmatura().First(n => n.name == model.armtype), }; var geometry = new ElementGeometry() { b = model.b, d1 = model.d1, d2 = model.d2, h = model.h, }; var cService = new CoeffService(material, geometry); await Task.Run(() => { kofList = cService.GetList(); }); return(kofList); }
public async Task <IActionResult> GetListOfAllLines([FromBody] MN model) { if (model == null) { Logger.LogError("model not valid"); throw new System.ArgumentNullException(nameof(model)); } try { var material = new Material() { beton = new BetonModelEC(model.material.betonClass), armatura = ReinforcementType.GetArmatura().First(n => n.name == model.material.armtype), }; var geometry = new ElementGeometryWithReinfI() { b_eff_top = model.geometry.b_eff, h_f_top = model.geometry.h_f, b = model.geometry.b, d1 = model.geometry.d1, d2 = model.geometry.d2, h = model.geometry.h, As_1 = model.geometry.as1, As_2 = model.geometry.as2, }; var s = new Solver(material, geometry); await s.CalcAsync(0.5); Logger.LogInformation("API send interacion curves"); return(Ok(s.List.Select(x => new { x = x.M_Rd, y = x.N_Rd }))); } catch (System.Exception ex) { Logger.LogError("something went wrrong: " + ex.Message); return(BadRequest(new { error = ex.Message })); } }
private void CreateMaterialAndGeometry(MaterialModel materalModel, GeometryModel geometryModel) { Material = new Material { armatura = ReinforcementType.GetArmatura().Find(x => x.name == materalModel.SelectedReinf), beton = betonServices.GetNew(materalModel.SelectedConcrete), }; Material.beton.αcc = Settings.MaterialSettings.alfa_cc; Geometry = new ElementGeometryWithReinfI { b = geometryModel.b, h = geometryModel.h, d1 = geometryModel.d1, d2 = geometryModel.d2, As_1 = geometryModel.As_1, As_2 = geometryModel.As_2, b_eff_top = geometryModel.b_eff_top, h_f_top = geometryModel.h_f_top, b_eff_bottom = geometryModel.b_eff_bottom, h_f_bottom = geometryModel.h_f_bottom, }; }
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 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 })); } }
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 MainPage() { ViewModel = new TransversalReinf_EC2ViewModel(65, 40, 25, 40, 6, ReinforcementType.GetArmatura().Where(n => n.name == "B500B").First(), BetonClasses.GetBetonClassListEC().Find(n => n.name == "C30/37"), new ReinforcementModelEC(ReinforcementType.GetAramturaList().Single(n => n.diameter == 16), 6)); this.InitializeComponent(); }
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); }