Skip to content

Commit 53f80a7

Browse files
committed
updates
1 parent 61954ee commit 53f80a7

20 files changed

+665
-149
lines changed

doc/pub/tutorial/README

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1-
This directory contains the odespy for the package.
2-
The documentation is automatically generated by ../src/odespy/make.sh.
1+
This directory contains published versions of the tutorial for the odespy
2+
package.
3+
4+
* html: sphinx version
5+
* odespy.pdf: classic LaTeX version
6+
* odespy.html: HTML bootstrap
7+
* odespy-solarized.html: HTML w/solarized colors
8+
9+
The files are automatically generated by ../src/odespy/make.sh.

doc/pub/tutorial/html/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: a74edf7a1082bd945a5d91292d4f73f8
3+
config: 12abf71e4135ce40f5edc02b03cdfd5a
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

doc/pub/tutorial/html/_sources/main_odespy.txt

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
.. Automatically generated Sphinx-extended reStructuredText file from DocOnce source
22
(https://github.com/hplgit/doconce/)
33

4-
.. !split
4+
.. Document title:
55

66
A Tutorial for the Odespy Interface to ODE Solvers
77
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
88

99
:Authors: Hans Petter Langtangen, Liwei Wang
10-
:Date: Mar 15, 2015
10+
:Date: Apr 14, 2015
1111

1212
The Odespy package makes it easy to specify an ODE problem in
1313
Python and get it solved by a wide variety of different numerical
1414
methods and software.
1515

1616
.. _ode:sec:motivation:
1717

18+
.. !split
19+
1820
Motivation
1921
==========
2022

@@ -241,6 +243,8 @@ The ODE problem can always be specified in Python, but for wrappers of
241243
FORTRAN codes one can also implement the problem in FORTRAN and avoid
242244
callback to Python.
243245

246+
.. !split
247+
244248
Installation
245249
============
246250

@@ -317,6 +321,8 @@ or downloading the source and running ``setup.py``:
317321

318322

319323

324+
.. !split
325+
320326
Basic Usage
321327
===========
322328

@@ -683,7 +689,7 @@ time integral for integration, the ``solver.solve`` method accepts
683689
a user-defined function ``terminate`` that can be used to implement
684690
a criterion for terminating the solution process.
685691
Mathematically, the relevant criterion is
686-
:math:`||u-R||<\hbox{tol}`, where tol is an acceptable
692+
:math:`||u-R|| < \hbox{tol}`, where tol is an acceptable
687693
tolerance, say :math:`100` in the present case where :math:`R=10^5`.
688694
The ``terminate`` function implements the criterion
689695
and returns true if the criterion is met:
@@ -692,7 +698,7 @@ and returns true if the criterion is met:
692698

693699
def terminate(u, t, step_no):
694700
"""u[step_no] holds (the most recent) solution at t[step_no]."""
695-
return abs(u[step_no] - R) < tol:
701+
return abs(u[step_no] - R) < tol
696702

697703
Note that the simulation is anyway stopped for :math:`t > T` so :math:`T`
698704
must be large enough for the termination criterion to be reached (if not,
@@ -724,7 +730,7 @@ A complete program can be as follows (`logistic5.py <https://github.com/hplgit/o
724730

725731
def terminate(u, t, step_no):
726732
"""u[step_no] holds (the most recent) solution at t[step_no]."""
727-
return abs(u[step_no] - R) < tol:
733+
return abs(u[step_no] - R) < tol
728734

729735
u, t = solver.solve(time_points, terminate)
730736
print 'Final u(t=%g)=%g' % (t[-1], u[-1])
@@ -1509,8 +1515,8 @@ The problem class may also feature additional methods:
15091515

15101516
The module ``odespy.problems`` contains many predefined ODE problems.
15111517

1512-
Using Adaptive Methods
1513-
----------------------
1518+
Adaptive Methods
1519+
----------------
15141520

15151521
The solvers used in the previous examples have all employed a constant
15161522
time step :math:`\Delta t`. Many solvers available through the Odespy
@@ -2314,6 +2320,8 @@ different.
23142320

23152321
The complete code is available in `sode.py <https://github.com/hplgit/odespy/blob/master/doc/src/tutorial/src-odespy/sode1.py>`__.
23162322

2323+
.. !split
2324+
23172325
Inner Workings of the Package
23182326
=============================
23192327

@@ -2762,6 +2770,8 @@ Here is an example showing the complete code of the Backward Euler method.
27622770
J = np.eye(self.neq) - dt*self.jac(ukp1, t[n+1])
27632771
return F, J
27642772

2773+
.. !split
2774+
27652775
Troubleshooting
27662776
===============
27672777

9.77 KB
Loading
2.88 KB
Loading
Lines changed: 265 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,265 @@
1+
/*
2+
* default.css_t
3+
* ~~~~~~~~~~~~~
4+
*
5+
* Sphinx stylesheet -- default theme.
6+
*
7+
* :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
8+
* :license: BSD, see LICENSE for details.
9+
*
10+
*/
11+
12+
@import url("basic.css");
13+
14+
/* -- page layout ----------------------------------------------------------- */
15+
16+
body {
17+
font-family: sans-serif;
18+
font-size: 100%;
19+
background-color: #ffffff;
20+
color: #000;
21+
margin: 0;
22+
padding: 0;
23+
}
24+
25+
div.document {
26+
background-color: #ffffff;
27+
}
28+
29+
div.documentwrapper {
30+
float: left;
31+
width: 100%;
32+
}
33+
34+
div.bodywrapper {
35+
margin: 0 0 0 230px;
36+
}
37+
38+
div.body {
39+
background-color: #ffffff;
40+
color: #000000;
41+
padding: 0 20px 30px 20px;
42+
}
43+
div.bodywrapper {
44+
margin: 0 230px 0 0;
45+
}
46+
47+
div.footer {
48+
color: #8A0808;
49+
width: 100%;
50+
padding: 9px 0 9px 0;
51+
text-align: center;
52+
font-size: 75%;
53+
}
54+
55+
div.footer a {
56+
color: #8A0808;
57+
text-decoration: underline;
58+
}
59+
60+
div.related {
61+
background-color: #666666;
62+
line-height: 30px;
63+
color: #ffffff;
64+
}
65+
66+
div.related a {
67+
color: #ffffff;
68+
}
69+
70+
div.sphinxsidebar {
71+
float: right;
72+
}
73+
74+
div.sphinxsidebar h3 {
75+
font-family: 'Trebuchet MS', sans-serif;
76+
color: #8A0808;
77+
font-size: 1.4em;
78+
font-weight: normal;
79+
margin: 0;
80+
padding: 0;
81+
}
82+
83+
div.sphinxsidebar h3 a {
84+
color: #8A0808;
85+
}
86+
87+
div.sphinxsidebar h4 {
88+
font-family: 'Trebuchet MS', sans-serif;
89+
color: #8A0808;
90+
font-size: 1.3em;
91+
font-weight: normal;
92+
margin: 5px 0 0 0;
93+
padding: 0;
94+
}
95+
96+
div.sphinxsidebar p {
97+
color: #8A0808;
98+
}
99+
100+
div.sphinxsidebar p.topless {
101+
margin: 5px 10px 10px 10px;
102+
}
103+
104+
div.sphinxsidebar ul {
105+
margin: 10px;
106+
padding: 0;
107+
color: #8A0808;
108+
}
109+
110+
div.sphinxsidebar a {
111+
color: #8A0808;
112+
}
113+
114+
div.sphinxsidebar input {
115+
border: 1px solid #8A0808;
116+
font-family: sans-serif;
117+
font-size: 1em;
118+
}
119+
120+
121+
/* for collapsible sidebar */
122+
div#sidebarbutton {
123+
background-color: #f2f2f2;
124+
}
125+
126+
127+
/* -- hyperlink styles ------------------------------------------------------ */
128+
129+
a {
130+
color: #8A0808;
131+
text-decoration: none;
132+
}
133+
134+
a:visited {
135+
color: #8A0808;
136+
text-decoration: none;
137+
}
138+
139+
a:hover {
140+
text-decoration: underline;
141+
}
142+
143+
144+
145+
/* -- body styles ----------------------------------------------------------- */
146+
147+
div.body h1,
148+
div.body h2,
149+
div.body h3,
150+
div.body h4,
151+
div.body h5,
152+
div.body h6 {
153+
font-family: 'Trebuchet MS', sans-serif;
154+
background-color: #f2f2f2;
155+
font-weight: normal;
156+
color: #8A0808;
157+
border-bottom: 1px solid #ccc;
158+
margin: 20px -20px 10px -20px;
159+
padding: 3px 0 3px 10px;
160+
}
161+
162+
div.body h1 { margin-top: 0; font-size: 200%; }
163+
div.body h2 { font-size: 160%; }
164+
div.body h3 { font-size: 140%; }
165+
div.body h4 { font-size: 120%; }
166+
div.body h5 { font-size: 110%; }
167+
div.body h6 { font-size: 100%; }
168+
169+
a.headerlink {
170+
color: #8A0808;
171+
font-size: 0.8em;
172+
padding: 0 4px 0 4px;
173+
text-decoration: none;
174+
}
175+
176+
a.headerlink:hover {
177+
background-color: #8A0808;
178+
color: white;
179+
}
180+
181+
div.body p, div.body dd, div.body li {
182+
text-align: justify;
183+
line-height: 130%;
184+
}
185+
186+
div.admonition p.admonition-title + p {
187+
display: inline;
188+
}
189+
190+
div.admonition p {
191+
margin-bottom: 5px;
192+
}
193+
194+
div.admonition pre {
195+
margin-bottom: 5px;
196+
}
197+
198+
div.admonition ul, div.admonition ol {
199+
margin-bottom: 5px;
200+
}
201+
202+
div.note {
203+
background-color: #eee;
204+
border: 1px solid #ccc;
205+
}
206+
207+
div.seealso {
208+
background-color: #ffc;
209+
border: 1px solid #ff6;
210+
}
211+
212+
div.topic {
213+
background-color: #eee;
214+
}
215+
216+
div.warning {
217+
background-color: #ffe4e4;
218+
border: 1px solid #f66;
219+
}
220+
221+
p.admonition-title {
222+
display: inline;
223+
}
224+
225+
p.admonition-title:after {
226+
content: ":";
227+
}
228+
229+
pre {
230+
padding: 5px;
231+
background-color: #f2f2f2;
232+
color: #333333;
233+
line-height: 120%;
234+
border: 1px solid #ac9;
235+
border-left: none;
236+
border-right: none;
237+
}
238+
239+
tt {
240+
background-color: #ecf0f3;
241+
padding: 0 1px 0 1px;
242+
font-size: 0.95em;
243+
}
244+
245+
th {
246+
background-color: #ede;
247+
}
248+
249+
.warning tt {
250+
background: #efc2c2;
251+
}
252+
253+
.note tt {
254+
background: #d6d6d6;
255+
}
256+
257+
.viewcode-back {
258+
font-family: sans-serif;
259+
}
260+
261+
div.viewcode-block:target {
262+
background-color: #f4debf;
263+
border-top: 1px solid #ac9;
264+
border-bottom: 1px solid #ac9;
265+
}

0 commit comments

Comments
 (0)