Skip to content

Commit 4b4a85b

Browse files
Write project structure section
1 parent 5b943b3 commit 4b4a85b

File tree

1 file changed

+35
-5
lines changed

1 file changed

+35
-5
lines changed

docs/structure/index.rst

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,43 @@
11
Project Structure
2-
================================================================================
2+
=================
33

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

67
.. toctree::
7-
:caption: Top-Level Classes
8-
:maxdepth: 1
9-
:glob:
108

119
problem
1210
rhs
1311
parameters
12+
13+
Each problem in OTP defines a sub-namespace of ``otp`` with a standard structure:
14+
15+
::
16+
17+
otp.<problemname>
18+
├─ <ProblemName>Problem.m
19+
├─ <ProblemName>Parameters.m
20+
└─ presets
21+
├─ Canonical.m
22+
├─ <PresetName>.m
23+
├─ <AnotherPresetName>.m
24+
└─ ...
25+
26+
This allows a problem to be manually instantiated with
27+
28+
>>> timeSpan = ...
29+
>>> y0 = ...
30+
>>> parameters = otp.<problemname>.<ProblemName>Parameters('<Param1>', value1, ...);
31+
>>> problem = otp.<problemname>.<ProblemName>Problem(timeSpan, y0, parameters);
32+
33+
In most cases, it is easier to use a preset instead. A preset is a subclass of ``<ProblemName>Problem.m`` which
34+
specifies values for the problem time span, initial conditions, and parameters, typically using values proposed in the
35+
literature. Every problem has a preset named ``Canonical`` which can be constructed with
36+
37+
>>> problem = otp.<problemname>.presets.Canonical;
38+
39+
Constructors for presets can be called without arguments like the code above, but many presets also accept optional
40+
name-value pairs to override default values. Regardless, parameters can always be modified after instantiating a
41+
problem:
42+
43+
>>> problem.Parameters.<Param1> = 1234;

0 commit comments

Comments
 (0)