Skip to content

Write project structure section #134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 35 additions & 5 deletions docs/structure/index.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,43 @@
Project Structure
================================================================================
=================

TODO
The ODE Test Problems API resides under the ``otp`` namespace. At the top level of this namespace, there are three
classes that serve as the foundation for all problem implementations:

.. toctree::
:caption: Top-Level Classes
:maxdepth: 1
:glob:

problem
rhs
parameters

Each problem in OTP defines a sub-namespace of ``otp`` with a standard structure:

::

otp.<problemname>
├─ <ProblemName>Problem.m
├─ <ProblemName>Parameters.m
└─ presets
├─ Canonical.m
├─ <PresetName>.m
├─ <AnotherPresetName>.m
└─ ...

This allows a problem to be manually instantiated with

>>> timeSpan = ...
>>> y0 = ...
>>> parameters = otp.<problemname>.<ProblemName>Parameters('<Param1>', value1, ...);
>>> problem = otp.<problemname>.<ProblemName>Problem(timeSpan, y0, parameters);

In most cases, it is easier to use a preset instead. A preset is a subclass of ``<ProblemName>Problem.m`` which
specifies values for the problem time span, initial conditions, and parameters, typically using values proposed in the
literature. Every problem has a preset named ``Canonical`` which can be constructed with

>>> problem = otp.<problemname>.presets.Canonical;

Constructors for presets can be called without arguments like the code above, but many presets also accept optional
name-value pairs to override default values. Regardless, parameters can always be modified after instantiating a
problem:

>>> problem.Parameters.<Param1> = 1234;