Skip to main content

A package to deal with mechanical models and their linear response in oscillations, creep, microrheology, etc.

Project description

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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mechanical_model-0.0.1.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mechanical_model-0.0.1-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file mechanical_model-0.0.1.tar.gz.

File metadata

  • Download URL: mechanical_model-0.0.1.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for mechanical_model-0.0.1.tar.gz
Algorithm Hash digest
SHA256 3574542475c372616278092ebc76a0ee78c5f796b3d3c60c793068efcc2271e7
MD5 1f4a8ff61e074052d6ef2229ff7569d2
BLAKE2b-256 20ed82c4da77d16e8a982b86a5228a1249932794a6b6e7642656cc2c741fa642

See more details on using hashes here.

File details

Details for the file mechanical_model-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mechanical_model-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2f82291c45d0ef84680b1bc6a0730dd6a79bc161c926b8eb0be44581b0ad71bf
MD5 536be732739edf74a6bb237d18ed294f
BLAKE2b-256 cd9d56f24f3225fe9ca88b1ce2d08b1fbc751736c0ac8c65a0565427e5b6ae00

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page