wasora’s an advanced suite for optimization & reactor analysis


Wasora is a convenient (relatively) high-level tool to perform mathematical computations. It also provides a framework which other particular computational codes can use. It is a free computational tool designed to aid a cognizant expert—i.e. you, whether an engineer, scientist, technician, geek, etc.—to analyze complex systems by solving mathematical problems by means of a high-level plain-text input file containing

  • algebraic expressions,
  • data for function interpolation,
  • differential equations, and
  • output instructions

amongst other facilities.

For example, the famous chaotic Lorenz’ dynamical system—the one of the butterfly—whose differential equations are

\[ \begin{align*} \dot{x} &= \sigma \cdot (y - x)\\ \dot{y} &= x \cdot (r - z) - y\\ \dot{z} &= xy - bz\\ \end{align*} \] where \(\sigma=10\), \(b=8/3\) and \(r=28\) are the classical parameters that generate the butterfly as presented by Edward Lorenz back in his seminal 1963 paper Deterministic non-periodic flow, can be solved with wasoraby writing the equations in the input file as naturally as possible, as illustrated in the input file that follows:

Following the UNIX Philosophy, wasora’s output can be piped to Gnuplot in order to obtain a beautiful figure:

wasora lorenz.was | gnuplot -e "set terminal svg; set output 'lorenz.svg'; set ticslevel 0; splot '-' u 2:3:4 w l ti ''"


At a first glance, wasora may look as another high-level interpreted programming language, but—hopefully—it is not: wasora should be seen as a syntactically-sweetened way to ask a computer to perform a certain mathematical calculation. For example, see here to find how the famous Lorenz system may be solved by writing the three differential equations into a plain-text input file as humanly-friendly as possible.

Although its ultimate subject is optimization, it may hopefully help you with the tough calculations that usually appear when working with problems that have some kind of complexity, allowing the user to focus on what humans perform best—expert judgment and reaching conclusions. Some of its main features include

The code heavily relies on the numerical routines provided by the GNU Scientific Library, whose installation is mandatory. In fact, wasora can be seen as a high-level front-end to GSL’s numerical procedures. The solution of differential-algebraic systems of equations is performed using the SUNDIALS IDA Library, although this feature usage is optional.

1 Quick-start

It is really worth any amount of time and effort to get away from Windows if you are doing computational science.


Open a terminal in a GNU/Linux box (may be a VirtualBox box) and make sure you install the following packages:

sudo apt-get install m4 make autoconf automake gcc git findutils libgsl-dev libsundials-serial-dev libreadline-dev

Clone the wasora repository, bootstrap, configure, compile and check:

git clone https://bitbucket.org/seamplex/wasora/
cd wasora
make check

If you get any error, including packages not found or other any issue, ask for help in the mailing list at https://www.seamplex.com/lists.html.

2 Running wasora

Following a design decision, wasora reads a plain-text file referred to as the input file that contains a set of alphanumeric keywords with their corresponding arguments that define a certain mathematical problem that is to be solved. See the file examples/parser.was that explains how wasora parses its input files.

Assuming wasora is installed in a directory listed in the $PATH variable and that the input file is named input.was, then the proper execution instruction is

$ wasora input.was

There exist some command line options—that may be consulted using the --help option—that are detailed discussed in the complete documentation. In particular, the --version option shows information about the wasora version and the libraries it was linked against:

$ wasora --version
wasora v0.5.24-gd413ad5
wasora’s an advanced suite for optimization & reactor analysis

 last commit on Wed Dec 7 12:26:02 2016 -0300
 compiled on 2016-12-08 07:32:03 by gtheler@tom ( )
 with gcc (Debian 4.9.2-10) 4.9.2 using -Wall and linked against
  GNU Scientific Library version 1.16
  SUNDIALs Library version 2.5.0
  GNU Readline version 6.3

 wasora is copyright (C) 2009-2016 jeremy theler
 licensed under GNU GPL version 3 or later.
 wasora is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.

The input file may also ask for command line options—for example to pass run-time arguments so the same input file can be used to solve similar problems—by referring them as $1, $2, etc. These $n expressions are literally replaced by the command line arguments provided after the input file. So for example, the following single-line input file (which can be found in examples/calc.was):

can be used as a command-line calculator:

$ wasora calc.was 1+1

See the examples/parser.was file, the Examples & test suite and The wasora Real Book sections below for examples of usage of arguments.

3 Examples & test suite

After the compilation of the code (that follows the standard ./configure && make procedure, see INSTALL for details), one recommended step is to run the test suite with

$ make check

It consists of ten examples of application that use different kind of the features provided by wasora. They work both as examples of usage and as a suite of tests that check that wasora implements correctly the functionalities that are expected. A more detailed set of examples that illustrate real applications of wasora in a wide variety of fields—ranging from classical mechanical systems up to analysis of blackjack strategies—can be found in The wasora Real Book. Some of the cases in the test suite generate graphical data which is shown on the screen using gnuplot, provided it is installed.

The make check command may not show the actual output of the examples but the overall result (i.e. whether the test passed, the test failed or the test was skipped). Each individual test may be repeated by executing the test-*.sh scripts located in the examples subdirectory.

4 Plugins

Almost any single feature included in the code was needed at least once by the author during his career in the nuclear industry. Nevertheless, wasora is aimed at solving general mathematical problems (see below for a description of the wasora Real Book). Should a particular calculation be needed, wasora’s features may be extended by the implementation of dynamically-loaded plugins, for example:

builds scientific videos out of wasora computations
solves partial differential equations using the finite element method
solves the multigroup neutron diffusion equation
runs Python code within wasora sharing variables, vectors and matrices
eXtracts Data From RELAP Restart-Plot Files

The set of wasora plus one or more of its plugins is referred to as the wasora suite.

5 The wasora Real Book

As jazz, wasora is best mastered when played. The wasora Realbook, like the original, introduces fully-usable examples of increasing complexity and difficulty. The examples come with introductions, wasora inputs, terminal mimics, figures and discussions. They range from simple mechanical systems, chaotic attractors and even blackjack strategies:

6 Licensing

Wasora is distributed under the terms of the GNU General Public License version 3 or (at your option) any later version.

7 Further information

Home page: https://www.seamplex.com/wasora
Repository: https://bitbucket.org/seamplex/wasora
Mailing list and bug reports: wasora@seamplex.com (you need to subscribe first at wasora+subscribe@seamplex.com)
Follow us: Twitter YouTube LinkedIn Bitbucket

wasora is copyright (C) 2009–2018 Jeremy Theler
wasora is licensed under GNU GPL version 3 or (at your option) any later version.
wasora is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
See the file COPYING for copying conditions.