<jupyter_start><jupyter_text>Eurocode 2 - Chapter 3 - Concrete tables<jupyter_code>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
fck = np.array([12., 16. ,20., 25., 30., 35., 35., 40., 45., 50., 55., 60., 70., 80., 90.])
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)
dict_strengths = {"fck": fck, "fcm": fcm.round(2), "fctm": fctm.round(2),
                  "fctk005": fctk005.round(2), "fctk095": fctk095.round(2)} 
strengths_table = pd.DataFrame(dict_strengths)
strengths_table
inverted_strengths_table = strengths_table.T
inverted_strengths_table
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()
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)
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)} 
strains_table = pd.DataFrame(dict_strains)
strains_table
merged_table = pd.merge(left=strains_table, right=strengths_table, left_on='fck', right_on='fck')
merged_table
print(merged_table.to_markdown(index=False))
print(merged_table.to_latex(index=False))<jupyter_output>\begin{tabular}{rrrrrrrrrrrr}
\toprule
 fck &  εc1 &  εc2 &  εc3 &  εcu1 &  εcu2 &  εcu3 &    n &  fcm &  fctm &  fctk005 &  fctk095 \\
\midrule
12.0 & 1.77 & 2.00 & 1.75 &  3.50 &  3.50 &  3.50 & 2.00 & 20.0 &  1.57 &     1.10 &     2.04 \\
16.0 & 1.87 & 2.00 & 1.75 &  3.50 &  3.50 &  3.50 & 2.00 & 24.0 &  1.90 &     1.33 &     2.48 \\
20.0 & 1.97 & 2.00 & 1.75 &  3.50 &  3.50 &  3.50 & 2.00 & 28.0 &  2.21 &     1.55 &     2.87 \\
25.0 & 2.07 & 2.00 & 1.75 &  3.50 &  3.50 &  3.50 & 2.00 & 33.0 &  2.56 &     1.80 &     3.33 \\
30.0 & 2.16 & 2.00 & 1.75 &  3.50 &  3.50 &  3.50 & 2.00 & 38.0 &  2.90 &     2.03 &     3.77 \\
35.0 & 2.25 & 2.00 & 1.75 &  3.50 &  3.50 &  3.50 & 2.00 & 43.0 &  3.21 &     2.25 &     4.17 \\
35.0 & 2.25 & 2.00 & 1.75 &  3.50 &  3.50 &  3.50 & 2.00 & 43.0 &  3.21 &     2.25 &     4.17 \\
35.0 & 2.25 & 2.00 & 1.75 &  3.50 &  3.50 &  3.50 & 2.00 & 43.0 &  3.21 &     2.25 &     4.17 \\
35.0 & 2.25 & 2.00 & 1.75 &  3.50 &  3.50 &  3.50 & 2.00 & 43.0 &  3.21 &     2[...]
{'fraction_non_alphanumeric': 0.18783655369021224, 'fraction_numerical': 0.15172632245802978, 'mean_word_length': 2.516703786191537, 'pattern_counts': {'":': 13, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '507068', 'license': 'MIT', 'n_tokens_mistral': 1779, 'n_tokens_neox': 1514, 'n_words': 286, 'path': 'codes/eurocodes/ec2/raw_ch3_concrete_tables.ipynb', 'repo_name': 'panagop/streng_jupyters', 'size': '3157'}