Mechanical models
A package to deal with mechanical models and their linear response in oscillations, creep, microrheology, etc.
##Installation
- Clone from github
pip install -e .
Drawing diagrams in plain text
from mechanical_model.diagram import Spring, Dashpot, Springpot
print(Spring() + Dashpot('ηs') * (Springpot('V', 'α') + Springpot('W', 'β')))
___
__________| |___________
| _|_| ηs |
| |
| |
____╱╲ ╱╲ ╱╲ _______|____╱╲__________╱╲______|___
╲╱ ╲╱ ╲╱ G ╲╱ V, α ╲╱ W, β
Mechanical response in oscillations
import numpy as np
from mechanical_model.linear_mech import Maxwell
from matplotlib import pyplot as plt
omega = np.logspace(-2,2)
fig, axs = plt.subplots(2,1, sharex=True, layout='constrained')
for m in [Maxwell(G=10, eta=1), Maxwell(G=1, tau=0.3)]:
line, = axs[0].plot(omega, m.tandelta(omega), label=m)
axs[1].plot(omega, m.Gp(omega), color=line.get_color())
axs[1].plot(omega, m.Gpp(omega), ls='--', color=line.get_color())
axs[0].set_ylabel(r'$\tan\delta$')
axs[1].set_ylabel(r'$G^\prime,G^{\prime\prime}$')
axs[1].set_xlabel(r'$\omega$')
for ax in axs:
ax.set_xscale('log')
ax.set_yscale('log')
axs[0].legend()
Release files for mechanical-model 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mechanical_model-0.0.1.tar.gz | 16.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mechanical_model-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.6 kB
Release files / mechanical_model-0.0.1.tar.gz
| Download URL | mechanical_model-0.0.1.tar.gz |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3574542475c372616278092ebc76a0ee78c5f796b3d3c60c793068efcc2271e7
|
|
BLAKE2b-256 checksum How to use checksums |
20ed82c4da77d16e8a982b86a5228a1249932794a6b6e7642656cc2c741fa642
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / mechanical_model-0.0.1-py3-none-any.whl
| Download URL | mechanical_model-0.0.1-py3-none-any.whl |
|---|---|
| Size | 17.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2f82291c45d0ef84680b1bc6a0730dd6a79bc161c926b8eb0be44581b0ad71bf
|
|
BLAKE2b-256 checksum How to use checksums |
cd9d56f24f3225fe9ca88b1ce2d08b1fbc751736c0ac8c65a0565427e5b6ae00
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|