Skip to main content

HyperMAT
هايبرمات

Hyperelastic formulations using an algorithmic differentiation with hyper-dual numbers in Python.

Generic badge DOI Downloads

HyperMAT is based on the definitions of the first Piola-Kirchhoff stress $\large P$ and the tangent modulus $\large \hat{A}$ given below:

$\large P = \frac{\partial{W}}{\partial{F}}$
$\large \hat{A} = \frac{\partial^2{W}}{\partial{F}^2}$

How to use

This is a quick example of how to use:

import numpy as np
import hypermat as hm

# Initialise material
umat = hm.NeoHooke(C10=0.5, K=0)

# Initialise deformation gradient values
np.random.seed(125161)
F = (np.eye(3) + np.random.rand(50, 8, 3, 3) / 10).T

# Get stress tensor
P = umat.jacobian(F)

# Get tangent modulus tensor
A = umat.hessian(F)

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 are things going on:

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
dir_path = os.path.dirname(os.path.realpath(__file__))
dataset = read_file(dir_path+'//_data//_data_2.csv', delimiter=',', dtype=float)
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}

A special thank you goes to Dutzler, for providing us many powerful tools such as TensorTrax and hyperelastic.

License

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

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Metadata

Release files for hypermat 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hypermat 0.1.2
File Size Uploaded
hypermat-0.1.2.tar.gz 47.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hypermat 0.1.2
File Interpreter ABI Platform
hypermat-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 87.1 kB

Release files / hypermat-0.1.2.tar.gz

Download URL hypermat-0.1.2.tar.gz
Size 47.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a09184a1ed70f92ecb4a10901ce03c616e54189e166d99b02af943129939c637
BLAKE2b-256 checksum
How to use checksums
4650be8b46008e1a9a34edd813e12753d2910795e8f76a311f1d1d1098d12811
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / hypermat-0.1.2-py3-none-any.whl

Download URL hypermat-0.1.2-py3-none-any.whl
Size 39.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
84d570f5874e9623c9da392d0b25451bccd2d21ece2595f76ea05febf5f807ea
BLAKE2b-256 checksum
How to use checksums
69021861c69cdade6c3e6491afe34bfb4c3f651fc60300fe20827ffcc9e692fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page