diff --git a/README.md b/README.md index 4ba5496..d7a97b9 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Hyperelastic formulations using an algorithmic differentiation with hyper-dual numbers in Python.

-[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.8224136.svg)](https://doi.org/10.5281/zenodo.8224136) [![Generic badge](https://img.shields.io/badge/pypi-v0.0.3-.svg)](https://pypi.org/project/hypermat/) +[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.8224136.svg)](https://doi.org/10.5281/zenodo.8224136) [![Generic badge](https://img.shields.io/badge/pypi-v0.0.4-.svg)](https://pypi.org/project/hypermat/) HyperMAT is based on the definitions of the second Piola-Kirchhoff stress $\large S$ and the material tangent modulus $\large \hat{C}$ given below: @@ -45,7 +45,54 @@ C = umat.hessian(F) >
> > Only models in the form of series function based on invariants are supported. + +Sometimes a lucky engineer will have some tension or compression stress-strain test data, or simple shear test data. Processing and applying these data is a critical step to analyze the hyperelastic models. HyperMAT has a calibration module that can help to get the best fitted model parameters. Let's take a look on how things are going on: +```python +import os +from hypermat import NeoHooke, Yeoh, read_file, to_dict, Uniaxial + + +#Prepare material models +umat1 = NeoHooke(C10=1.5,K=2000) +umat2 = Yeoh(C10=0.5,C20=-0.01,C30=0.2, K=2000) + +#Prepare experimental data +cdir = os.getcwd() +dataset = read_file(cdir+'//_hypermat//_calibration//_data//_data_2.csv', delimiter=',', dtype=np.float64) +data = to_dict(dataset[1:,:], ['time', 'strain', 'stress']) +strain = data['strain'] +stress = data['stress'] + +#Choose loading type (Uniaxial, Biaxial or Shear) +test1 = Uniaxial(umat1, data) +test2 = Uniaxial(umat2, data) + +#Plot experimental data +test1.plot() + +#Fit parameters +test1.fit_data([0,0],[20,2000],[True, False]) +test2.fit_data([0,-20,-20,0],[20,20,20,2000],[True,True,True, False]) + +#Plot results +test1.plot_model(c='r') +test2.plot_model(c='g') +``` +You should get something like that: + +

+ +

+ +``` +HyperMAT fitted parameters +{'C10': 0.6624343754510106} +{'C10': 0.5903745146776757, 'C20': -0.09056730756209555, 'C30': 0.3065185192428228} +MCalibration fitted parameters +{'C10': 0.623489155} +{'C10': 0.585555703, 'C20': -0.0846386036, 'C30': 0.304613717} +```

License

HyperMAT- Hyperelastic formulations using an algorithmic differentiation with hyper-dual numbers in Python, (C) 2023 Mohamed ZAARAOUI, Tunisia.