Adding a problem implementation#
First off: thank you for considering a contribution to diffeqzoo’s problem test set.
Your example will be a valuable addition!
Here is how to proceed:
Add a test-case to
tests/test_bvps.pyortests/test_ivps.py. This is important, because we need to verify that implementations work. You can use the existing test-cases as a guideline.Implement the ODE vector field in
diffeqzoo/_vector_fields.py. Implementing the vector field separately from the IVP/BVP constructor has the advantage that some vector fields may be used for multiple problems. For example, the SIR vector field powers bothivps.sirandbvps.measles.Implement the IVP/BVP constructore in
diffeqzoo/ivps.pyordiffeqzoo/bvps.py. Again, use the existing code as a reference.Add a short docstring that describes the problem, why it is interesting, and who came up with it (if possible). It would be great if you could add a bibtex snippet that points to the original paper, just like in the existing problems. The better the docs, the more useful the function will be to end-users, but if something is hard to find, don’t sweat it too much.
Check that everything passes the quality checks via
make format test lint.Make a pull request with your changes.