In [1]:
from IPython.display import display, Markdown as md, HTML as html, FileLink
import math
import time
import json
import zipfile
try:
import pandas as pd
import ipywidgets as widgets
from ipywidgets import interact, interactive, interactive_output
import numpy as np
import matplotlib.pylab as plt
import scipy
from sklearn.preprocessing import minmax_scale
import plotly.express as px
from plotly.subplots import make_subplots
import plotly.graph_objects as go
import statsmodels.api as sm
from matplotlib import pyplot
from scipy.optimize import curve_fit
except Exception as e:
!pip install pandas ipywidgets matplotlib plotly pandas-bokeh scipy scikit-learn statsmodels
import pandas as pd
import ipywidgets as widgets
from ipywidgets import interact, interactive
import numpy as np
import matplotlib.pylab as plt
import scipy
from sklearn.preprocessing import minmax_scale
import plotly.express as px
from plotly.subplots import make_subplots
import plotly.graph_objects as go
import statsmodels.api as sm
from matplotlib import pyplot
from scipy.optimize import curve_fit
#pd.options.plotting.backend = "plotly"
In [2]:
display(md("# Grenzsetzungfunktion"))
df = pd.read_csv('gsf2.csv')
df
#df.to_csv('gsf2.csv',encoding='utf-8', index=False)
GrenzsetzungfunktionΒΆ
Out[2]:
| Nr. | Material | 250_c | 375_c | V | K | |
|---|---|---|---|---|---|---|
| 0 | 1 | KG 2, 0/45 Grauwacke | 1.441 | 2.384 | 80.4 | 45.0 |
| 1 | 2 | KG 1, 0/45 Granodiorid | 5.592 | 6.181 | 100.2 | 45.0 |
| 2 | 3 | Schotter, 31,5/63, Diabas | 7.866 | 9.455 | NaN | NaN |
| 3 | 11 | KG 2, 0/45, Grauwacke | 9.444 | 11.373 | 59.2 | 45.0 |
| 4 | 12 | KG 2, 0/32, Grauwacke | 5.465 | 6.707 | NaN | 32.0 |
| 5 | 13 | KG 2, 0/45, Grauwacke | 6.063 | 7.398 | 77.9 | 45.0 |
| 6 | 14 | KG 1, 0/45, Grauwacke | 8.457 | 10.233 | 38.8 | 45.0 |
| 7 | 15 | KG 2, 0/32, Grauwacke | 4.465 | 5.896 | 95.1 | 32.0 |
| 8 | 16 | KG 2, 0/45, Grauwacke | 3.353 | 4.178 | 109.7 | 45.0 |
| 9 | 17 | KG 2, 0/32, RC-Material | 3.525 | 4.597 | 165.4 | 32.0 |
| 10 | 18 | KG 2, 0/16, Grauwacke | 3.978 | 5.176 | 103.9 | 16.0 |
In [3]:
def gsf1(_K, _V, _F, _pK):
return _pK * (0.1 * _K +4) / 5.659 * 30/ math.pow(_V, 0.4) * (1 - math.pow( math.e, -3.53 * _F))
def pk(_K):
if _K == 16: return 1.5
if _K == 32: return 1.25
if _K == 45: return 1.09
print(math.exp( -3.53 * 10), math.pow( math.e, -3.53 * 10))
def gsf2(_row, _F):
_K = _row["K"]
_V= _row["V"]
print(math.exp( -3.53 * _F), math.pow( math.e, -3.53 * _F))
if math.isnan(_K) or math.isnan(_V): return
return pk(_K) * (0.1 * _K +4) / 5.659 * 30/ math.pow(_V, 0.4) * (1 - math.exp( -3.53 * _F))
# _K 45 32 16
# _V 80,4 100,2, 59,2 77,9, 38,8, 95,1 109,7 165,4, 103,9
# _F 250 375
# _pK 1.5:16er 1.25:32er 1.09:45er
#print(gsf1(45, 100.2, 250, 1.09))
df["250_r"] = df.apply(gsf2, _F=250, axis=1)
df["375_r"] = df.apply(gsf2, _F=375, axis=1)
df["250_d"] = df["250_r"] - df["250_c"]
df["375_d"] = df["375_r"] - df["375_c"]
df.to_csv('gsf3.csv',encoding='utf-8', index=False)
df
4.670945379442584e-16 4.670945379442593e-16 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
Out[3]:
| Nr. | Material | 250_c | 375_c | V | K | 250_r | 375_r | 250_d | 375_d | |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 1 | KG 2, 0/45 Grauwacke | 1.441 | 2.384 | 80.4 | 45.0 | 8.494241 | 8.494241 | 7.053241 | 6.110241 |
| 1 | 2 | KG 1, 0/45 Granodiorid | 5.592 | 6.181 | 100.2 | 45.0 | 7.778214 | 7.778214 | 2.186214 | 1.597214 |
| 2 | 3 | Schotter, 31,5/63, Diabas | 7.866 | 9.455 | NaN | NaN | NaN | NaN | NaN | NaN |
| 3 | 11 | KG 2, 0/45, Grauwacke | 9.444 | 11.373 | 59.2 | 45.0 | 9.600598 | 9.600598 | 0.156598 | -1.772402 |
| 4 | 12 | KG 2, 0/32, Grauwacke | 5.465 | 6.707 | NaN | 32.0 | NaN | NaN | NaN | NaN |
| 5 | 13 | KG 2, 0/45, Grauwacke | 6.063 | 7.398 | 77.9 | 45.0 | 8.602249 | 8.602249 | 2.539249 | 1.204249 |
| 6 | 14 | KG 1, 0/45, Grauwacke | 8.457 | 10.233 | 38.8 | 45.0 | 11.368268 | 11.368268 | 2.911268 | 1.135268 |
| 7 | 15 | KG 2, 0/32, Grauwacke | 4.465 | 5.896 | 95.1 | 32.0 | 7.715283 | 7.715283 | 3.250283 | 1.819283 |
| 8 | 16 | KG 2, 0/45, Grauwacke | 3.353 | 4.178 | 109.7 | 45.0 | 7.501435 | 7.501435 | 4.148435 | 3.323435 |
| 9 | 17 | KG 2, 0/32, RC-Material | 3.525 | 4.597 | 165.4 | 32.0 | 6.183151 | 6.183151 | 2.658151 | 1.586151 |
| 10 | 18 | KG 2, 0/16, Grauwacke | 3.978 | 5.176 | 103.9 | 16.0 | 6.950477 | 6.950477 | 2.972477 | 1.774477 |
In [ ]: