v/examples/pendulum-simulation
2025-02-03 12:37:57 +02:00
..
modules/sim fmt: fix formating a file in an oscillating manner (fix #22223, fix #22026) (#22232) 2024-09-17 09:47:38 +03:00
.gitignore
animation.v log: add log.use_stdout(), use it to silence the transition note for the most commonly used V tools/examples (#23642) 2025-02-03 12:37:57 +02:00
full.v fmt: fix alignment of struct init fields (#22025) 2024-08-11 09:11:24 +03:00
LICENSE all: update copyright year (#20334) 2024-01-01 23:29:54 +02:00
parallel.v fmt: fix alignment of struct init fields (#22025) 2024-08-11 09:11:24 +03:00
parallel_with_iw.v fmt: fix alignment of struct init fields (#22025) 2024-08-11 09:11:24 +03:00
README.md
sequential.v all: change optional to result of io (#16075) 2022-10-16 09:28:57 +03:00

Pendulum Simulation in V

You can see the origin implementation among with some benchmarks at ulises-jeremias/v-pendulum-simulation.

vlang.io | Docs | Contributing

Build Status Docs Validation License: MIT

Run the Simulations

Sequential Simulation

$ v -gc boehm -prod sequential.v
$ ./sequential # execute ./sequential -h for more info

Parallel Simulation

$ v -gc boehm -prod parallel.v
$ ./parallel # execute ./parallel -h for more info

image

Parallel Simulation with Image Worker

$ v -gc boehm -prod parallel_with_iw.v
$ ./parallel_with_iw # execute ./parallel_with_iw -h for more info

image

Parallel Simulation with Graphic User Interface

$ v -gc boehm -prod animation.v
$ ./animation # execute ./animation -h for more info

Full Parallel Simulation with Graphic User Interface and Image Output

$ v -gc boehm -prod full.v
$ ./full # execute ./full -h for more info

Testing

To test the module, just type the following command:

$ v test .

Benchmark

Check the original repository for tools to run benchmark tests. In there you can execute the following command to execute benchmark tests to get a full comparison between implementations:

$ ./bin/run-benchmark-test --help

image