Gathering detailed insights and metrics for pde-engine
Gathering detailed insights and metrics for pde-engine
Gathering detailed insights and metrics for pde-engine
Gathering detailed insights and metrics for pde-engine
A nodejs module for server side or browser computation of heat and wave equation.
npm install pde-engine
Typescript
Module System
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
33 Stars
23 Commits
2 Forks
2 Watchers
2 Branches
1 Contributors
Updated on Jan 10, 2025
Latest Version
0.4.0
Package Id
pde-engine@0.4.0
Size
4.70 kB
NPM Version
1.2.32
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
4
A simple solver of the heat/diffusion equation and wave equation meant for driving visualizations not for performing exacting scientific analysis. The forward Euler step is employed for simplicity and speed, as well as further simplifying the discrete equations with the convolution operator.
It solves the pde on an nxm square grid with n and m being defined by the setResolution
method.
1io = require('socket.io').listen(6543) 2engine = require('pdeEngine') 3field = engine( { 4 dt: 0.1 5 , gamma: 0.02 6 , eqn: "wave" 7 }) 8field.setResolution(80, 100) 9 10io.sockets.on('connection', function (socket) { 11 12 socket.on('addSource', function(data) { 13 field.addSource(data.row, data.col, mag) 14 }) 15 16}) 17 18setInterval( function () { 19 20 var coeffs = field.update( { 21 dt: 0.1 22 , eqn: "diffusion" 23 , alpha: 0.5 24 }) 25 26 // Render coeffs // 27 28} , 50 )
Of course you can employ any means of adding sources.
The addSource
method specifies the location of the source at that particular timestep with magnitude mag
. Right now it emplaces a hard-coded Gaussian source centred at (row, col)
, with boundary cases already implemented.
The following are possible configuration options. If configs are omitted defaults will be used. The defaults are given after the ||
:
1{ 2 dt = spec.dt || 0.1 3 , dx = spec.dx || 1 4 , gamma = spec.gamma || 0.02 // wave decay factor 5 , vel = spec.vel || 2 // wave velocity 6 , alpha = spec.alpha || 1 // diffusion paramter 7 , eqn = spec.eqn || 'wave' 8}
This is an early but fully working physics engine. Future releases may optimize algorithms or add new methods/configs, but this basic API should remain stable.
Tests will be coming I have them already for my own purposes. Just need to refactor and include.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/23 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More