npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@claudioperez/sdof

v0.1.0

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 here

  • run make. This creates the following files:

    • dist/fsdof.wasm - Web assembly - compiled library,
    • dist/fsdof.js - interface to binary fsdof.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.

References