A high-performance Python implementation of the World3 model from Limits to Growth (2004). 20x faster than PyWorld3-03.
Project description
fast_pyworld3
A high-performance Python implementation of the World3 model from "Limits to Growth: The 30-Year Update" (2004). Resolves circular dependency issues for faster simulation.
Installation
pip install fast_pyworld3
Usage
from fast_pyworld3 import World3
world3 = World3()
world3.run()
results = world3.get_results()
from fast_pyworld3.core import World3, World3Config
config = World3Config(year_max=2050, dt=0.25)
world3 = World3(config)
world3.init_constants(nri=1.5e12) # custom
world3.init_variables()
world3.set_table_functions()
world3.set_delay_functions()
world3.run()
Simulation Sectors
- Population
- Capital (Industrial/Service)
- Agriculture
- Pollution (Persistent)
- Resources (Nonrenewable)
Benchmark
20x faster than PyWorld3-03 with identical results.
| Metric | PyWorld3-03 | fast_pyworld3 |
|---|---|---|
| Mean | 1903.91 ms | 94.24 ms |
| Speedup | - | 20.20x |
Validation
| Variable | Correlation | Mean Rel Err | Max Rel Err |
|---|---|---|---|
| Total Population | 1.000000 | 0.0000% | 0.0000% |
| Industrial Output | 1.000000 | 0.0000% | 0.0000% |
| Food Per Capita | 1.000000 | 0.0000% | 0.0000% |
| Pollution Index | 1.000000 | 0.0000% | 0.0000% |
| Natural Resources | 1.000000 | 0.0000% | 0.0000% |
Time Step Scaling
| dt | Steps | PyWorld3-03 | fast_pyworld3 | Speedup |
|---|---|---|---|---|
| 1.000 | 201 | 978.25 ms | 50.67 ms | 19.31x |
| 0.500 | 401 | 1915.30 ms | 92.16 ms | 20.78x |
| 0.250 | 801 | 3840.44 ms | 190.58 ms | 20.15x |
| 0.125 | 1601 | 7794.03 ms | 381.27 ms | 20.44x |
Requirements
- Python >= 3.13
- numpy, scipy, matplotlib
License
CeCILL v2.1
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fast_pyworld3-1.0.0.tar.gz.
File metadata
- Download URL: fast_pyworld3-1.0.0.tar.gz
- Upload date:
- Size: 28.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f15d82d94dabdbce3465a722a107ca669977645b31f845bda6f063dca5bdb7a
|
|
| MD5 |
b985949a3684573d77599e55c4e67b81
|
|
| BLAKE2b-256 |
70546bd7561dd8f12913e300ec50fa070422a3e96d10c5c4b267cd8197378225
|
File details
Details for the file fast_pyworld3-1.0.0-py3-none-any.whl.
File metadata
- Download URL: fast_pyworld3-1.0.0-py3-none-any.whl
- Upload date:
- Size: 35.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25aa6cafbcc2e1d7a04d9119ccc7bf5ea31625eed882a6e15e205240d6b92486
|
|
| MD5 |
f3382c0628b0282e1175b783edc22b14
|
|
| BLAKE2b-256 |
f9050292311c756c760803ba83bd446d700e95a3a9ce8a15c029048e6a5fdc98
|