Eurocode 2 - Chapter 3 - Concrete tables

In [1]:
import pandas as pd
import numpy as np
from numpy import vectorize
import matplotlib.pyplot as plt

from streng.codes.eurocodes.ec2.raw.ch3.concrete import strength, stress_strain
In [2]:
fck = np.array([12., 16. ,20., 25., 30., 35., 35., 40., 45., 50., 55., 60., 70., 80., 90.])
In [3]:
fcm = strength.fcm(fck)
vfctm = vectorize(strength.fctm)
vfctk005 = vectorize(strength.fctk005)
vfctk095 = vectorize(strength.fctk095)

fctm = vfctm(fck)
fctk005 = vfctk005(fck)
fctk095 = vfctk095(fck)
In [4]:
dict_strengths = {"fck": fck, "fcm": fcm.round(2), "fctm": fctm.round(2),
                  "fctk005": fctk005.round(2), "fctk095": fctk095.round(2)}
In [5]:
strengths_table = pd.DataFrame(dict_strengths)
strengths_table
Out[5]:
fck fcm fctm fctk005 fctk095
0 12.0 20.0 1.57 1.10 2.04
1 16.0 24.0 1.90 1.33 2.48
2 20.0 28.0 2.21 1.55 2.87
3 25.0 33.0 2.56 1.80 3.33
4 30.0 38.0 2.90 2.03 3.77
5 35.0 43.0 3.21 2.25 4.17
6 35.0 43.0 3.21 2.25 4.17
7 40.0 48.0 3.51 2.46 4.56
8 45.0 53.0 3.80 2.66 4.93
9 50.0 58.0 4.07 2.85 5.29
10 55.0 63.0 4.21 2.95 5.48
11 60.0 68.0 4.35 3.05 5.66
12 70.0 78.0 4.61 3.23 5.99
13 80.0 88.0 4.84 3.39 6.29
14 90.0 98.0 5.04 3.53 6.56
In [6]:
inverted_strengths_table = strengths_table.T
inverted_strengths_table
Out[6]:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
fck 12.00 16.00 20.00 25.00 30.00 35.00 35.00 40.00 45.00 50.00 55.00 60.00 70.00 80.00 90.00
fcm 20.00 24.00 28.00 33.00 38.00 43.00 43.00 48.00 53.00 58.00 63.00 68.00 78.00 88.00 98.00
fctm 1.57 1.90 2.21 2.56 2.90 3.21 3.21 3.51 3.80 4.07 4.21 4.35 4.61 4.84 5.04
fctk005 1.10 1.33 1.55 1.80 2.03 2.25 2.25 2.46 2.66 2.85 2.95 3.05 3.23 3.39 3.53
fctk095 2.04 2.48 2.87 3.33 3.77 4.17 4.17 4.56 4.93 5.29 5.48 5.66 5.99 6.29 6.56
In [7]:
fig, ax = plt.subplots()

line0, = ax.plot(fck, fck, '--', linewidth=2,
                 label='fck')
line1, = ax.plot(fck, fcm, '--', linewidth=2,
                 label='fcm')
line2, = ax.plot(fck, fctm, dashes=[30, 5, 10, 5],
                 label='fctm')
line3, = ax.plot(fck, fctk005, dashes=[30, 5, 10, 5],
                 label='fctk005')
line4, = ax.plot(fck, fctk095,
                 label='fctk095')
ax.legend(loc='right')
ax.grid(True)
plt.show()
../../../../_images/jupyters_codes_eurocodes_ec2_raw_ch3_concrete_tables_7_0.png
In [8]:
vεc1 = vectorize(stress_strain.εc1)
vεc2 = vectorize(stress_strain.εc2)
vεc3 = vectorize(stress_strain.εc3)
vεcu1 = vectorize(stress_strain.εcu1)
vεcu2 = vectorize(stress_strain.εcu2)
vεcu3 = vectorize(stress_strain.εcu3)
vn = vectorize(stress_strain.n)

εc1 = vεc1(fck)
εc2 = vεc2(fck)
εc3 = vεc3(fck)
εcu1 = vεcu1(fck)
εcu2 = vεcu2(fck)
εcu3 = vεcu3(fck)
n = vn(fck)
In [9]:
dict_strains = {"fck": fck, "εc1": εc1.round(2), "εc2": εc2.round(2), "εc3": εc3.round(2),
                "εcu1": εcu1.round(2), "εcu2": εcu2.round(2), "εcu3": εcu3.round(2),
                "n": n.round(2)}
In [10]:
strains_table = pd.DataFrame(dict_strains)
strains_table
Out[10]:
fck εc1 εc2 εc3 εcu1 εcu2 εcu3 n
0 12.0 1.77 2.00 1.75 3.50 3.50 3.50 2.00
1 16.0 1.87 2.00 1.75 3.50 3.50 3.50 2.00
2 20.0 1.97 2.00 1.75 3.50 3.50 3.50 2.00
3 25.0 2.07 2.00 1.75 3.50 3.50 3.50 2.00
4 30.0 2.16 2.00 1.75 3.50 3.50 3.50 2.00
5 35.0 2.25 2.00 1.75 3.50 3.50 3.50 2.00
6 35.0 2.25 2.00 1.75 3.50 3.50 3.50 2.00
7 40.0 2.32 2.00 1.75 3.50 3.50 3.50 2.00
8 45.0 2.40 2.00 1.75 3.50 3.50 3.50 2.00
9 50.0 2.46 2.00 1.75 3.49 3.50 3.50 2.00
10 55.0 2.53 2.20 1.82 3.21 3.13 3.13 1.75
11 60.0 2.59 2.29 1.89 3.02 2.88 2.88 1.59
12 70.0 2.70 2.42 2.02 2.84 2.66 2.66 1.44
13 80.0 2.80 2.52 2.16 2.80 2.60 2.60 1.40
14 90.0 2.80 2.60 2.30 2.80 2.60 2.60 1.40