Skip to content
Snippets Groups Projects
Commit 864b2940 authored by Rostislav Chudoba's avatar Rostislav Chudoba
Browse files

all packages needed for bmcs

parent 04c2c924
No related branches found
No related tags found
No related merge requests found
Source diff could not be displayed: it is too large. Options to address this: view the blob.
This diff is collapsed.
......@@ -4,22 +4,22 @@ channels:
dependencies:
# - appmode==0.8.0
# - jupyter_contrib_nbextensions==0.5.1
# - traits==6.1.1
- traits==6.1.1
- matplotlib==3.3.3
#- numpy==1.19.4
#- sympy==1.7.1
#- scipy==1.5.3
# - k3d==2.9.3
- numpy==1.19.4
- sympy==1.7.1
- scipy==1.5.3
- k3d==2.9.3
- ipywidgets==7.6.3
# - mayavi==4.7.2
- mayavi==4.7.2
- ipympl==0.7.0
# - ipyregulartable
#- ipytree==0.2.1
#- traitsui==7.1.0
#- pip
#- pip:
# - bmcs-utils==0.0.20a0
# - bmcs-ibvpy==0.0.4a0
# - bmcs-cross_section==0.0.32a0
# - bmcs-beam==0.0.10a0
# - bmcs-fragmentation==0.0.2a0
- ipyregulartable
- ipytree==0.2.1
- traitsui==7.1.0
- pip
- pip:
- bmcs-utils==0.0.20a0
- bmcs-ibvpy==0.0.4a0
- bmcs-cross_section==0.0.32a0
- bmcs-beam==0.0.10a0
- bmcs-fragmentation==0.0.2a0
%% Cell type:markdown id: tags:
# Model comparison
Let us now import the three models
- PO_LF_LM_RG: pullout of long fiber from long rigid matrix
- PO_LF_LM_EL:pullout of long fiber from long elastic matrix
- PO_SF_LM_RG: pullout of long fiber from short rigid matrix
- PO_Comparison: comparison between the above configurations
%% Cell type:code id: tags:
``` python
%%capture
%run 2_1_PO_LF_LM_RG.ipynb
```
%% Cell type:code id: tags:
``` python
%%capture
%run 2_2_PO_LF_LM_EL.ipynb
```
%% Cell type:code id: tags:
``` python
%%capture
%run 2_3_PO_SF_M_RG.ipynb
```
%% Cell type:code id: tags:
``` python
import bmcs_pullout_ui as poui
```
%% Cell type:code id: tags:
``` python
po = poui.ModelInteract(
models=[PO_LF_LM_RG, PO_LF_LM_EL, PO_SF_M_RG],
py_vars=list(py_vars),
map_py2sp=map_py2sp
)
```
%% Cell type:code id: tags:
``` python
po.interact_geometry()
```
%% Output
%% Cell type:code id: tags:
``` python
params = {w: w_range, A_f:1, E_f:1, A_m:1, E_m:4, tau:1, p:1, L_b:1}
param_vals = tuple(params[map_py2sp[py_var]] for py_var in py_vars)
fix, ax = plt.subplots(1,1, figsize=(8,4))
poui.plot_filled_var(ax, w_range, PO_LF_LM_RG.get_Pw_pull(*param_vals),color='orange');
poui.plot_filled_var(ax, w_range, PO_LF_LM_EL.get_Pw_pull(*param_vals),color='green');
poui.plot_filled_var(ax, w_range, PO_SF_M_RG.get_Pw_pull(*param_vals),color='blue');
```
%% Output
<string>:2: RuntimeWarning: invalid value encountered in sqrt
%% Cell type:code id: tags:
``` python
```
......
%% Cell type:markdown id:interior-commons tags:
%% Cell type:markdown id:spread-novelty tags:
# Pull-out, Push-in
%% Cell type:code id:handed-infrared tags:
%% Cell type:code id:defensive-michael tags:
``` python
%matplotlib widget
from pull_out import PO_ELF_RLM
po = PO_ELF_RLM()
from pull_out import PullOutAModel
po = PullOutAModel()
po.interact()
```
%% Output
eta 0.0
%% Cell type:markdown id:flush-apparatus tags:
%% Cell type:code id:enclosed-notebook tags:
## Constant bond-slip law
``` python
import traits.api as tr
```
%% Cell type:code id:indoor-sunrise tags:
``` python
@tr.observe('state_changed')
def print_change(event):
print('state_changed')
```
%% Cell type:markdown id:greatest-copyright tags:
# How to derive a pull-out model given a constant bond-slip law
- [J0201 - Pull-out of long fiber from rigid matrix](2_1_PO_LF_LM_RG.ipynb)
- [J0202 - Pull-out of long fiber from long elastic matrix](2_2_PO_LF_LM_EL.ipynb)
- [J0203 - Pull-out of short fiber from rigid matrix](2_3_PO_SF_M_RG.ipynb)
- [J0204 - Comparison of several models](2_4_PO_comparison.ipynb)
- [J0203 - Pull-out of short fiber from rigid matrix](2_3_PO_ESF_RM.ipynb)
%% Cell type:markdown id:golden-doctrine tags:
# Questions
%% Cell type:markdown id:renewable-literature tags:
- Find a bond length at which the fiber breaks
- Identify the distance at which matrix crack would appear
%% Cell type:code id:blond-receptor tags:
%% Cell type:code id:composite-delivery tags:
``` python
```
......
......@@ -5,6 +5,7 @@ import numpy as np
import sympy as sp
import traits.api as tr
tr.observe
class PO_ELF_RLM_Symb(bu.SymbExpr):
"""Pullout of elastic Long fiber, fromm rigid long matrix
"""
......@@ -53,9 +54,9 @@ class PO_ELF_RLM_Symb(bu.SymbExpr):
aw_pull = a_subs[a].subs(P, Pw_pull)
eps_m_x = 0
sig_m_x = 0
u_ma_x = 0
eps_m_x = eps_f_x * 1e-8
sig_m_x = sig_f_x * 1e-8
u_ma_x = u_fa_x * 1e-8
#-------------------------------------------------------------------------
# Declaration of the lambdified methods
#-------------------------------------------------------------------------
......@@ -158,13 +159,107 @@ class PO_ELF_ELM_Symb(bu.SymbExpr):
('Pw_pull', ('w',)),
]
class PO_ELF_RLM(bu.Model, bu.InjectSymbExpr):
class PO_ESF_RLM_Symb(PO_ELF_RLM_Symb):
E_f, A_f = sp.symbols(r'E_\mathrm{f}, A_\mathrm{f}', positive=True)
E_m, A_m = sp.symbols(r'E_\mathrm{m}, A_\mathrm{m}', positive=True)
tau, p = sp.symbols(r'\bar{\tau}, p', positive=True)
C, D = sp.symbols(r'C, D')
P, w = sp.symbols(r'P, w', positive=True)
x, a, L_b = sp.symbols(r'x, a, L_b')
d_sig_f = p * tau / A_f
sig_f = sp.integrate(d_sig_f, x) + C
eps_f = sig_f / E_f
u_f = sp.integrate(eps_f, x) + D
eq_C = {P - sig_f.subs({x:0}) * A_f}
C_subs = sp.solve(eq_C,C)
eqns_D = {u_f.subs(C_subs).subs(x, a)}
D_subs = sp.solve(eqns_D, D)
u_f.subs(C_subs).subs(D_subs)
eqns_a = {eps_f.subs(C_subs).subs(D_subs).subs(x, a)}
a_subs = sp.solve(eqns_a, a)
var_subs = {**C_subs,**D_subs,**a_subs}
u_f_x = u_f.subs(var_subs)
u_fa_x = sp.Piecewise((u_f_x, x > var_subs[a]),
(0, x <= var_subs[a]))
eps_f_x = sp.diff(u_fa_x,x)
sig_f_x = E_f * eps_f_x
tau_x = sp.simplify(sig_f_x.diff(x) * A_f / p)
u_f_x.subs(x, 0) - w
Pw_pull = sp.solve(u_f_x.subs({x: 0}) - w, P)[0]
w_L_b = u_fa_x.subs(x, -L_b).subs(P, Pw_pull)
aw_pull = a_subs[a].subs(P, Pw_pull)
eps_m_x = eps_f_x * 1e-8
sig_m_x = sig_f_x * 1e-8
u_ma_x = u_fa_x * 1e-8
P_max = p * tau * L_b
w_argmax = sp.solve(P_max - Pw_pull, w)[0]
Pw_up_pull = Pw_pull
b, P_down = sp.symbols(r'b, P_\mathrm{down}')
sig_down = P_down / A_f
eps_down = 1 / E_f * sig_down
w_down = (L_b + b) - sp.Rational(1, 2) * eps_down * b
Pw_down_pull, Pw_down_push = sp.solve(
w_down.subs(b, -P_down / p / tau) - w,
P_down
)
Pw_short = sp.Piecewise((0, w <= 0),
(Pw_up_pull, w <= w_argmax),
(Pw_down_pull, w <= L_b),
(0, True)
)
w_L_b_a = L_b - Pw_down_pull / p / tau
w_L_b = sp.Piecewise((0, w <= w_argmax),
(w_L_b_a, (w > w_argmax) & (w <= L_b)),
(w, True))
aw_pull = - (Pw_short / p / tau)
Pw_pull = Pw_short
#-------------------------------------------------------------------------
# Declaration of the lambdified methods
#-------------------------------------------------------------------------
symb_model_params = ['E_f', 'A_f', 'E_m', 'A_m', 'tau', 'p', 'L_b']
symb_expressions = [
('eps_f_x', ('x','P',)),
('eps_m_x', ('x','P',)),
('sig_f_x', ('x','P',)),
('sig_m_x', ('x','P',)),
('tau_x', ('x','P',)),
('u_fa_x', ('x','P',)),
('u_ma_x', ('x','P',)),
('w_L_b', ('w',)),
('aw_pull', ('w',)),
('Pw_pull', ('w',)),
]
class PullOutAModel(bu.Model, bu.InjectSymbExpr):
"""
Pullout elastic long fiber and rigid long matrix
"""
symb_class = PO_ELF_ELM_Symb
symb_class = PO_ESF_RLM_Symb
name = "PO-ELF-RLM"
name = "Pull-Out"
E_f = bu.Float(210000, MAT=True)
E_m = bu.Float(28000, MAT=True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment