1c822d5Add modal-series and fd-second-order submissions for string-pluck-v1, with results workflowJeremy Magland 1# Solutions to the string challenges
8f29519Export displacement fields for the chain tops, add this repository's own site with a field viewer, and leave the comparison to the challenge repositoryJeremy Magland 3This repository holds solutions to the challenges defined in [challenges/string](https://vault1.magland.org/challenges/string). It is one of possibly several solution repositories registered with that challenge repository, which clones each of them, compares every solution against a common reference, and publishes the comparison at [challenges/string/site](https://vault1.magland.org/challenges/string/site/). This repository's own site, at [challenges/string-solutions/site](https://vault1.magland.org/challenges/string-solutions/site/), lists its submissions with audio players and animates the exported displacement fields.
1c822d5Add modal-series and fd-second-order submissions for string-pluck-v1, with results workflowJeremy Magland 4
5## Layout
7```
8solutions/<challenge-id>/<submission-id>.json one submission: metadata and one or more solutions
8f29519Export displacement fields for the chain tops, add this repository's own site with a field viewer, and leave the comparison to the challenge repositoryJeremy Magland 9solutions/<challenge-id>/<submission-id>/*.wav the scored output files, referenced from the JSON
10solutions/<challenge-id>/<submission-id>/*.h5 optional displacement fields for visualization
11solvers/ source code of the submissions
12web/ this repository's site (built by web/build.py)
1c822d5Add modal-series and fd-second-order submissions for string-pluck-v1, with results workflowJeremy Magland 13```
8f29519Export displacement fields for the chain tops, add this repository's own site with a field viewer, and leave the comparison to the challenge repositoryJeremy Magland 15## Adding a submission to this repository
1c822d5Add modal-series and fd-second-order submissions for string-pluck-v1, with results workflowJeremy Magland 16
8f29519Export displacement fields for the chain tops, add this repository's own site with a field viewer, and leave the comparison to the challenge repositoryJeremy Magland 171. Read the challenge specification, for example [string-pluck-v1](https://vault1.magland.org/challenges/string/blob/main/challenges/string-pluck-v1/README.md), and produce the output exactly as specified.
182. Choose a submission ID (lowercase letters, digits, hyphens) and write `solutions/<challenge-id>/<submission-id>.json` following the [schema](https://vault1.magland.org/challenges/string/blob/main/schema/solution.schema.json). The existing files are complete examples.
193. Put the wav files (and optional field exports) in `solutions/<challenge-id>/<submission-id>/`. Files over 1 MiB must be pushed with git rather than written through the web interface.
204. If the submission contains several solutions of known relative accuracy, record that in `more_accurate_than`; this is what lets the reference be chosen automatically.
215. Open a pull request. The workflow validates the files and, on `main`, rebuilds this site. The comparison on the challenge repository's site is rebuilt when that repository's workflow next runs (on a push there, or by dispatching it).
1c822d5Add modal-series and fd-second-order submissions for string-pluck-v1, with results workflowJeremy Magland 22
23Timing is self-reported wall-clock time for producing the output signal, excluding file I/O, on the hardware named in the `hardware` field.
8f29519Export displacement fields for the chain tops, add this repository's own site with a field viewer, and leave the comparison to the challenge repositoryJeremy Magland 25## Starting a solution repository of your own
27Any public repository with the same `solutions/` layout can be registered by a pull request to the challenge repository adding one entry to `registry/solution-repos.json`. What else the repository contains, including its own visualizations, is up to its authors.
1c822d5Add modal-series and fd-second-order submissions for string-pluck-v1, with results workflowJeremy Magland 29## Validating locally
31```
32pip install git+https://vault1.magland.org/challenges/string
33challenge-tools validate --challenges <path-to-string-repo>/challenges --solutions solutions
8f29519Export displacement fields for the chain tops, add this repository's own site with a field viewer, and leave the comparison to the challenge repositoryJeremy Magland 34python web/build.py --out site
1c822d5Add modal-series and fd-second-order submissions for string-pluck-v1, with results workflowJeremy Magland 35```
8f29519Export displacement fields for the chain tops, add this repository's own site with a field viewer, and leave the comparison to the challenge repositoryJeremy Magland 36
37## Regenerating the example submissions
39```
40python solvers/modal/modal_string.py <string-repo>/challenges/string-pluck-v1/challenge.json solutions/string-pluck-v1/modal-series --fields 1024 4 8 16 32 64 256 1024
41python solvers/fd/fd_string.py <string-repo>/challenges/string-pluck-v1/challenge.json solutions/string-pluck-v1/fd-second-order --fields 16 1 2 4 8 16
42```
44Each solver prints per-solution metadata as JSON, from which the submission files are assembled.