Skip to main content

CI-cpp CI-fenics github pages PyPI version coverage

goss - General ODE System Solver

goss is python wrapper around a C++ library for solving ordinary differential equations with a variety of different schemes.

Documentation is hosted at https://computationalphysiology.github.io/goss Source code is found at https://github.com/ComputationalPhysiology/goss

Motivation

The general idea is that you define your ODE in a gotran ode file and hand the ode over to goss.

First define the ode in a gotran ODE file

# lorentz.ode
parameters(
sigma=10.0,
rho=28.0,
beta=8/3
)

# The values of the states represent the initial conditions
states(
x=0.0,
y=1.0,
z=1.05
)

dx_dt = sigma * (y - x)
dy_dt = x * (rho - z) - y
dz_dt = x * y - beta * z

You can now solve the ode as follows

import numpy as np
import matplotlib.pyplot as plt
from gotran import load_ode
import goss

# Import the ode in gotran
lorentz = load_ode("lorentz.ode")
# Jit compile the code for the right hand side
ode = goss.ParameterizedODE(lorentz)
# Select a solver and instantiate the solver
solver = goss.solvers.RKF32(ode)
# Select the time steps you want to solve for
t = np.linspace(0, 100, 10001)
# Solve the system
u = solver.solve(t)

# Plot the solution
fig = plt.figure()
ax = fig.add_subplot(projection="3d")

ax.plot(u[:, 0], u[:, 1], u[:, 2], lw=0.5)
ax.set_xlabel("X Axis")
ax.set_ylabel("Y Axis")
ax.set_zlabel("Z Axis")
ax.set_title("Lorenz Attractor")
plt.show()

_

For more examples, check out the demo folder

There is also a command line interface that can be used to list the available solvers, run the solver and generate the goss code

_

Install

You can install goss with pip

python -m pip install pygoss

See installation instructions for more options

Known issues

  • There is currently an issue on Apple Silicon with exceptions raised from by the jit compiled code which means the one test is not passing. An issue has been filed for this here

Contributing

Contributions are very welcomed. To contribute please fork the repo, create a branch a submit a pull request. Before the pull request can be accepted it has to pass the test suit for the python and C++ code. Also note that we try to enforce an consistent coding style. To ensure that you follow the coding style you can install the pre-commit hook in the repo

python -m pip install pre-commit
pre-commit install

For every future commit, you will now run a set of tests that will make sure that you follow the coding style.

See the contributing section for more info.

License

goss is licensed under the GNU LGPL, version 3 or (at your option) any later version.

Metadata

Release files for pygoss 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pygoss 0.4.2
File Size Uploaded
pygoss-0.4.2.tar.gz 14.2 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for pygoss 0.4.2
File
pygoss-0.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
pygoss-0.4.2-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details
pygoss-0.4.2-cp311-cp311-macosx_10_9_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.9+ x86-64 Details
pygoss-0.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
pygoss-0.4.2-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details
pygoss-0.4.2-cp310-cp310-macosx_10_9_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.9+ x86-64 Details
pygoss-0.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
pygoss-0.4.2-cp39-cp39-macosx_11_0_arm64.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64 Details
pygoss-0.4.2-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details
pygoss-0.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details
pygoss-0.4.2-cp38-cp38-macosx_11_0_arm64.whl CPython 3.8 CPython 3.8 macOS 11.0+ ARM64 Details
pygoss-0.4.2-cp38-cp38-macosx_10_9_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.9+ x86-64 Details
pygoss-0.4.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64 Details
pygoss-0.4.2-cp37-cp37m-macosx_10_9_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64 Details

Total release size: 19.8 MB

Release files / pygoss-0.4.2.tar.gz

Download URL pygoss-0.4.2.tar.gz
Size 14.2 MB
Tags Source
SHA-256 checksum
How to use checksums
128fac03baf2ffd85728b89c49f8f2e68f5bade86a591550c471290e861c001a
BLAKE2b-256 checksum
How to use checksums
d37ace40def87b6934ce78e5cd566868d1da6bdab50b03fdc679eaf192f96f40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / pygoss-0.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pygoss-0.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 378.7 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
7d1fee407babb5e94bf29f427227668d6014b8de8e4e7b363453da9ad7371779
BLAKE2b-256 checksum
How to use checksums
08f79a821e62d8788f03e8f87a72c83ef84543ae75d76d5e6f204d9eb415dd69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / pygoss-0.4.2-cp311-cp311-macosx_11_0_arm64.whl

Download URL pygoss-0.4.2-cp311-cp311-macosx_11_0_arm64.whl
Size 242.6 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c7ce7817cbff2a2d9ddba5080de709054c74eb289300c060c6b83d11051375e3
BLAKE2b-256 checksum
How to use checksums
3db074edf514516ae3ab354090ffb3969f74fa57ebe5f3bf6178f05725613cb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / pygoss-0.4.2-cp311-cp311-macosx_10_9_x86_64.whl

