Python Numpy Spicy and Odespy

HPC clusters: Vilje and Kongull

Scipy and Numpy are part of the Python module on Vilje and Kongull. Odespy is not impemented yet. How to load the Python module:

Available modules: 
$ module avail
Default versions: Vilje 2.7.2, Kongull 2.7.1
$ module load python

Vilje -----------------------------: 
Python v.2.7.3:
$ module load intelcomp/13.0.1
$ module load mpt/2.06
$ module load python/2.7.3
Python v.2.7.6:
$ module load intelcomp/14.0.1
$ module load mpt/2.09
$ module load python/2.7.6

Kongull ---------------------------:
Python 2.7.3
$ module load python/2.7.3
Python 2.7.6
$ module load intelcomp/13.0.1
$ module load openmpi/1.6.5
$ module load python/2.7.6-intel


Scipy, Numpy and Odespy are implemented in Python on the CalcFarm.

1.Start Remote Desktop Connection on your Laptop/PC/Smartphone/Tablet.

a. Windows: Remote Desktop Connection

b. Android App: “RD Client”

c. iPhone/iPad App: “Microsoft Remote Desktop”

d. Linux: eg. “Remmina Remote Desktop Client”

2. Login: Computer:, Username: win-ntnu-no\my-ntnu-username and Ntnu-password. For Linux: Domene: win-ntnu-no, Username: my-ntnu-username.

3. Click on Connect.

4. Click on “Startmeny” in the CalcFarm desktop.

5. Use one of the Python Apps: IPython (Qt), IPython (sh) or Python interpreter


NumPy is the fundamental package for scientific computing with Python (

SciPy (pronounced “Sigh Pie”) is a Python-based ecosystem of open-source software for mathematics, science, and engineering (

How to install Scipy/Numpy on a Laptop or PC


You need Python installed (Python is normaly installed on every linux distro).

Installation of Scipy/Numpy see:

(Note that you can install linux on Windows PC with VMWare player. See


Install python for Windows (32bit), the recommended version is 2.7.6 because of numpy: See and Windows x86 MSI Installer (2.7.6).

Install numpy for Windows (32bit), the recommended version is “numpy-1.8.0-win32-superpack-python2.7.exe”. See

Install scipy for Windows (32bit), the recommended version is “scipy-0.13.2-win32-superpack-python2.7.exe”. See

The installation is on path c:\python2.7\ (by default)

Set the path to python in System Properties -> Advanced Tab -> Enviroment Varilables; Add the directory to python under “System variables” and “path”.

To install matplotlib and download “matplotlib-1.2.0.win32-py2.7.exe”.


Install python: sudo port install python27

Install numpy and scipy; see

Test the installation

Start python (Windows: Start->Programs->Python 2.7):

>>>import numpy

>>>import scipy


OK, if none error messages.

Example codes

See reference:

See also

Sample code (numpy and scipy is equal for the examples below. Use import numpy instead of import scipy):

import scipy
from scipy import linalg
# Matrix multiplication with operator
C = A * B;
# Matrix determinant
d = scipy.linalg.det(A);
# Inv matrix
B2 = A.I * C;
# FFT (only scipy)
F = scipy.fft(A);


Odespy (ODE Software in Python) offers a unified interface to a a large collection of software for solving systems of ordinary differential equations (ODEs). There is also some support for Differential Algebraic Equations (DAEs)

(see and

Note! Odespy is not installed on our HPC clusters Vilje and Kongull.

How to install Odespy

For linux

Download and install odespy: (See git://

$ git clone git://

$ cd odespy

$ python install

(If you don’t have git installed then install git with “sudo yum install git” or “sudo apt-get install git”.)

(Note that you can install linux on Windows PC with VMWare player. See

For Windows and Mac

Download zip file file ( from and Download.

Unzip the file and in the command prompt:

python install –no-fortran

(If you have a fortran compiler installed; you can write: python install)

Windows: Copy the odespy folder to c:\pythonxx\LIb\site-packages\. Ex: ..\hplgit-odespy-1081789\odespy to c:\python27\LIb\site-packages\

Test the installation

Start python:

>>>import odespy


OK, If none error messages.


 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)