sdof
v0.1.1
Published
A WASM-backed SDOF integrator.
Downloads
2
Readme
sdof
Fast integration of single degree-of-freedom systems.
This package solves scalar problems of the form
$$ m \ddot{u} + c \dot{u} + k u = f(t) $$
Integration is carried out using the Generalized - $\alpha$ method. This is an implicit method that like the HHT method allows for high frequency energy dissipation and second order accuracy.
Compile
Python
pip install .
Javascript
Install
emscripten
from hererun
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 .
Python API
def peaks(m, c, k, f, dt): ...
Integrator (Reproduced from OpenSees docs)
$$\gamma = \dfrac{1}{2} + \gamma_M - \gamma_F$$
$$\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} $$
$$R_{t + \alpha_M \Delta t} = F_{t+\Delta t}^{ext} - M \ddot U_{t + \alpha_M \Delta t} - C \dot U_{t+\alpha_F \Delta t} - F^{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}$$
$$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 + \frac{\alpha_F \gamma}{\beta \Delta t} C_t + \frac{\alpha_M}{\beta \Delta t^2} M$$
$$R_{t+\Delta t}^i = F_{t + \Delta t}^{ext} - F(U_{t + \alpha F \Delta t}^{i-1})^{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.