-
Notifications
You must be signed in to change notification settings - Fork 72
/
Report_functions.py
7751 lines (6281 loc) · 345 KB
/
Report_functions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
from utils.common.is800_2007 import *
from pylatex import Math
from pylatex.utils import NoEscape
def cl_3_7_2_section_classification(class_of_section=None):
"""
Find class of the section
Args:
class_of_section:
Returns:
Note:
Reference:
[Ref: Table 2, cl. 3.7.2 and 3.7.4 IS 800:2007]
"""
section_classification_eqn = Math(inline=True)
if class_of_section == int(1):
section_classification_eqn.append(NoEscape(r'\begin{aligned} & \text{Plastic} \\ \\'))
section_classification_eqn.append(NoEscape(r' & [\text{Ref: Table 2, Cl.3.7.2 and 3.7.4, IS 800:2007}] \end{aligned}'))
elif class_of_section == int(2):
section_classification_eqn.append(NoEscape(r'\begin{aligned} & \text{Compact} \\ \\'))
section_classification_eqn.append(NoEscape(r' & [\text{Ref: Table 2, Cl.3.7.2 and 3.7.4, IS 800:2007}] \end{aligned}'))
else:
section_classification_eqn.append(NoEscape(r'\begin{aligned} & \text{Semi-Compact} \\ \\'))
section_classification_eqn.append(NoEscape(r' & [\text{Ref: Table 2, Cl.3.7.2 and 3.7.4, IS 800:2007}] \end{aligned}'))
return section_classification_eqn
def cl_5_4_1_table_4_5_gamma_value(v, t):
"""
Calculate gamma value
Args:
v:value of the gamma (float)
t:subscript (str)
Returns:
gamma value
"""
v = str(v)
gamma = Math(inline=True)
gamma.append(NoEscape(r'\begin{aligned}\gamma_{' + t + '}&=' + v + r'\end{aligned}'))
return gamma
def cl_6_1_tension_capacity_member(T_dg, T_dn=0.0, T_db=0.0):
"""
Calculate Design strength of member
Args:
T_dg:Yeiding capacity of member
T_dn: Rupture capacity of member
T_db: Block shear capacity of member
Returns:
Design strength of member min of( Yeiding ,Rupture and Block shear capacity)
Note:
Reference:
IS 800:2007, cl 6.1
"""
tension_capacity_eqn = Math(inline=True)
if T_db != 0.0 and T_dn != 0.0:
T_d = min(T_dg, T_dn, T_db)
T_d = str(T_d)
T_dg = str(T_dg)
T_dn = str(T_dn)
T_db = str(T_db)
tension_capacity_eqn.append(NoEscape(r'\begin{aligned} T_{\text{d}} &= \min(T_{\text{dg}},~T_{\text{dn}},~T_{\text{db}})\\'))
tension_capacity_eqn.append(NoEscape(r'&= \min(' + T_dg + ',' + T_dn + ',' + T_db + r')\\'))
elif T_db == 0.0 and T_dn != 0.0:
T_d = min(T_dg, T_dn)
T_dg = str(T_dg)
T_dn = str(T_dn)
T_d = str(T_d)
tension_capacity_eqn.append(NoEscape(r'\begin{aligned} T_{\text{d}} &= \min(T_{\text{dg}},~T_{\text{dn}})\\'))
tension_capacity_eqn.append(NoEscape(r'&= \min(' + T_dg + ',' + T_dn + r')\\'))
elif T_db != 0.0 and T_dn == 0.0:
T_d = min(T_dg, T_db)
T_d = str(T_d)
T_dg = str(T_dg)
T_db = str(T_db)
tension_capacity_eqn.append(NoEscape(r'\begin{aligned} T_{\text{d}} &= \min(T_{\text{dg}},~T_{\text{db}})\\'))
tension_capacity_eqn.append(NoEscape(r'&= \min(' + T_dg + ',' + T_db + r')\\'))
else:
T_d = T_dg
# T_dg = str(T_dg)
T_d = str(T_d)
tension_capacity_eqn.append(NoEscape(r'\begin{aligned} T_{\text{d}} &= T_{\text{dg}}\\'))
# tension_capacity_eqn.append(NoEscape(r'&= min(' + T_dg + ',' + T_dn + r')\\'))
tension_capacity_eqn.append(NoEscape(r'&=' + T_d + r'\\ \\'))
tension_capacity_eqn.append(NoEscape(r'& [\text{Ref.IS 800:2007, Cl.6.1}] \end{aligned}'))
return tension_capacity_eqn
def cl_6_2_tension_yield_capacity_member(l, t, f_y, gamma, T_dg, multiple=None, area=None):
"""
Calculate tension yielding capacity of provided plate under axial tension
Args:
l: Height of provided plate in mm (float)
t: Thickness of provided plate in mm (float)
f_y:Yield stress of material in N/mm square (float)
gamma:Partial safety factor for failure in the tension by yielding (float)
T_dg: Tension yieldung capacity of provided plate under axial tension in N (float)
multiple:1 (int)
Returns:
Tension yieldung capacity of provided plate under axial tension
Note:
Reference:
IS 800:2007, cl 6.2
"""
if l is not None and t is not None:
area = str(round(l * t, 2))
l = str(l)
t = str(t)
else:
area = str(area)
f_y = str(f_y)
gamma = str(gamma)
T_dg = str(T_dg)
tension_yield_eqn = Math(inline=True)
tension_yield_eqn.append(NoEscape(r'\begin{aligned} T_{\text{dg}} &= \frac{A_g f_y}{\gamma_{m0}}\\ \\'))
if l is not None and t is not None:
if multiple is None or multiple == 1:
tension_yield_eqn.append(NoEscape(r'A_{g} &= l t =' + l + r'\times' + t + r'\\'))
else:
multiple = str(multiple)
tension_yield_eqn.append(NoEscape(r'A_{g} &=' + multiple + r' l t =' + multiple +
r'\times' + l + r'\times' + t + r'\\'))
tension_yield_eqn.append(NoEscape(r'&=\frac{' + area + r'\times' + f_y + '}{' + gamma + r'\times 10^3}\\'))
tension_yield_eqn.append(NoEscape(r'&=' + T_dg + r'\\ \\'))
tension_yield_eqn.append(NoEscape(r'& [\text{Ref. IS 800:2007, Cl.6.2}] \end{aligned}'))
return tension_yield_eqn
def cl_6_3_1_tension_rupture_plate(w_p, t_p, n_c, d_o, fu, gamma_m1, T_dn, multiple=1):
"""
Calculate design in tension as governed by rupture of net
cross-sectional area in case of bolted connection
Args:
w_p: Width of given section in mm (float)
t_p: Thikness of given section in mm (float)
n_c: No. of bolt holes in critical section (int)
d_o: Diameter of bolt hole in mm (int)
fu: Ultimate stress of material in N/mm square (float)
gamma_m1:Partial safety factor for failure at ultimate stress (float)
T_dn: Rupture strength of net cross-sectional area in N (float)
multiple: 1
Returns:
design in tension as governed by rupture of net cross-sectional area
Note:
Reference:
IS 800:2007, cl 6.3
"""
w_p = str(w_p)
t_p = str(t_p)
n_c = str(n_c)
d_o = str(d_o)
f_u = str(fu)
T_dn = str(T_dn)
gamma_m1 = str(gamma_m1)
multiple = str(multiple)
Tensile_rup_eqnb = Math(inline=True)
Tensile_rup_eqnb.append(NoEscape(r'\begin{aligned} T_{\text{dn}} &= \frac{0.9 A_{n} f_u}{\gamma_{m1}}\\'))
Tensile_rup_eqnb.append(NoEscape(
r'&=\frac{' + multiple + r'\times~0.9\times (' + w_p + '-' + n_c + r'\times' + d_o + r')\times' + t_p + r'\times' + f_u + r'}{' + gamma_m1 + r'}\\'))
Tensile_rup_eqnb.append(NoEscape(r'&=' + T_dn + r'\\ \\'))
Tensile_rup_eqnb.append(NoEscape(r'& [\text{Ref. IS 800:2007, Cl.6.3.1}] \end{aligned}'))
return Tensile_rup_eqnb
def cl_6_3_3_tension_rupture_member(A_nc, A_go, F_u, F_y, L_c, w, b_s, t, gamma_m0, gamma_m1, beta, member_rup, multiple=1):
"""
Calculate design strength due to rupture of critical section
Args:
A_nc:Net area of connected leg in mm square (float)
A_go:Gross area of outstanding leg in mm square (float)
F_u:Ultimate stress of the material in N/mm square (float)
F_y:Yield stess of the material in mm N/square (float)
L_c:Length of the end connection in mm (float)
w:Outstanding leg width in mm (float)
b_s:Shear lag width in mm (float)
t:thickness of the leg in mm (float)
gamma_m0:partial safety factor for failure in tension by yeilding (float)
gamma_m1:partial safety factor for failure at ultimate stress (float)
beta:as per section 6.3.3 (float)
member_rup:design strength due to rupture of critical section (float)
multiple:1
Returns:
design strength due to rupture of critical section
Note:
Reference:
IS 800:2007, cl 6.3
"""
w = str(w)
t = str(t)
fy = str(F_y)
fu = str(F_u)
b_s = str(b_s)
L_c = str(L_c)
A_nc = str(A_nc)
A_go = str(A_go)
gamma_m0 = str(gamma_m0)
gamma_m1 = str(gamma_m1)
beta = str(round(beta, 2))
member_rup = str(member_rup)
multiple = str(multiple)
member_rup_eqn = Math(inline=True)
member_rup_eqn.append(NoEscape(r'\begin{aligned}\beta &= 1.4 - 0.076 \times \frac{w}{t}\times\frac{f_{y}}{0.9 f_{u}}\times\frac{b_s}{L_c}\\'))
member_rup_eqn.append(NoEscape(r'&\leq\frac{0.9 f_{u} \gamma_{m0}}{f_{y} \gamma_{m1}} \geq 0.7 \\ \\'))
member_rup_eqn.append(NoEscape(
r'&= 1.4 - 0.076 \times \frac{' + w + '}{' + t + r'}\times\frac{' + fy + r'}{0.9\times' + fu + r'}\times\frac{' + b_s + '}{' + L_c + r' }\\'))
member_rup_eqn.append(NoEscape(r'&\leq\frac{0.9\times' + fu + r'\times' + gamma_m0 + '}{' + fy + r'\times' + gamma_m1 + r'} \geq 0.7 \\ \\'))
member_rup_eqn.append(NoEscape(r'&= ' + beta + r'\\ \\'))
member_rup_eqn.append(
NoEscape(r'T_{\text{dn}} &= ' + multiple + r'\times \Bigg(\frac{0.9 A_{nc}f_{u}}{\gamma_{m1}} + \frac{\beta A_{go} f_{y}}{\gamma_{m0}} \Bigg)\\'))
member_rup_eqn.append(NoEscape(
r'&= ' + multiple + r'\times \Bigg(\frac{0.9\times' + A_nc + r'\times' + fu + '}{' + gamma_m1 + r'} + \frac{' + beta + r'\times' + A_go + r'\times' + fy + '}{' + gamma_m0 + r'} \Bigg)\\'))
member_rup_eqn.append(NoEscape(r'&= ' + member_rup + r'\\ \\'))
member_rup_eqn.append(NoEscape(r'& [\text{Ref. IS 800:2007, Cl.6.3.3}] \end{aligned}'))
return member_rup_eqn
def cl_6_4_blockshear_capacity_member(Tdb, A_vg=None, A_vn=None, A_tg=None, A_tn=None, f_u=None, f_y=None, gamma_m0=None, gamma_m1=None, stress=None):
"""
Calculate block shear strength of the plate or member
Args:
Tdb:block shear strength of the plate or member in N (float)
A_vg:gross area of plate attached to web in shear along bolt line parallel to y axis in mm square (float)
A_vn:net area of web cover plate attached to web in shear along bolt line parallel to y axis in mm square (float)
A_tg:minimum gross area in tension along bolt line parallel to x-axis in mm square (float)
A_tn:minimum net area in tension along bolt line perpendicular to shear load in mm square (float)
f_u:ultimate stress of material in N/mm square (float)
f_y:yield stress of material in N/mm square (float)
gamma_m0:partial safety factor for failure in tension by yielding (float)
gamma_m1:partial safety factor for failure at ultimate stress (float)
Returns:
block shear strength of the plate or member
Note:
Reference:
IS 800:2007, cl 6.4
"""
Tdb = str(Tdb)
A_vg = str(A_vg)
A_vn = str(A_vn)
A_tg = str(A_tg)
A_tn = str(A_tn)
f_y = str(f_y)
f_u = str(f_u)
gamma_m1 = str(gamma_m1)
gamma_m0 = str(gamma_m0)
member_block_eqn = Math(inline=True)
if stress == "shear":
member_block_eqn.append(
NoEscape(r'\begin{aligned}V_{\text{dbl1}} &= \frac{A_{\text{vg}} f_{y}}{\sqrt{3} \gamma_{m0}} + \frac{0.9 A_{tn} f_{u}}{\gamma_{m1}}\\ \\'))
member_block_eqn.append(NoEscape(r'V_{\text{dbl2}} &= \frac{0.9A_{vn} f_{u}}{\sqrt{3} \gamma_{m1}} + \frac{A_{tg} f_{y}}{\gamma_{m0}}\\ \\'))
member_block_eqn.append(NoEscape(r'V_{\text{db}} &= \min(V_{db1},~ V_{db2})= ' + Tdb + r'\\ \\'))
member_block_eqn.append(NoEscape(r'& [\text{Ref. IS 800:2007, Cl.6.4}] \end{aligned}'))
else:
member_block_eqn.append(
NoEscape(r'\begin{aligned}T_{\text{dbl1}} &= \frac{A_{\text{vg}} f_{y}}{\sqrt{3} \gamma_{m0}} + \frac{0.9 A_{tn} f_{u}}{\gamma_{m1}}\\ \\'))
member_block_eqn.append(NoEscape(r'T_{\text{dbl2}} &= \frac{0.9A_{vn} f_{u}}{\sqrt{3} \gamma_{m1}} + \frac{A_{tg} f_{y}}{\gamma_{m0}}\\ \\'))
member_block_eqn.append(NoEscape(r'T_{\text{db}} &= \min(T_{db1},~ T_{db2})= ' + Tdb + r'\\ \\'))
member_block_eqn.append(NoEscape(r'& [\text{Ref. IS 800:2007, Cl.6.4}] \end{aligned}'))
return member_block_eqn
def slenderness_req():
"""
:return:
"""
slenderlimit_eqn = Math(inline=True)
slenderlimit_eqn.append(NoEscape(r'\begin{aligned}\frac{K L}{r} &\leq 400\end{aligned}'))
return slenderlimit_eqn
def cl_7_1_2_effective_slenderness_ratio(K, L, r, slender):
"""
Calculate effective selenderness ratio
Args:
K:Constant according to the end condition (float)
L:Actual length of the section in mm (float)
r:Radius of gyration in mm (float)
slender: effective selenderness ratio (float)
Returns:
effective selenderness ratio
Note:
Reference:
IS 800:2007, cl 7.1.2
"""
K = str(K)
L = str(L)
r = str(r)
slender = str(slender)
slender_eqn = Math(inline=True)
slender_eqn.append(NoEscape(r'\begin{aligned}\frac{K L}{r} &= \frac{' + K + r'\times' + L + '}{' + r + r'}\\'))
slender_eqn.append(NoEscape(r'&= ' + slender + r'\\ \\'))
slender_eqn.append(NoEscape(r'& [\text{Ref. IS 800:2007, Cl.7.1.2}] \end{aligned}'))
return slender_eqn
def cl_8_2_moment_capacity_member(Pmc, Mdc, M_c):
"""
Calculate moment capacity of the section
Args:
Pmc:Plastic moment capacity of the member in N-mm (float)
Mdc:Moment deformation capacity of the member in N-mm (float)
M_c: Moment capacity of the section in N-mm (float)
Returns:
moment capacity of the section
Note:
Reference:
IS 800:2007, cl 8.2
"""
Pmc = str(Pmc)
Mdc = str(Mdc)
M_c = str(M_c)
M_c_eqn = Math(inline=True)
M_c_eqn.append(NoEscape(r'\begin{aligned} {M_{d}}_{\text{z}} &= \min({M_{d}}_{\text{z}},~ M_{d_c})\\'))
M_c_eqn.append(NoEscape(r'&= \min(' + Pmc + ',' + Mdc + r')\\'))
M_c_eqn.append(NoEscape(r'&=' + M_c + r'\\ \\'))
M_c_eqn.append(NoEscape(r'& [\text{Ref. IS 800:2007, Cl.8.2}] \end{aligned}'))
return M_c_eqn
def cl_8_2_1_2_plastic_moment_capacity_member(beta_b, Z_p, f_y, gamma_m0, Pmc): # same as #todo anjali
"""
Calculate member design moment capacity
Args:
beta_b:1 for plastic and compact sections & Ze/Zp for semi compact section (int)
Z_p:Plastic section modulus of cross section mm^3 (float)
f_y:Yield stress of the material in N/mm square (float)
gamma_m0:partial safety factor (float)
Pmc:Plastic moment capacity in N-mm (float)
Returns:
Plastic moment capacity in N-mm (float)
Note:
Reference:
IS 800:2007, cl 8.2.1.2
"""
beta_b = str(beta_b)
Z_p = str(Z_p)
f_y = str(f_y)
gamma_m0 = str(gamma_m0)
Pmc = str(Pmc)
Pmc_eqn = Math(inline=True)
Pmc_eqn.append(NoEscape(r'\begin{aligned} {M_{d}}_{\text{z}} &= \frac{\beta_b Z_p fy}{\gamma_{m0} \times 10^6}\\'))
Pmc_eqn.append(NoEscape(r'&=\frac{' + beta_b + r'\times' + Z_p + r'\times' + f_y + r'}{' + gamma_m0 + r' \times 10^6}\\'))
Pmc_eqn.append(NoEscape(r'&=' + Pmc + r'\\ \\'))
Pmc_eqn.append(NoEscape(r'& [\text{Ref. IS 800:2007, Cl.8.2.1.2}] \end{aligned}'))
return Pmc_eqn
def cl_8_2_1_2_plastic_moment_capacity(beta_b, Z_p, f_y, gamma_m0, Pmc, supporting_or_supported=''):
"""
Calculate member design moment capacity
Args:
beta_b:1 for plastic and compact sections & Ze/Zp for semi compact section (int)
Z_p:Plastic section modulus of cross section mm^3 (float)
f_y:Yield stress of the material in N/mm square (float)
gamma_m0:partial safety factor (float)
Pmc:Plastic moment capacity in N-mm (float)
Returns:
Plastic moment capacity in N-mm (float)
Note:
Reference:
IS 800:2007, cl 8.2.1.2
"""
beta_b = str(beta_b)
Z_p = str(Z_p)
f_y = str(f_y)
gamma_m0 = str(gamma_m0)
Pmc = str(Pmc)
Pmc_eqn = Math(inline=True)
Pmc_eqn.append(NoEscape(r'\begin{aligned} {M_{d}}_{\text{z}} &= \frac{ \beta_b Z_{p_z} fy } { \gamma_{m0} }\\'))
Pmc_eqn.append(NoEscape(r'&=\frac{' + beta_b + r'\times' + Z_p + r'\times' + f_y + r'}{' + gamma_m0 + r' \times 10^6}\\'))
Pmc_eqn.append(NoEscape(r'&=' + Pmc + r' \\ \\'))
if supporting_or_supported == 'Supporting':
Pmc_eqn.append(NoEscape(r' & \text{Note: ~ The~capacity~of~the~section~is~not} \\'))
Pmc_eqn.append(NoEscape(r' & \text{based~on~the~beam-colum~or~column~ design.} \\'))
Pmc_eqn.append(NoEscape(r' & \text{The~actual~capacity~might~vary.} \\ \\'))
Pmc_eqn.append(NoEscape(r'& [\text{Ref. IS 800:2007, Cl.8.2.1.2}] \end{aligned}'))
return Pmc_eqn
def cl_8_2_1_2_plastic_moment_capacity_yy(beta_b, Z_py, f_y, gamma_m0, Pmc):
Pmc_eqn = Math(inline=True)
Pmc_eqn.append(NoEscape(r'\begin{aligned} {M_{d}}_{\text{y}} &= \frac{ \beta_b Z_{py} fy } { \gamma_{m0} } \\'))
Pmc_eqn.append(NoEscape(r'&=\frac{' + str(beta_b) + r'\times' + str(Z_py) + r'\times' + str(f_y) + r'}{' + str(gamma_m0) + r' \times 10^6}\\'))
Pmc_eqn.append(NoEscape(r'&=' + str(Pmc) + r' \\ \\'))
Pmc_eqn.append(NoEscape(r' & \text{Note: ~ The~capacity~of~the~section~is~not} \\'))
Pmc_eqn.append(NoEscape(r' & \text{based~on~the~beam-colum~or~column~ design.} \\'))
Pmc_eqn.append(NoEscape(r' & \text{The~actual~capacity~might~vary.} \\ \\'))
Pmc_eqn.append(NoEscape(r'& [\text{Ref. IS 800:2007, Cl.8.2.1.2}] \end{aligned}'))
return Pmc_eqn
def cl_8_2_1_2_deformation_moment_capacity_member(fy, Z_e, Mdc):
"""
Calculate moment deformation capacity
Args:
fy:Yield stress of the material in N/mm square (float)
Z_e:Elastic section modulus of cross section in mm^3 (float)
Mdc:Moment deformation capacity in N-mm (float)
Note:
Reference:
IS 800:2007, cl 8.2.1.2
Returns:
moment deformation capacity
"""
fy = str(fy)
Z_e = str(Z_e)
Mdc = str(Mdc)
Mdc_eqn = Math(inline=True)
Mdc_eqn.append(NoEscape(r'\begin{aligned} M_{dc} &= \frac{1.5 Z_e fy}{\gamma_{m0} \times 10^6}\\'))
Mdc_eqn.append(NoEscape(r'&= \frac{1.5 \times' + Z_e + r'\times' + fy + r'}{1.1\times 10^6}\\'))
Mdc_eqn.append(NoEscape(r'&= ' + Mdc + r'\\ \\'))
Mdc_eqn.append(NoEscape(r'& [\text{Ref. IS 800:2007, Cl.8.2.1.2}] \end{aligned}'))
return Mdc_eqn
def cl_8_4_shear_capacity_member(V_dy, V_dn, V_db=0.0, shear_case='low'):
"""
Calculate shear capacity of member
Args:
V_dy: yielding capacity of plate
V_dn: rupture capacity of plate
V_db: block shear capacity of plate
Returns:
shear capacity of member
Note:
Reference:
IS 800:2007, cl 6.1
"""
shear_capacity_eqn = Math(inline=True)
if V_db != 0.0 and V_dn != 0.0:
V_d = min(V_dy, V_dn, V_db)
V_d = str(V_d)
V_dy = str(V_dy)
V_dn = str(V_dn)
V_db = str(V_db)
shear_capacity_eqn.append(NoEscape(r'\begin{aligned} V_d &= \min(S_c,~V_{d_n},~V_{d_b})\\'))
shear_capacity_eqn.append(NoEscape(r'&= \min(' + V_dy + ',~' + V_dn + ',~' + V_db + r')\\'))
elif V_db == 0.0 and V_dn == 0.0:
V_d = V_dy
V_d = str(V_d)
V_dy = str(V_dy)
shear_capacity_eqn.append(NoEscape(r'\begin{aligned} V_d &= S_c\\'))
# shear_capacity_eqn.append(NoEscape(r'&=' + V_dy + r'\\'))
elif V_db == 0.0 and V_dn != 0.0:
V_d = min(V_dy, V_dn)
V_d = str(V_d)
V_dy = str(V_dy)
V_dn = str(V_dn)
shear_capacity_eqn.append(NoEscape(r'\begin{aligned} V_d &= \min(S_c,~V_{d_n})\\'))
shear_capacity_eqn.append(NoEscape(r'&= \min(' + V_dy + ',~' + V_dn + r')\\'))
elif V_db != 0.0 and V_dn == 0.0:
V_d = min(V_dy, V_db)
V_d = str(V_d)
V_dy = str(V_dy)
V_db = str(V_db)
if shear_case == 'full':
shear_capacity_eqn.append(NoEscape(r'\begin{aligned} V_d &= \min(V_{d_y},~V_{d_b})\\'))
else:
shear_capacity_eqn.append(NoEscape(r'\begin{aligned} V_d &= \min(S_c,~V_{d_b})\\'))
shear_capacity_eqn.append(NoEscape(r'&= \min(' + V_dy + ',' + V_db + r')\\'))
shear_capacity_eqn.append(NoEscape(r'&=' + V_d + r'\\ \\'))
shear_capacity_eqn.append(NoEscape(r'& [\text{ Ref. IS 800:2007, Cl.6.1}] \end{aligned}'))
return shear_capacity_eqn
def cl_8_4_shear_yielding_capacity_member(h, t, f_y, gamma_m0, V_dg, multiple=1):
"""
Calculate shear yielding capacity of plate (provided)
Args:
h: Plate ht in mm (float)
t: Plate thickness in mm (float)
f_y:Yeild strength of plate material in N/mm square (float)
gamma: IS800_2007.cl_5_4_1_Table_5["gamma_m0"]['yielding'] (float)
V_dg: Shear yeilding capacity of plate in N (float)
multiple:2 (int)
Returns:
Shear yielding capacity of plate
Note:
Reference:
IS 800:2007, cl 10.4.3
"""
h = str(h)
t = str(t)
f_y = str(f_y)
gamma_m0 = str(gamma_m0)
V_dg = str(V_dg)
shear_yield_eqn = Math(inline=True)
shear_yield_eqn.append(NoEscape(r'\begin{aligned} V_{d_y} &= \frac{A_vf_y}{\sqrt{3}\gamma_{m0}}\\'))
if multiple == 1:
shear_yield_eqn.append(NoEscape(r'&=\frac{' + h + r'\times' + t + r'\times' + f_y + r'}{\sqrt{3} \times' + gamma_m0 + r' \times 1000}\\'))
else:
multiple = str(multiple)
shear_yield_eqn.append(
NoEscape(r'&=\frac{' + multiple + r'\times' + h + r'\times' + t + r'\times' + f_y + r'}{\sqrt{3} \times' + gamma_m0 + r' \times 1000} \\'))
shear_yield_eqn.append(NoEscape(r'&=' + V_dg + r' \\ \\'))
shear_yield_eqn.append(NoEscape(r'& [\text{Ref. IS ~800:2007,~Cl.10.4.3}] \end{aligned}'))
return shear_yield_eqn
def cl_8_4_1_plastic_shear_resistance(h, t, f_y, gamma_m0, V_dg, multiple=1):
"""
Calculate shear yielding capacity of plate (provided)
Args:
h: Plate ht in mm (float)
t: Plate thickness in mm (float)
f_y:Yeild strength of plate material in N/mm square (float)
gamma: IS800_2007.cl_5_4_1_Table_5["gamma_m0"]['yielding'] (float)
V_dg: Shear yeilding capacity of plate in N (float)
multiple:2 (int)
Returns:
Shear yielding capacity of plate
Note:
Reference:
IS 800:2007, cl 10.4.3
"""
h = str(h)
t = str(t)
f_y = str(f_y)
gamma_m0 = str(gamma_m0)
V_dg = str(V_dg)
shear_yield_eqn = Math(inline=True)
shear_yield_eqn.append(NoEscape(r'\begin{aligned} V_{p} &= \frac{A_v f_{y_w}}{\sqrt{3} \gamma_{m0}} \\'))
if multiple == 1:
shear_yield_eqn.append(NoEscape(r'&=\frac{' + h + r'\times' + t + r'\times' + f_y + r'}{\sqrt{3} \times' + gamma_m0 + r'}\\'))
else:
multiple = str(multiple)
shear_yield_eqn.append(
NoEscape(r'&=\frac{' + multiple + r'\times' + h + r'\times' + t + r'\times' + f_y + r'}{\sqrt{3} \times' + gamma_m0 + r'}\\'))
shear_yield_eqn.append(NoEscape(r'&=' + V_dg + r'\\ \\'))
shear_yield_eqn.append(NoEscape(r'& [\text{Ref. IS 800:2007, Cl.8.4.1}] \end{aligned}'))
return shear_yield_eqn
def AISC_J4_shear_rupture_capacity_member(h, t, n_r, d_o, fu, v_dn, gamma_m1=1.25, multiple=1):
"""
Calculate shear rupture capacity of plate (provided)
Args:
h: Height of plate in mm (float)
t:Thickness of plate in mm (float)
n_r:No of bolts provided in one line (float)
d_o:Nominal diameter of bolt provide in plate in mm (float)
fu: Ultimate strength of plate material in N/mm square (float)
v_dn: Shear rupture of plate in KN (float)
gamma_m1: material factor of safety at ultimate load
multiple: 1 (int)
Returns:
shear rupture capacity of plate
Note:
Reference:
AISC Sect.J4
"""
h = str(h)
t = str(t)
n_r = str(n_r)
d_o = str(d_o)
f_u = str(fu)
v_dn = str(v_dn)
gamma_m1 = str(gamma_m1)
multiple = str(multiple)
shear_rup_eqn = Math(inline=True)
shear_rup_eqn.append(NoEscape(r'\begin{aligned} V_{d_n} &= \frac{0.75 A_{v_n} f_u}{\sqrt{3} \gamma_{m1}}\\'))
if multiple == 1:
shear_rup_eqn.append(NoEscape(
r'&=' + r'\times \frac{(' + h + '-(' + n_r + r'\times' + d_o + r'))\times' + t + r'\times' + f_u + r'}{\sqrt{3}\times' + gamma_m1 + r'}\\'))
else:
shear_rup_eqn.append(NoEscape(
r'&=' + multiple + r'\times \frac{(' + h + '-(' + n_r + r'\times' + d_o + r'))\times' + t + r'\times' + f_u + r'}{\sqrt{3}\times' + gamma_m1 + r'}\\'))
shear_rup_eqn.append(NoEscape(r'&=' + v_dn + r'\\ \\'))
shear_rup_eqn.append(NoEscape(r'& [\text{ Ref. AISC, sect. J4}] \end{aligned}'))
return shear_rup_eqn
def cl_9_3_combined_moment_axial_IR_section(M, M_d, N, N_d, IR, type=None):
"""
Calculate
Args:
M: Moment acting on section in KN-mm (float)
M_d:Moment capacity of the section in KN-mm (float)
N: Axial force acting on section in KN (float)
N_d:Tension capacity of the plate in KN (float)
IR: Interaction ratio for combined moment and axial load (no units)
Returns:
mom_axial_IR_eqn: Equation to calculate IR
Note:
Reference:
IS 800:2007, cl 9.3
"""
M = str(M)
M_d = str(M_d)
N = str(N)
N_d = str(N_d)
IR = str(IR)
mom_axial_IR_eqn = Math(inline=True)
if type == None:
mom_axial_IR_eqn.append(NoEscape(r'\begin{aligned} &\frac{' + M + '}{' + M_d + r'}+\frac{' + N + '}{' + N_d + '}=' + IR + r'\\ \\'))
mom_axial_IR_eqn.append(NoEscape(r'& [\text{Ref. IS 800:2007, Cl.10.7}] \end{aligned}'))
elif type == 'squared':
mom_axial_IR_eqn.append(NoEscape(r'\begin{aligned} &(\frac{' + M + '}{' + M_d + r'})^2+(\frac{' + N + '}{' + N_d + '})^2=' + IR + r'\\ \\'))
mom_axial_IR_eqn.append(NoEscape(r'& [\text{Ref. IS 800:2007, Cl.10.7}] \end{aligned}'))
return mom_axial_IR_eqn
def cl_10_2_2_min_spacing(d, parameter='pitch'): # Todo:write condition for pitch and gauge
"""
Calculate the min pitch distance
Args:
d:Diameter of provided bolt in mm (float)
Returns:
Minimum pitch distance in mm (float)
Note:
Reference:
IS 800:2007, cl. 10.2.2
"""
min_pitch = 2.5 * d
d = str(d)
min_pitch = str(min_pitch)
min_pitch_eqn = Math(inline=True)
if parameter == 'pitch':
min_pitch_eqn.append(NoEscape(r'\begin{aligned}p_{\min}&= 2.5 d\\'))
elif parameter == 'gauge':
min_pitch_eqn.append(NoEscape(r'\begin{aligned} g_{\min}&= 2.5 d\\'))
else:
min_pitch_eqn.append(NoEscape(r'\begin{aligned} p/g_{\min}&= 2.5 d\\'))
min_pitch_eqn.append(NoEscape(r'&=2.5 \times' + d + r'\\&=' + min_pitch + r'\\ \\'))
min_pitch_eqn.append(NoEscape(r'& [\text{Ref. IS 800:2007, Cl.10.2.2}] \end{aligned}'))
return min_pitch_eqn
def cl_10_2_3_1_max_spacing(t, parameter=''): # TODO:write condition for pitch and gauge
"""
Calculate the maximum pitch distance
Args:
t: Thickness of thinner plate in mm (float)
Returns:
Max pitch in mm (float)
Note:
Reference:
IS 800:2007, cl. 10.2.3
"""
t1 = str(t[0])
t2 = str(t[1])
max_pitch_1 = 32 * min(t)
max_pitch_2 = 300
max_pitch = min(max_pitch_1, max_pitch_2)
t = str(min(t))
max_pitch = str(max_pitch)
max_pitch_eqn = Math(inline=True)
if parameter == 'pitch':
max_pitch_eqn.append(NoEscape(r'\begin{aligned}p_{\max}&=\min(32t,~300)\\'))
elif parameter == 'gauge':
max_pitch_eqn.append(NoEscape(r'\begin{aligned}g_{\max}&=\min(32t,~300)\\'))
else:
max_pitch_eqn.append(NoEscape(r'\begin{aligned}p/g_{\max}&=\min(32t,~300)\\'))
max_pitch_eqn.append(NoEscape(r'&=\min(32\times' + t + r',~ 300) \\'))
max_pitch_eqn.append(NoEscape(r'&=\min(' + str(max_pitch_1) + r',~ 300) \\'))
max_pitch_eqn.append(NoEscape(r'&=' + max_pitch + r' \\ \\'))
max_pitch_eqn.append(NoEscape(r'\text{Where},~t &= \min(' + t1 + ',' + t2 + r')\\ \\'))
max_pitch_eqn.append(NoEscape(r'& [\text{Ref. IS 800:2007, Cl.10.2.3}] \end{aligned}'))
return max_pitch_eqn
# def cl_10_2_4_2_min_edge_end_dist(d_0, edge_type='Sheared or hand flame cut', parameter='end_dist'):
# """
# Calculate minimum end and edge distance
# Args:
# d - Nominal diameter of fastener in mm (float)
# bolt_hole_type - Either 'Standard', 'Over-sized', 'Short Slot' or 'Long Slot' (str)
# edge_type - Either 'hand_flame_cut' or 'machine_flame_cut' (str)
# parameter - edge or end distance required to return the specific equation (str)
# Returns:
# Equation for minimum end and edge distance from the centre of any hole to the nearest edge of a plate in mm (float)
# Note:
# Reference:
# IS 800:2007, cl. 10.2.4.2
# """
# if edge_type == 'Sheared or hand flame cut':
# end_edge_multiplier = 1.7
# else:
# # TODO : bolt_hole_type == 'machine_flame_cut' is given in else
# end_edge_multiplier = 1.5
#
# min_end_edge_dist = round(end_edge_multiplier * d_0, 2)
#
# d_0 = str(d_0)
# end_edge_multiplier = str(end_edge_multiplier)
# min_end_edge_dist = str(min_end_edge_dist)
#
# end_edge_eqn = Math(inline=True)
# if parameter == 'end_dist':
# end_edge_eqn.append(NoEscape(r'\begin{aligned}e_{min} &= ' + end_edge_multiplier + r'~d_0 \\'))
# elif parameter == 'edge_dist':
# end_edge_eqn.append(NoEscape(r'\begin{aligned}e`_{min} &= ' + end_edge_multiplier + r'~d_0 \\'))
# else:
# end_edge_eqn.append(NoEscape(r'\begin{aligned}e/e`_{min} &= ' + end_edge_multiplier + r'~d_0 \\'))
#
# end_edge_eqn.append(NoEscape(r'&= ' + end_edge_multiplier + r'\times' + d_0 + r'\\'))
# end_edge_eqn.append(NoEscape(r'&=' + min_end_edge_dist + r'\\'))
# end_edge_eqn.append(NoEscape(r'& [Ref.~IS~800:2007,~Cl.~10.2.4.2] \end{aligned}'))
# return end_edge_eqn
def cl_10_2_4_2_min_edge_end_dist(d_0, edge_type='Sheared or hand flame cut', parameter='end_dist'):
"""
Calculate minimum end and edge distance
Args:
d - Nominal diameter of fastener in mm (float)
bolt_hole_type - Either 'Standard', 'Over-sized', 'Short Slot' or 'Long Slot' (str)
edge_type - Either 'hand_flame_cut' or 'machine_flame_cut' (str)
parameter - edge or end distance required to return the specific equation (str)
Returns:
Equation for minimum end and edge distance from the centre of any hole to the nearest edge of a plate in mm (float)
Note:
Reference:
IS 800:2007, cl. 10.2.4.2
"""
if edge_type == 'Sheared or hand flame cut':
end_edge_multiplier = 1.7
else:
# TODO : bolt_hole_type == 'machine_flame_cut' is given in else
end_edge_multiplier = 1.5
min_end_edge_dist = round(end_edge_multiplier * d_0, 2)
d_0 = str(d_0)
end_edge_multiplier = str(end_edge_multiplier)
min_end_edge_dist = str(min_end_edge_dist)
end_edge_eqn = Math(inline=True)
if parameter == 'end_dist':
end_edge_eqn.append(NoEscape(r'\begin{aligned}e_{\min} &= ' + end_edge_multiplier + r' d_0 \\'))
elif parameter == 'edge_dist':
end_edge_eqn.append(NoEscape(r'\begin{aligned}e\textquotesingle_{\min} &= ' + end_edge_multiplier + r' d_0 \\'))
else:
end_edge_eqn.append(NoEscape(r'\begin{aligned}e/e\textquotesingle_{\min} &= ' + end_edge_multiplier + r' d_0 \\'))
end_edge_eqn.append(NoEscape(r'&= ' + end_edge_multiplier + r'\times' + d_0 + r'\\'))
end_edge_eqn.append(NoEscape(r'&=' + min_end_edge_dist + r'\\ \\'))
end_edge_eqn.append(NoEscape(r'& [\text{Ref. IS 800:2007, Cl.10.2.4.2}] \end{aligned}'))
return end_edge_eqn
# def cl_10_2_4_3_max_edge_end_dist(t_fu_fy, corrosive_influences=False, parameter='end_dist'):
# """
# Calculate maximum end and edge distance(new)
# Args:
#
# t_fu_fy: List of tuples with thickness fu fy of each connecting member.
# ex: [(thickness_plate_1, fu_plate_1, fy_plate_1),(thickness_plate_1, fu_plate_1, fy_plate_1)]
# corrosive_influences: Whether the members are exposed to corrosive influences or not (Boolean)
#
# Returns:
# Maximum edge distance to the nearest line of fasteners from an edge of any un-stiffened part in mm (float)
#
# Note:
# Reference:
# IS 800:2007, cl. 10.2.4.3
# """
# t_epsilon_considered = t_fu_fy[0][0] * math.sqrt(250 / float(t_fu_fy[0][2]))
# t_considered = t_fu_fy[0][0]
# t_min = t_considered
# for i in t_fu_fy:
# t = i[0]
# f_y = i[2]
# if f_y > 0:
# epsilon = math.sqrt(250 / f_y)
# if t * epsilon <= t_epsilon_considered:
# t_epsilon_considered = t * epsilon
# t_considered = t
# if t < t_min:
# t_min = t
#
# if corrosive_influences is True:
# max_edge_dist = round(40.0 + 4 * t_min, 2)
# else:
# max_edge_dist = round(12 * t_epsilon_considered, 2)
#
# max_edge_dist = str(max_edge_dist)
# t1=str(t_fu_fy[0][0])
# t2=str(t_fu_fy[1][0])
# fy1 = str(t_fu_fy[0][2])
# fy2 = str(t_fu_fy[1][2])
# max_end_edge_eqn = Math(inline=True)
#
# if corrosive_influences is False:
# if parameter == 'end_dist':
# max_end_edge_eqn.append(NoEscape(r'\begin{aligned}e_{max} &= 12~ t~ \varepsilon ;~\varepsilon = \sqrt{\frac{250}{f_y}}\\'))
# else: #'edge_dist'
# max_end_edge_eqn.append(NoEscape(r'\begin{aligned}e`_{max} &= 12~ t~ \varepsilon ;~\varepsilon = \sqrt{\frac{250}{f_y}}\\'))
# # max_end_edge_eqn.append(NoEscape(r'\varepsilon &= \sqrt{\frac{250}{f_y}}\\'))
# max_end_edge_eqn.append(NoEscape(r'e1 &= 12 \times ' + t1 + r'\times \sqrt{\frac{250}{' + fy1 + r'}}\\'))
# max_end_edge_eqn.append(NoEscape(r'e2 &= 12 \times' + t2 + r'\times\sqrt{\frac{250}{' + fy2 + r'}}\\'))
# if parameter == 'end_dist':
# max_end_edge_eqn.append(NoEscape(r'e_{max}&=min(e1,e2)=' + max_edge_dist +r'\\'))
# else: #'edge_dist'
# max_end_edge_eqn.append(NoEscape(r'e`_{max}&=min(e1,e2)=' + max_edge_dist +r'\\'))
# # max_end_edge_eqn.append(NoEscape(r' &=' + max_edge_dist + r'\\'))
# max_end_edge_eqn.append(NoEscape(r'& [Ref.~IS~800:2007,~Cl.~10.2.4.3] \end{aligned}'))
#
# else:
# max_end_edge_eqn.append(NoEscape(r'\begin{aligned} Member(s) exposed to corrosive influences = True \\'))
# if parameter == 'end_dist':
# max_end_edge_eqn.append(NoEscape(r'\begin{aligned}e_{max}&=40 + 4t\\'))
# else: #'edge_dist'
# max_end_edge_eqn.append(NoEscape(r'\begin{aligned}e`_{max}&=40 + 4t\\'))
#
# if int(t2) > 0:
# max_end_edge_eqn.append(NoEscape(r'Where,~ t&= min(' + t1 +','+t2+r')\\'))
# else:
# max_end_edge_eqn.append(NoEscape(r'Where,~ t&= ' + t1 + r')\\'))
#
# if parameter == 'end_dist':
# max_end_edge_eqn.append(NoEscape(r'e_{max}&='+max_edge_dist+r'\\'))
# else: #'edge_dist'
# max_end_edge_eqn.append(NoEscape(r'e`_{max}&='+max_edge_dist+r'\\'))
#
# max_end_edge_eqn.append(NoEscape(r'& [Ref.~IS~800:2007,~Cl.~10.2.4.3] \end{aligned}'))
#
# return max_end_edge_eqn
def cl_10_2_4_3_max_edge_end_dist(t_fu_fy, corrosive_influences=False, parameter='end_dist'):
"""
Calculate maximum end and edge distance(new)
Args:
t_fu_fy: List of tuples with thickness fu fy of each connecting member.
ex: [(thickness_plate_1, fu_plate_1, fy_plate_1),(thickness_plate_1, fu_plate_1, fy_plate_1)]
corrosive_influences: Whether the members are exposed to corrosive influences or not (Boolean)
Returns:
Maximum edge distance to the nearest line of fasteners from an edge of any un-stiffened part in mm (float)
Note:
Reference:
IS 800:2007, cl. 10.2.4.3
"""
# t_epsilon_considered = t_fu_fy[0][0] * math.sqrt(250 / float(t_fu_fy[0][2]))
# t_considered = t_fu_fy[0][0]
# t_min = t_considered
# for i in t_fu_fy:
# t = i[0]
# f_y = i[2]
# if f_y > 0:
# epsilon = math.sqrt(250 / f_y)
# if t * epsilon <= t_epsilon_considered:
# t_epsilon_considered = t * epsilon
# t_considered = t
# if t < t_min:
# t_min = t
#
# if corrosive_influences is True:
# max_edge_dist = round(40.0 + 4 * t_min, 2)
# else:
# max_edge_dist = round(12 * t_epsilon_considered, 2)
# max_edge_dist = str(max_edge_dist)
e1 = round(12*t_fu_fy[0][0]*math.sqrt(250/t_fu_fy[0][2]),2)
e2 = round(12 * t_fu_fy[1][0] * math.sqrt(250 / t_fu_fy[1][2]),2)
max_edge_dist = str(min(e1,e2))
e1 = str(e1)
e2 = str(e2)
t1 = str(t_fu_fy[0][0])
t2 = str(t_fu_fy[1][0])
fy1 = str(t_fu_fy[0][2])
fy2 = str(t_fu_fy[1][2])
max_end_edge_eqn = Math(inline=True)
if corrosive_influences is False:
if parameter == 'end_dist':
max_end_edge_eqn.append(NoEscape(r'\begin{aligned}e_{\max} &= 12 t \varepsilon ;~\varepsilon = \sqrt{\frac{250}{f_y}}\\'))
else: # 'edge_dist'
max_end_edge_eqn.append(NoEscape(r'\begin{aligned}e\textquotesingle_{\max} &= 12 t \varepsilon ;~\varepsilon = \sqrt{\frac{250}{f_y}}\\'))
# max_end_edge_eqn.append(NoEscape(r'\varepsilon &= \sqrt{\frac{250}{f_y}}\\'))
max_end_edge_eqn.append(NoEscape(r'e_1 &= 12 \times ' + t1 + r'\times \sqrt{\frac{250}{' + fy1 + r'}} = ' + e1 + r'\\'))
max_end_edge_eqn.append(NoEscape(r'e_2 &= 12 \times' + t2 + r'\times\sqrt{\frac{250}{' + fy2 + r'}} = ' + e2 + r'\\'))
if parameter == 'end_dist':
max_end_edge_eqn.append(NoEscape(r'e_{\max}&=\min(e_1,~e_2)=' + max_edge_dist + r' \\ \\'))
else: # 'edge_dist'
max_end_edge_eqn.append(NoEscape(r'e\textquotesingle_{\max}&=min(e_1,~e_2)=' + max_edge_dist + r' \\ \\'))
# max_end_edge_eqn.append(NoEscape(r' &=' + max_edge_dist + r'\\'))
max_end_edge_eqn.append(NoEscape(r'& [\text{Ref. IS 800:2007, Cl.10.2.4.3}] \end{aligned}'))
else:
if parameter == 'end_dist':
max_end_edge_eqn.append(NoEscape(r'\begin{aligned}e_{\max}&=40 + 4t\\'))
else: # 'edge_dist'
max_end_edge_eqn.append(NoEscape(r'\begin{aligned}e\textquotesingle_{\max}&=40 + 4t\\'))
if int(float(t2)) <= 0.0: # for cases where only a single plate is present
max_end_edge_eqn.append(NoEscape(r'\text{Where},~ t&= ' + t1 + r'\\'))
else:
max_end_edge_eqn.append(NoEscape(r'\text{Where}, t&= \min(' + t1 + ',' + t2 + r')\\'))
if int(float(t2)) <= 0.0: # for cases where only a single plate is present
min_t = t1
else:
min_t = min(int(float(t1)), int(float(t2)))
max_edge_dist = str(round(40.0 + 4 * min_t, 2))
min_t = str(min_t)
if parameter == 'end_dist':
max_end_edge_eqn.append(NoEscape(r'&= 40 + (4 \times ' + min_t + r') \\'))
max_end_edge_eqn.append(NoEscape(r'e_{\max}&=' + max_edge_dist + r' \\\\ '))
else: # 'edge_dist'
max_end_edge_eqn.append(NoEscape(r'&= 40 + (4 \times ' + min_t + r') \\'))
max_end_edge_eqn.append(NoEscape(r'e\textquotesingle_{\max}&=' + max_edge_dist + r'\\ \\'))
max_end_edge_eqn.append(NoEscape(r'& [\text{Ref. IS 800:2007, Cl.10.2.4.3}] \end{aligned}'))
return max_end_edge_eqn
def cl_10_3_2_bolt_capacity(bolt_shear_capacity, bolt_bearing_capacity, bolt_capacity):
"""
Calculate bolt capacity (min of bearing and shearing)
Args:
bolt_shear_capacity: Bolt shearing capacity in KN (float)