{"_id":"@claudioperez/sdof","name":"@claudioperez/sdof","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@claudioperez/sdof","version":"0.1.0","description":"A WASM-backed SDOF integrator.","main":"wasm/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["sdof"],"author":{"name":"Claudio Perez"},"license":"BSD-3-Clause","directories":{"test":"tests"},"repository":{"type":"git","url":"git+https://github.com/claudioperez/sdof.git"},"bugs":{"url":"https://github.com/claudioperez/sdof/issues"},"homepage":"https://github.com/claudioperez/sdof#readme","gitHead":"0713da2c9fd219f3fe5512d401516fc34e89b0c8","_id":"@claudioperez/sdof@0.1.0","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-c8PgkRL9hvtbU9dtsMSv6uKVneKjSZ7YnLx1BWa4yeLVycSbcnXvEmFx7/pR5fBiL5PhORtruLDa2h0o8OHzFA==","shasum":"e4556bbc7f41d65af8c7d821bdff68f29a3b8c91","tarball":"https://registry.npmjs.org/@claudioperez/sdof/-/sdof-0.1.0.tgz","fileCount":5,"unpackedSize":112054,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCkJal616yrKSQlBZ31osDe7PDW6cs8veF2sXjHU4sYwIhAKMka9bP49Opb9pjOx8iwNx8b/ihZDkVkz22j96UwoJK"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5phpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqZ1g//XlcljEodgwWVOQXYMMyFAJPPVfq/VEZzh+Za9eMHcoM9EggE\r\nV5R3AOJ1XphSZzIG10IQKG9ygWaAeKXTWF/n9ZBUhX/zisNI+84xpKZyonkL\r\n/mYDurwRjZSb9FDvkfw7j1n7IM4F3Rm7CGc+69Q7se0dYtmFHpTgT5SPSvxH\r\neYmhv3U+LmSFdSswmGWCUhly7MzJG732cahR4P5HkjbkktxIWuwEzQsRDkfS\r\nR9G4OdyNNtiMQbG7q4u6yz6ASwsuPD9RQcAsdJk3BOlu6u+yy222oHG/ZJlQ\r\ngPkk/iTT2+SeAfHYAHNOCoLXM+D6CXK9PwE0rzHXR7TWgSfV0cdDpP+vYcbR\r\n5abWtbNOVUxX9Ca0Ac3rGSXvVCnsauD0kJsbY4df+RGjFR4XLgStVcQl11N5\r\nPEqYUY3n5Qdfi3q/P4ZVXKqmfg57spJNO1dKtX6YUYMvQ1e4AcyTSNMpirVO\r\n50u5e0mdpDVdKWAZQTGh7GMA7KF9uMgfKSjifoGArzgENqzn+ElGF+6yzhRP\r\nDb2M+Uag6JIxtIaIPlmho0r4Lgdeduw3SOejwcnP25nLZznCbDTRZ7famMd/\r\nHodky9IwpZ5kczCu9wQCoC/cR8IomMPTnbX8eRaMnXng+37Mn77f/ck1Qls5\r\n3DNZ92XKtGq/eIKXqzXti21eoVbpA8253jE=\r\n=+I8+\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"claudioperez","email":"claudioperezii@outlook.com"},"maintainers":[{"name":"claudioperez","email":"claudioperezii@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdof_0.1.0_1676056681054_0.7768217882451425"},"_hasShrinkwrap":false}},"time":{"created":"2023-02-10T19:18:01.000Z","0.1.0":"2023-02-10T19:18:01.255Z","modified":"2023-02-10T19:18:01.415Z"},"maintainers":[{"name":"claudioperez","email":"claudioperezii@outlook.com"}],"description":"A WASM-backed SDOF integrator.","homepage":"https://github.com/claudioperez/sdof#readme","keywords":["sdof"],"repository":{"type":"git","url":"git+https://github.com/claudioperez/sdof.git"},"author":{"name":"Claudio Perez"},"bugs":{"url":"https://github.com/claudioperez/sdof/issues"},"license":"BSD-3-Clause","readme":"# `sdof`\n\nFast integration of single degree-of-freedom systems.\n\nThis package solves scalar problems of the form\n\n$$\nm \\ddot{u} + c \\dot{u} + k u = f(t)\n$$\n\nIntegration is carried out using the Generalized - $\\alpha$ method. This is an\nimplicit method that like the HHT method allows for high frequency energy\ndissipation and second order accuracy.\n\n<hr />\n\n## Compile\n\n### Python\n\n```\npip install .\n```\n\n### Javascript\n\n- Install `emscripten` from [here](https://emscripten.org/)\n- run `make`. This creates the following files:\n  - `dist/fsdof.wasm` - Web assembly - compiled library,\n  - `dist/fsdof.js` - interface to binary `fsdof.wasm`\n\n- to test, you can use Python to start an HTTP server in the current directory\n  as follows:\n  ```shell\n  python -m http.server .\n  ```\n\n## Python API\n\n```python\ndef peaks(m, c, k, f, dt): ...\n```\n\n## Integrator (Reproduced from OpenSees docs)\n\n<table>\n<tbody>\n<tr class=\"odd\">\n<td><p><code class=\"parameter-table-variable\">alphaM</code></p></td>\n<td><p>$\\alpha_M$ factor</p></td>\n</tr>\n<tr class=\"even\">\n<td><p><code class=\"parameter-table-variable\">alphaF</code></p></td>\n<td><p>$\\alpha_F$ factor</p></td>\n</tr>\n<tr class=\"odd\">\n<td><p><code class=\"parameter-table-variable\">gamma</code></p></td>\n<td><p>$\\gamma$ factor</p></td>\n</tr>\n<tr class=\"even\">\n<td><p><code class=\"parameter-table-variable\">beta</code></p></td>\n<td><p>$\\beta$ factor</p></td>\n</tr>\n</tbody>\n</table>\n\n<ol>\n<li>$\\alpha_F$ and\n  $\\alpha_M$ are defined differently that in the\n  paper, we use $\\alpha_F = (1-\\alpha_f)$ and\n  $\\alpha_M=(1-\\gamma_m)$ where\n  $\\alpha_f$ and $\\alpha_m$\n  are those used in the paper.</li>\n\n<li>Like Newmark and other implicit schemes, the unconditional\n  stability of this method applies to linear problems. There are no\n  results showing stability of this method over the wide range of\n  nonlinear problems that potentially exist. Experience indicates that the\n  time step for implicit schemes in nonlinear situations can be much\n  greater than those for explicit schemes.</li>\n\n<li>$\\alpha_M = 1.0, \\alpha_F = 1.0$ produces the Newmark Method.</li>\n<li>$\\alpha_M = 1.0$ corresponds to the HHT method.</li>\n<li>The method is second-order accurate provided $\\gamma = \\dfrac{1}{2} + \\alpha_M - \\alpha_F$</li>\n<li>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)$</li>\n\n<li>$\\gamma$ and $\\beta$\n  are optional. The default values ensure the method is unconditionally\n  stable, second order accurate and high frequency dissipation is\n  maximized.</li>\n</ol>\n<p>The defaults are:</p>\n<dl>\n<dt></dt>\n<dd>\n\n$$\\gamma = \\dfrac{1}{2} + \\gamma_M - \\gamma_F$$\n\n</dd>\n</dl>\n<p>and</p>\n<dl>\n<dt></dt>\n<dd>\n\n$$\\beta = \\dfrac{1}{4}(1 + \\gamma_M - \\gamma_F)^2$$\n\n</dd>\n</dl>\n\n### Theory\n\nThe generalized $\\alpha$ method is a one\nstep implicit method for solving the transient problem which attempts to\nincrease the amount of numerical damping present without degrading the order of\naccuracy. In the HHT method, the same Newmark approximations are used:\n\n<dl>\n<dt></dt>\n<dd>\n\n$$U_{t+\\Delta t} = U_t + \\Delta t \\dot U_t + [(0.5 - \\beta)\n\\Delta t^2] \\ddot U_t + [\\beta \\Delta t^2] \\ddot U_{t+\\Delta t}$$\n\n</dd>\n</dl>\n<dl>\n<dt></dt>\n<dd>\n\n$$\\dot U_{t+\\Delta t} = \\dot U_t + [(1-\\gamma)\\Delta t] \\ddot\nU_t + [\\gamma \\Delta t ] \\ddot U_{t+\\Delta t} $$\n\n</dd>\n</dl>\n<p>but the time-discrete momentum equation is modified:</p>\n\n$$R_{t + \\alpha_M \\Delta t} = F_{t+\\Delta t}^{ext} - M \\ddot\nU_{t + \\alpha_M \\Delta t} - C \\dot U_{t+\\alpha_F \\Delta t} -\nF^{int}(U_{t + \\alpha_F \\Delta t})\n$$\n\nwhere the displacements and velocities at the intermediate point are\ngiven by:\n\n$$U_{t+ \\alpha_F \\Delta t} = (1 - \\alpha_F) U_t + \\alpha_F\nU_{t + \\Delta t}$$\n\n$$\\dot U_{t+\\alpha_F \\Delta t} = (1-\\alpha_F) \\dot U_t +\n\\alpha_F \\dot U_{t + \\Delta t}$$\n\n$$\\ddot U_{t+\\alpha_M \\Delta t} = (1-\\alpha_M) \\ddot U_t +\n\\alpha_M \\ddot U_{t + \\Delta t}$$\n\n<p>Following the methods outlined for Newmarks method, linearization of\nthe nonlinear momentum equation results in the following linear\nequations:</p>\n\n$$K_{t+\\Delta t}^{*i} d U_{t+\\Delta t}^{i+1} = R_{t+\\Delta\nt}^i$$\n\n$$K_{t+\\Delta t}^{*i} = \\alpha_F K_t + \\frac{\\alpha_F\n\\gamma}{\\beta \\Delta t} C_t + \\frac{\\alpha_M}{\\beta \\Delta t^2}\nM$$\n\n<p>and</p>\n\n$$R_{t+\\Delta t}^i = F_{t + \\Delta t}^{ext} - F(U_{t + \\alpha\nF \\Delta t}^{i-1})^{int} - C \\dot U_{t+\\alpha F \\Delta t}^{i-1} - M\n\\ddot U_{t+ \\alpha M \\Delta t}^{i-1}$$\n\nThe linear equations are used to solve for \n\n$$U_{t+\\alpha_F \\Delta t}, \\dot U_{t + \\alpha_F \\Delta t} \\ddot U_{t+ \\alpha M \\Delta t}$$\n\nOnce convergence has been achieved the displacements,\nvelocities and accelerations at time $t + \\Delta t$ can be computed.\n\n## References\n\n<p>J. Chung, G.M.Hubert. \"A Time Integration Algorithm for Structural\n   Dynamics with Improved Numerical Dissipation: The\n   Generalized - $\\alpha$ Method\" ASME Journal of\n   Applied Mechanics, 60, 371:375, 1993.</p>\n\n<hr />\n\n<p>Code Developed by: <span style=\"color:blue\">fmk</span></p>\n\n","readmeFilename":"README.md"}