# 8.1 Mesh bias for discretized bar with linear softening

Instead of a cohesive crack model with the softening behavior described in terms of stress versus crack opening, let us consider a material law of a zone of a material with linear softening depicted in the Figure~\ref{FIG_linear_softening}. 
We will use the softening law to discretize a bar subjected to tensile load. The bar with the Young's modulus $E$ with the total length $L$ is discreitzed using $n$ number of elements.
The response of the bar will stay linear elastic until one of the elements reaches its tensile strength $f_\mathrm{t}$.
At this point, the strain in the bar will be $\varepsilon_0 = f_\mathrm{t} / E $. 
Thus, the elastic elongation of the bar can be expressed as
\begin{align}
u_\mathrm{el} = \varepsilon_0 L = \frac{f_t}{E} L
\end{align}
Beyond the elastic limit, the critical element will enter the softening branch while all the remaining elements will unload. Since we assume the linear softening behavior, we can directly obtain the nominal / macroscopic or average stress-strain response. Once the critical element reached the strength, the stress in the bar will decrease following either the unloading/elastic branch in the elastic part of the specimen or the softening branch in the single softening element. At the stress level $\sigma = 0$, the elastic part will unload to zero so that it provides no contribution to the overall displacement. The softening part will reach the strain corresponding to the intersection of the softening branch with the $\varepsilon$ axis, i.e. $\varepsilon_\mathrm{f}$. Thus, the control load upon reaching the zero strain in the bar be exactly
\begin{align}
u_\mathrm{f}  = \frac{L}{n}  \varepsilon_\mathrm{f}
\end{align}
As a result, the macroscopic stress-strain response of the bar is described by three data points for strains and stresses, i.e. 
\begin{align}
\varepsilon = [ 0, f_t/E, \varepsilon_\mathrm{f} / n ], \sigma = [0, f_t, 0]
\end{align}
Apparently, the macroscopic response of the bar depends on the number of discretization elements so that we can produce arbitrary results by changing the number of elements or, more precisely, the size of the localizing element.


```python
%matplotlib inline
import sympy as sp
import numpy as np
import matplotlib.pyplot as plt
```

## Effect of a the size of the softening zone 


```python
L = 1.0
E = 20000.0
f_t = 2.4
eps_f = 0.1
n_E_list = [100, 200, 1000]
# run a loop over the different discretizations
for n in n_E_list:  # n: number of element
    eps = np.array([0.0, f_t / E, eps_f / n])
    sig = np.array([0.0, f_t, 0.0])
    g_f = eps[-1] * sig[1] / 2
    print('Is the energy constant?', g_f)
    plt.plot(eps, sig, label='n=%i' % n)
    plt.legend(loc=1)

plt.xlabel('strain')
plt.ylabel('stress')
plt.show()
eps_f
```


```python

```

db3a91a8ae0ec69138d2130fa14f1f317ddf515f
ipynb
Jupyter Notebook
tour6_energy/8_1_Mesh bias for discretized bar with linear softening.ipynb
bmcs-group/bmcs_tutorial
4e008e72839fad8820a6b663a20d3f188610525d
MIT
tour6_energy/8_1_Mesh bias for discretized bar with linear softening.ipynb
bmcs-group/bmcs_tutorial
4e008e72839fad8820a6b663a20d3f188610525d
MIT
tour6_energy/8_1_Mesh bias for discretized bar with linear softening.ipynb
bmcs-group/bmcs_tutorial
4e008e72839fad8820a6b663a20d3f188610525d
MIT
Qwen/Qwen-72B
1. YES
2. YES