Skip to content

Commit

Permalink
Add build script for linux/mac. Add info to the readme to describe us…
Browse files Browse the repository at this point in the history
…ing conda. Fix formatting issues with readme.
  • Loading branch information
rothnic committed May 7, 2015
1 parent e421141 commit 98bf292
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 17 deletions.
58 changes: 41 additions & 17 deletions README.md
Expand Up @@ -63,6 +63,29 @@ else:
pass
```

#### Install Pre-compiled Version with Conda
If you are using [Anaconda](https://store.continuum.io/cshop/anaconda/) or Miniconda and a build has been published for your system, then you can install a pre-compiled version of odespy. Install using conda with the following command:

```
conda install -c https://conda.binstar.org/rothnic odespy
```

If a pre-compiled package is not available for your system, and you go through the effort of installing the compilation tools, you can build and upload a conda package as follows from the command line:

```
# Set environment variable in windows to build for python 2
# Use 34 instead of 27, to compile for python 3
set CONDA_PY=27
# Build the package
conda build odespy
# Upload the package
binstar upload <PATH to the build file>\odespy-<version>-<dependency versions>.tar.bz2
```

Note: You may have to add/modify the conda build scripts to support your platform type. This has only been tested for Windows currently.

### Contents of Odespy

Odespy features the following collection of numerical methods and
Expand Down Expand Up @@ -98,7 +121,7 @@ The ODE problem can always be specified in Python, but for wrappers of
FORTRAN codes one can also implement the problem in FORTRAN and avoid
callback to Python.

*Warning: Potential problems with FORTRAN codes.*
*Warning: Potential problems with FORTRAN codes.*
Some users have faced problems with some of the FORTRAN-based solvers
(typically segmentation fault errors), mostly `radau5`, but also `rkf45`.
It seems that Odespy's Python interface to `radau5` is broken.
Expand All @@ -109,21 +132,23 @@ It seems that Odespy's Python interface to `radau5` is broken.

Here is an example on the Odespy syntax::

def f(u, t):
"""2x2 system for a van der Pool oscillator."""
return [u[1], 3.*(1. - u[0]*u[0])*u[1] - u[0]]

import odespy, numpy
solver = odespy.Vode(f, rtol=0.0, atol=1e-6,
adams_or_bdf='adams', order=10)
solver.set_initial_condition([2.0, 0.0])
t_points = numpy.linspace(0, 30, 150)
u, t = solver.solve(t_points)

u0 = u[:,0]
from matplotlib.pyplot import *
plot(t, u0)
show()
```
def f(u, t):
"""2x2 system for a van der Pool oscillator."""
return [u[1], 3.*(1. - u[0]*u[0])*u[1] - u[0]]
import odespy, numpy
solver = odespy.Vode(f, rtol=0.0, atol=1e-6,
adams_or_bdf='adams', order=10)
solver.set_initial_condition([2.0, 0.0])
t_points = numpy.linspace(0, 30, 150)
u, t = solver.solve(t_points)
u0 = u[:,0]
from matplotlib.pyplot import *
plot(t, u0)
show()
```

An incomplete [tutorial](http://hplgit.github.io/odespy/doc/tutorial/html/index.html) is under
development and explains much more of the syntax and provides many
Expand Down Expand Up @@ -167,4 +192,3 @@ BibTeX entry:
note: \url{https://github.com/hplgit/odespy}
entrytype: misc
```

1 change: 1 addition & 0 deletions build.sh
@@ -0,0 +1 @@
python setup.py build

0 comments on commit 98bf292

Please sign in to comment.