Download URL pygoss-0.4.2-cp311-cp311-macosx_10_9_x86_64.whl
Size 535.7 kB
Tags CPython 3.11 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
30e0025c3a18aeb35671a901ff31269606cd3124c66edcf3a3e3a2c87895f07a
BLAKE2b-256 checksum
How to use checksums
d6fee1b0575dca2b0f6a75b131a87b70dfe6b65fa89a4bc2f4775d24f51ceda6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / pygoss-0.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pygoss-0.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 378.6 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
f8f40aed3a6dee1e967b2aa2098ee9c455da0e8d6f5a71c2f6f19719f170950d
BLAKE2b-256 checksum
How to use checksums
473c5dd5e72064c9045b10efaa71e92bb441748c445dd92af268532ca64fe2b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / pygoss-0.4.2-cp310-cp310-macosx_11_0_arm64.whl

Download URL pygoss-0.4.2-cp310-cp310-macosx_11_0_arm64.whl
Size 242.6 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0f93941107968329db3ee702625d94a1846fb4cbc1bb2daf84660337f0b661b9
BLAKE2b-256 checksum
How to use checksums
0c3fdcda4c376dffddd7f75f04ea229d1b12e50cf46aa1862b602dafce256844
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / pygoss-0.4.2-cp310-cp310-macosx_10_9_x86_64.whl

Download URL pygoss-0.4.2-cp310-cp310-macosx_10_9_x86_64.whl
Size 535.7 kB
Tags CPython 3.10 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
de1482abc9bb4957b8b9ce94b3267c05783b19dbbb15a7a291364ebf9627c1c9
BLAKE2b-256 checksum
How to use checksums
bf09619f192d0c81db932f86967a5c7d812d5a222a9a14b7eeffaa25b3effd49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / pygoss-0.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pygoss-0.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 379.7 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
50e110ca5c459feaa522abd54d4f796ae0a63f4c919ab13da44cd58d6f5c0596
BLAKE2b-256 checksum
How to use checksums
f914e6a326d7a82a26f5e82e9a81f3445fe8cb83fa098f60dac2a9e8be703608
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / pygoss-0.4.2-cp39-cp39-macosx_11_0_arm64.whl

Download URL pygoss-0.4.2-cp39-cp39-macosx_11_0_arm64.whl
Size 242.8 kB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
2ff00fe598ece060c93f64d7d5d76794322a9fb196dbca29b8a5694cca1b1f9c
BLAKE2b-256 checksum
How to use checksums
5ed6a60afe65a5e6805193cfcbbfc60f4e303e1901a6bed382ad3491f97347a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / pygoss-0.4.2-cp39-cp39-macosx_10_9_x86_64.whl

Download URL pygoss-0.4.2-cp39-cp39-macosx_10_9_x86_64.whl
Size 535.8 kB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
e83f08a80dc99729b58b7a961994ed6d3c930845df72e3cfb105c28c1e17d223
BLAKE2b-256 checksum
How to use checksums
24280ecb600ed0b46b8a9e259a62597ebc59d262b33f80f4eff6c0ba122b8f84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / pygoss-0.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pygoss-0.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 379.1 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
eabc65f756655165b06dc0cab12f601eb1371b310e6f9ad0a95d5fec1bea6bff
BLAKE2b-256 checksum
How to use checksums
36ba1de85f0476b1a672bc31d47a1be55af79364896797c9e05a3088abe85587
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / pygoss-0.4.2-cp38-cp38-macosx_11_0_arm64.whl

Download URL pygoss-0.4.2-cp38-cp38-macosx_11_0_arm64.whl
Size 242.5 kB
Tags CPython 3.8 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1ddca336f87e976a352eb3257112124e38b9f8faa45a9388e02e8654b6d5bc99
BLAKE2b-256 checksum
How to use checksums
0870c8225fd073e0f35223f8346347c0fc1361f32bc761db956d0fac967f6f16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / pygoss-0.4.2-cp38-cp38-macosx_10_9_x86_64.whl

Download URL pygoss-0.4.2-cp38-cp38-macosx_10_9_x86_64.whl
Size 535.4 kB
Tags CPython 3.8 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
18e91837571797342c7ad8dda16bd50d03dbfb0306878b92c51e3a7465990a85
BLAKE2b-256 checksum
How to use checksums
ac2caa55ae49baf42189d422b6a58752854041cd6e375a824315fc24e7264b3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / pygoss-0.4.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pygoss-0.4.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 383.8 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
6c6a7ce5dd7bcfce8c7de1db2611fa2a0d43caa226700e068c1db753ddffc8f4
BLAKE2b-256 checksum
How to use checksums
7ed1b6edad53a6da5bd16890018b1a8cb0591e0806c56f6e832301a74e7fb6d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / pygoss-0.4.2-cp37-cp37m-macosx_10_9_x86_64.whl

Download URL pygoss-0.4.2-cp37-cp37m-macosx_10_9_x86_64.whl
Size 530.8 kB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
2fbdbff3043b5f317abfdb86536bfcdf64699472b378bf173d875d60f2834e9d
BLAKE2b-256 checksum
How to use checksums
5f7b8c6a2becae7da6e1d5d0eaaa2cf7066f302ebdee2df5574f940642317146
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.4.2 This release

15 release files

0.4.1

15 release files

0.4.0

15 release files

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.5

1 release file

0.1.4

9 release files

0.1.3

9 release files

0.1.2

9 release files

0.1.1

7 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page