!pip install concreteproperties
import numpy as np
from sectionproperties.pre.library import concrete_rectangular_section, triangular_section
from sectionproperties.pre.library import rectangular_section
from sectionproperties.analysis import Section
from concreteproperties.pre import add_bar, add_bar_rectangular_array
from concreteproperties.pre import add_bar
import concreteproperties.stress_strain_profile as ssp
from concreteproperties import (
Concrete,
ConcreteSection,
SteelBar,
add_bar_rectangular_array,
)
from concreteproperties.post import si_kn_m, si_n_mm
fr = 3.33
Ec = 26986
w=16
P=20*1000
L=12000
concrete = Concrete(
name="28 MPa Concrete",
density=2.4e-6,
stress_strain_profile=ssp.ConcreteLinear(elastic_modulus=Ec),
ultimate_stress_strain_profile=ssp.RectangularStressBlock(
compressive_strength=28,
alpha=0.85,
gamma=0.8, #beta1
ultimate_strain=0.0033,
),
flexural_tensile_strength=fr,
colour="lightgrey",
)
steel = SteelBar(
name="400 MPa Steel",
density=7.85e-6,
stress_strain_profile=ssp.SteelElasticPlastic(
yield_strength=400,
elastic_modulus=200e3,
fracture_strain=0.05,
),
colour="grey",
)
# 1. 원래 만든 순수 콘크리트 단면
geom_base = rectangular_section(b=350, d=600, material=concrete)
# 2. 면적이 0에 가까운(1e-10) '가짜 철근'을 정중앙(도심)에 추가
geom_dummy = add_bar(
geometry=geom_base,
area=1e-10,
material=steel, # 기존에 정의해둔 steel 객체 사용
x=150,
y=250
)
# 3. 단면정보 제공
conc_sec_pure = ConcreteSection(geom_dummy)
conc_gross_props = conc_sec_pure.get_gross_properties()
conc_gross_props = conc_sec_pure.get_transformed_gross_properties(elastic_modulus=Ec)
conc_gross_props.print_results()
Ig=conc_gross_props.ixx_c
yb=conc_gross_props.qx/conc_gross_props.area
Mcr = fr*Ig/yb
geom = rectangular_section(b=350, d=520+80, material=concrete)
bar_area = 3097/8
geom_array = add_bar_rectangular_array(
geometry=geom,
area=bar_area,
material=steel,
n_x=4, # x방향 철근 개수 (1열당 3개)
x_s=80, # x방향 철근 간격 (mm)
n_y=2, # y방향 철근 개수 (즉, 2열)
y_s=40, # y방향 철근 간격 (열과 열 사이의 간격, mm)
anchor=(55, 60) # 좌측 하단 시작 철근의 중심 좌표 (x, y)
)
conc_sec = ConcreteSection(geom_array)
conc_sec.plot_section()
cracked_res_sag = conc_sec.calculate_cracked_properties()
cracked_res_sag.print_results()
cracked_res_sag.calculate_transformed_properties(elastic_modulus=Ec)
cracked_res_sag.print_results()
Icr=cracked_res_sag.ixx_c_cr
print(Icr)
Ma=np.float64(w*L**2/8+P*L/4)
print(Ma)
Ie=(Mcr/Ma)**3*Ig+(1-(Mcr/Ma)**3)*Icr
print(Ie)
deflection = (5*w*L**4)/(384*Ec*Ie)+(P*L**3)/(48*Ec*Ie)
print(deflection)