Lightning-fast integration of single degree-of-freedom systems.
Project description
sdof
Lightning-fast integration of single degree-of-freedom systems.
This package solves scalar differential equations of the form
$$ m \ddot{u} + c \dot{u} + k u = f(t) $$
Integration is carried out using a Generalized - $\alpha$ integrator that is implemented under the hood in highly optimized multi-threaded C code.
Generalized - $\alpha$ is an implicit method that allows for high frequency energy dissipation and second order accuracy. With the right selection of parameters, the method can be specialized to the Hibert-Hughes-Taylor (HHT), or Newmark families of integration schemes.
Python API
import numpy as np
from sdof import integrate, peaks, spectrum
m = 1.0
c = 1.0
k = 2.0
f = np.sin(np.linspace(0, 5*np.pi, 100))
dt = 5*np.pi/100
u_max, v_max, a_max = peaks(m, c, k, f, dt)
u, v, a = integrate(m, c, k, f, dt)
D, V, A = spectrum(f, dt, damping=[0.02, 0.05], periods=(0.02, 3.0, 100))
Integrator (Adapted from OpenSees docs)
|
$\alpha_M$ factor |
|
$\alpha_F$ factor |
|
$\gamma$ factor |
|
$\beta$ factor |
- $\alpha_F$ and $\alpha_M$ are defined differently that in the paper, we use $\alpha_F = (1-\alpha_f)$ and $\alpha_M=(1-\gamma_m)$ where $\alpha_f$ and $\alpha_m$ are those used in the paper.
- Like Newmark and other implicit schemes, the unconditional stability of this method applies to linear problems. There are no results showing stability of this method over the wide range of nonlinear problems that potentially exist. Experience indicates that the time step for implicit schemes in nonlinear situations can be much greater than those for explicit schemes.
- $\alpha_M = 1.0, \alpha_F = 1.0$ produces the Newmark Method.
- $\alpha_M = 1.0$ corresponds to the HHT method.
- The method is second-order accurate provided $\gamma = \dfrac{1}{2} + \alpha_M - \alpha_F$
- The method is unconditionally stable provided $\alpha_M \ge \alpha_F \ge \dfrac{1}{2}, \quad \beta \ge \dfrac{1}{4} +\dfrac{1}{2}(\gamma_M - \gamma_F)$
- $\gamma$ and $\beta$ are optional. The default values ensure the method is unconditionally stable, second order accurate and high frequency dissipation is maximized.
The defaults are:
-
$$\gamma = \dfrac{1}{2} + \gamma_M - \gamma_F$$
and
-
$$\beta = \dfrac{1}{4}(1 + \gamma_M - \gamma_F)^2$$
Theory
The generalized $\alpha$ method is a one step implicit method for solving the transient problem which attempts to increase the amount of numerical damping present without degrading the order of accuracy. In the HHT method, the same Newmark approximations are used:
-
$$u_{t+\Delta t} = u_t + \Delta t \dot u_t + [(0.5 - \beta) \Delta t^2] \ddot u_t + [\beta \Delta t^2] \ddot u_{t+\Delta t}$$
-
$$\dot u_{t+\Delta t} = \dot u_t + [(1-\gamma)\Delta t] \ddot u_t + [\gamma \Delta t ] \ddot u_{t+\Delta t} $$
but the time-discrete momentum equation is modified:
$$R_{t + \alpha_M \Delta t} = F_{t+\Delta t}^{\mathrm{ext}} - M \ddot u_{t + \alpha_M \Delta t} - C \dot u_{t+\alpha_F \Delta t} - F^{\mathrm{int}}(u_{t + \alpha_F \Delta t}) $$
where the displacements and velocities at the intermediate point are given by:
$$u_{t+ \alpha_F \Delta t} = (1 - \alpha_F) u_t + \alpha_F u_{t + \Delta t}$$
$$\dot u_{t+\alpha_F \Delta t} = (1-\alpha_F) \dot u_t + \alpha_F \dot u_{t + \Delta t}$$
$$\ddot u_{t+\alpha_M \Delta t} = (1-\alpha_M) \ddot u_t + \alpha_M \ddot u_{t + \Delta t}$$
Following the methods outlined for Newmarks method, linearization of the nonlinear momentum equation results in the following linear equations:
$$K_{t+\Delta t}^{*i} d u_{t+\Delta t}^{i+1} = R_{t+\Delta t}^i$$
$$K_{t+\Delta t}^{*i} = \alpha_F K_t + \alpha_F \frac{\gamma}{\beta \Delta t} C_t + \alpha_M\frac{1}{\beta \Delta t^2}M$$
and
$$R_{t+\Delta t}^i = F_{t + \Delta t}^{\mathrm{ext}} - F(u_{t + \alpha F \Delta t}^{i-1})^{\mathrm{int}} - C \dot u_{t+\alpha F \Delta t}^{i-1} - M \ddot u_{t+ \alpha M \Delta t}^{i-1}$$
The linear equations are used to solve for
$$u_{t+\alpha_F \Delta t}, \dot u_{t + \alpha_F \Delta t} \ddot u_{t+ \alpha M \Delta t}$$
Once convergence has been achieved the displacements, velocities and accelerations at time $t + \Delta t$ can be computed.
Compiling
The main integrator is implemented in standard C and can be compiled as either a Python extension, or Javascript library (via WASM).
Python
pip install .
Javascript
-
Install
emscripten
from here -
run
make
. This creates the following files:dist/fsdof.wasm
- Web assembly - compiled library,dist/fsdof.js
- interface to binaryfsdof.wasm
-
to test, you can use Python to start an HTTP server in the current directory as follows:
python -m http.server .
References
J. Chung, G.M.Hubert. "A Time Integration Algorithm for Structural Dynamics with Improved Numerical Dissipation: The Generalized - $\alpha$ Method" ASME Journal of Applied Mechanics, 60, 371:375, 1993.
Code Developed by: fmk
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for sdof-0.0.7-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6c825aac6e63aab25385ba9168f1d21b10baddb41ea684df384de4554bd50f1 |
|
MD5 | c2ee6e8e0be3c9caaf6693ed79ae04cf |
|
BLAKE2b-256 | f720652080a077c15cecde7f61db610ada3b34d05dbaa866748cc3e08c1a4ae5 |
Hashes for sdof-0.0.7-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44088227688e516bf6f31705d32febf5dacfce113cb3347504bd1a3ca97f034d |
|
MD5 | edeadcc5ec76dd9a2528a2f5ef714574 |
|
BLAKE2b-256 | 0922e1625a967e7201e93f6a33ed01b66daf7a29ca4af4056b39fe68af5d1f0f |
Hashes for sdof-0.0.7-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e65cbff44b02da1651e71945097c5e0d32be5144cf8f75270f8f1411101217f |
|
MD5 | 12c59650f55256b0b6e869889bb31a2c |
|
BLAKE2b-256 | aa1fddaae018f9a74b008544a05f6d7d0a22a8f8efa4b41802d3d29ea9bbba04 |
Hashes for sdof-0.0.7-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3f2d9abf93702ac1793a0a89406e97877bcf30ba755fbc6626ce73bea036c6e |
|
MD5 | b5573ca8bfd5c3a4c3b95397ae0f985b |
|
BLAKE2b-256 | 4135ff05e3fcae1843fac3dddd363615af84e5eadc0923f696ae09570744aaad |
Hashes for sdof-0.0.7-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 257370063702f62201a4d69ad4594aec12e42f4aa53c3a869f7f94f853b630b0 |
|
MD5 | 999da40a5feaca6b93bc6be085b8a405 |
|
BLAKE2b-256 | f457ec8a319db68c1262f0048856d81c77026e940503fc2923f5cbdf8cc49cd3 |
Hashes for sdof-0.0.7-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b4124f75debf00c61228abf24ef46f6d3243dd201b547b5b3ee20544b38bfad |
|
MD5 | 496184b490e2ff40b34fda6335c2944b |
|
BLAKE2b-256 | b985bdb9b791b5e87021ff468de0eae402e7568b427f819ae4891af28bdda90b |
Hashes for sdof-0.0.7-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d8d5fa239a673a4e868178fe2098b0b49f9de4e6a2d0ded0c8fbabe8a5f1bf6 |
|
MD5 | 36aa0907d3d82a0281a2247d5e14051c |
|
BLAKE2b-256 | ef07dd0d920f79a482dbfe11d5ad7383b4cc7ca4feca6b54ad03f6efa0660b52 |
Hashes for sdof-0.0.7-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 618bd68adffa0e4da2ade8eda56a79f894a56319206526ce7cb966393891d420 |
|
MD5 | 4a091a18e26537df78aa069437291fda |
|
BLAKE2b-256 | 6feba6d748ab688ead005a8f443edccca93668a784204157275dc9166b7de873 |
Hashes for sdof-0.0.7-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f99b48aece52af99a640e27b364be390fbef9d520873f60a4da114870ad12a13 |
|
MD5 | 0e49a5597c55eebd4b5ecfd99becc4b3 |
|
BLAKE2b-256 | 85a23797690fa1b30d1c735fbf74a4b5cfdf28c58dfacfa0817520008d7b1e56 |
Hashes for sdof-0.0.7-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 328ac3d8119276e0dfdaac88ae3c6c1668dff9fc5bc545d97c1c8aa082472115 |
|
MD5 | f0ecf695dda242b2c47c446152f5275e |
|
BLAKE2b-256 | 19ee7dc8919d6c2a6a07af75ff667e994c03dcd9837e91b21c8a13657343ca18 |
Hashes for sdof-0.0.7-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e71f3edcf3e526d4c7d0ed8e5c710fa5b9982eb1cdb8069d0ca92dfa25326795 |
|
MD5 | d41a7c08f41b3caeace34048a178b850 |
|
BLAKE2b-256 | 1618b1d3ad502c24c9896e963bcb452a1d372de9f55a32791e4eb06837791439 |
Hashes for sdof-0.0.7-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7d2f1577671b16c055cdb678f6ac78b2caab6712cb302e0267b5114f80f679a |
|
MD5 | 998a658f03ac22c18d9a17a02cc0d8f1 |
|
BLAKE2b-256 | a7c4094d6205ebc547dc7e505d589104a41cf9370f57d7775f5d06d0b1ca1f4f |
Hashes for sdof-0.0.7-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fbb12a484380679a0f9e528c8ea70a1897a8ee621be10255e443b9d70a9f00e |
|
MD5 | 5c3823f48a2fd8c9d76a41c7596d96d3 |
|
BLAKE2b-256 | 1a6e4665af927cd9a6c4d2357db04d5067fcf980fb2e8c97470cc0fd12b41c56 |
Hashes for sdof-0.0.7-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08c270247a7aaee28747fc123b501c4441cae17a1d65fea6704cdae933516d41 |
|
MD5 | abbd5b587a5bf3b433da887bea8cf81b |
|
BLAKE2b-256 | 952c9cedd3b321a39f39aedacc994821e8e7eb4fcfbf94480238d90d024c7e2d |
Hashes for sdof-0.0.7-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bfbf79d92693f2a225e3b6de83201564ce21a6382f35e51be3f752713bd6f2e |
|
MD5 | 40e52729e3a5d5dd27a916515777a1b7 |
|
BLAKE2b-256 | 4ac30f4cc9dd79526c50240beb596e7c50163adecd8fc85d5009a9e36e48b186 |
Hashes for sdof-0.0.7-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0877499d02391834a10508432312e16bb1e3819629f86407a1a2df0227bef3cd |
|
MD5 | 9c12a51a12bc63cf480be7afdfaa3f3f |
|
BLAKE2b-256 | f2e7b20cd9fc16f38c5c93cdb8ab81c2cf507299f6f8423a93e6a57c006afbfa |
Hashes for sdof-0.0.7-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a57f235a4909db6cf2d621879d561a708e3d01b2c54b4290691dec43822918c |
|
MD5 | 15439fb09dfea0c96406cec5ed6012fa |
|
BLAKE2b-256 | fd189e1b47ac7b5ac1c555fbf0d4d90431c4dcd5cd796dbf3030e965b8e0c299 |
Hashes for sdof-0.0.7-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 035782f44214f305d8b5ee36f928ac6984cb0aafcecec7509e9f238e1fda7dfb |
|
MD5 | 24310e8eabe1aca936eea7cb2584fa8b |
|
BLAKE2b-256 | 9a6ecf8374f39d6b73ee3a4c2885e21f1930ecfdc67d008d5c5bcb290cf6a35a |
Hashes for sdof-0.0.7-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8ad194d2e5d72887716bc9e87b3b977ffbd61fdf25c9d596913922a57b32a29 |
|
MD5 | 4f41fe5c954e430654c2e1cb49fdeffb |
|
BLAKE2b-256 | d3b214caf6c7a56fc479dc197d3812201b5b100b7161b740ee659bcfd3b784ea |
Hashes for sdof-0.0.7-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50d712f6ec51a453f50712f2a29eb07c4f0a009fd4d496312166c4e5fd4848fb |
|
MD5 | 1dd5079d7ae9e79c92f6e178357ec594 |
|
BLAKE2b-256 | ec8b53373c7b82762bf0fb333d442e4f991bb4996ae0dbe6cb138de089a5a646 |
Hashes for sdof-0.0.7-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a2602959033b5d65b5556189db2b3b8b2d33163788658391548c22992b48603 |
|
MD5 | 8954bcbc626aa389475eadb442c2a096 |
|
BLAKE2b-256 | 3de5fed33bd51f2e2aca3e82b16e997ebf9a7a239dcbfa7688702462b43acdda |
Hashes for sdof-0.0.7-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e99e305e4f248f1f340b8ad56d058b3a7a2710ab06971c3776a71090024f4828 |
|
MD5 | f3dd09a040cfb1245d32a92c67fdac0d |
|
BLAKE2b-256 | 7696d097def110d4f4b4cfc8ff16f772a22a0d469ee7dfe152f3d3be8ef7f0cf |
Hashes for sdof-0.0.7-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8531b61496ad546606eb452d333f3574f90aa77dcb955f4aeaec276912091dde |
|
MD5 | 5a05b9099184341713a0ab5f4cf2faaf |
|
BLAKE2b-256 | 3070f7a8193b8eda31c84929204d7b0f8e8eba7bf0b0bbf3b77c44d86bab3fe5 |
Hashes for sdof-0.0.7-cp37-cp37m-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b9f90a88ef220ece2606bb54626b1fa5502446e1b5516d04227ee4a549a6494 |
|
MD5 | 73b1fd5c320f91ff36b089a670bd57b2 |
|
BLAKE2b-256 | 0e42aaef56f55480c7e065d696930056118603e08576b403d5067cb631b3b940 |
Hashes for sdof-0.0.7-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2e64f8dfac5e9f78b8d1a9af05267bda1da6a48901aba68a478a977d43d36f4 |
|
MD5 | 962b352bbfa370707a2b1e29d3625c7e |
|
BLAKE2b-256 | 499130cfdd646b5721e10f9eadbaa90d8da409ceb031ce0be126d2c6a0eb1e98 |
Hashes for sdof-0.0.7-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41ce3ad7a0cf7ae6f7489ee00e0fd916328e8bd7d0b0fb038c8cda3e80c779c9 |
|
MD5 | 5a581197f9d96aa8dbadfcfdce013211 |
|
BLAKE2b-256 | 9e83cfcff118026336b73bb6476e62d3e249833b18e43225383b423c1ba32e13 |