https://github.com/llllvvuu/standing-waves
generate adjacency matrix, visualize spectral decomposition of Laplacian, decompose arbitrary wave state with matching pursuit
https://github.com/llllvvuu/standing-waves
Last synced: 5 days ago
JSON representation
generate adjacency matrix, visualize spectral decomposition of Laplacian, decompose arbitrary wave state with matching pursuit
- Host: GitHub
- URL: https://github.com/llllvvuu/standing-waves
- Owner: llllvvuu
- Created: 2023-08-01T19:07:29.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-03T13:12:15.000Z (almost 2 years ago)
- Last Synced: 2025-01-15T22:25:23.841Z (5 months ago)
- Language: C++
- Homepage: https://llllvvuu.dev/standing-waves/
- Size: 124 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Standing Waves
This is a CLI and a library for generating standing waves, with presets for hexagonal grid and rectangular grid graphs. HTML5 visualization is under `docs/`, and a copy is hosted at [https://llllvvuu.dev/standing-waves/](https://llllvvuu.dev/standing-waves/).
It also has a library, `matching_pursuit` which was generated by GPT-4. I have no idea whether it's correct, but it seems to work well enough for my demo app.
## Build/Test/Run
Requirements: [`g++-13`](https://gcc.gnu.org/), [`cmake`](https://cmake.org/), and [`vcpkg`](https://vcpkg.io/en/) in `$PATH`.
```sh
git submodule update --init --recursive
vcpkg install gtest
sh build.sh Release
./Release/test/runTests
./Release/src/standing_waves_cli hex 8 10 12 100
./Release/src/standing_waves_cli rect 10 10 100
```For WASM (requires [`em++`](https://emscripten.org/index.html) and [`node`](https://nodejs.org/en) in `$PATH`):
```sh
sh build.sh Release WASM
node ./Release-WASM/test/runTests.js
node ./Release-WASM/src/standing_waves_cli.js
```## Fix for `clangd` LSP `'emscripten/bind.h' file not found`
```sh
sh dotclangd.sh
```## Build: HTML5 Visualization
```sh
cd docs
npm install
npm run build # or npm run watch
```## TODO
For the rectangular case (and probably also for some other cases, although I haven't tried yet), there is a very simple closed form:
```
a sin(πnx)sin(πmy) + b sin(πmx)sin(πny)
```
The `a, b, m, n` parameterization should make it much easier to:
- choose superpositions that "go well" together
- render at a much higher resolutionI also want to render some dual graphs i.e. have edges lighting up.