Skip to content

Conversation

clinssen
Copy link
Contributor

@clinssen clinssen commented Oct 6, 2025

The current ODE-toolbox release detects conditions under which singularities can occur. This PR adds a feature that allows ODE-toolbox to generate separate solvers for each of these conditions.

The new condition format looks like this (for instance, for a parameter $p$ in the inhomogeneous part):

{
    "solver": "analytical",
    "state_variables": [
        "z"
    ],
    "initial_values": {
        "z": "1"
    },
    "condition": {
        "p==0": {
            "propagators": {
                "__P__z__z": "[...]"
            },
            "update_expressions": {
                "z": "[...]"
            }
        },
        "otherwise": {
            "propagators": {
                "__P__z__z": "[...]"
            },
            "update_expressions": {
                "z": "[...]"
            }
        }
    }
}

Replaces #89.

Split off testing requirements into a separate requirements-testing.txt.

Sadly, the old 1.10.1 sympy version gets stuck on test_analytic_solver_integration.py and introduces numerical errors, so I've set the test to skip for older versions and added a line into the documentation.

N.B. after merging this, the version number of ODE-toolbox should be bumped to 3.0.0, as this feature changes the external API.

@clinssen clinssen marked this pull request as draft October 6, 2025 11:40
@clinssen clinssen force-pushed the conditional-propagators branch from 827de32 to bd883ac Compare October 16, 2025 22:11
@clinssen clinssen added this to the v3.0.0 milestone Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant