$$ \newcommand{\uex}{{u_{\small\mbox{e}}}} \newcommand{\tp}{\thinspace .} $$

 

 

 

Scientific software engineering with a simple ODE model as example

Hans Petter Langtangen [1, 2]

[1] Center for Biomedical Computing, Simula Research Laboratory
[2] Department of Informatics, University of Oslo

Sep 25, 2014

Table of contents

Sample problem and code
      Mathematical problem
      Implementation
User interfaces
      Creating command-line interfaces
            Reading a sequence of command-line arguments
            Working with an argument parser
      Creating a graphical web user interface
            Making a compute function
            Generating the user interface
            Running the web application
Verification
      Comparison with hand calculations
      Test function
      Comparison with an exact discrete solution
      Computing convergence rates
            Estimating \( r \)
            Implementation
            Debugging via convergence rates
Software engineering
      Making a module
      Prefixing imported functions by the module name
      Doctests
      Unit testing with nose
            Basic use of nose
            Alternative assert statements
            Applying nose
            Installation of nose
            Using nose to test modules with doctests
      Classical class-based unit testing
            Basic use of unittest
            Demonstration of unittest
      Implementing simple problem and solver classes
            The problem class
            The solver class
            The visualizer class
            Combining the objects
      Improving the problem and solver classes
            A generic class for parameters
            The problem class
            The solver class
            The visualizer class
Performing scientific experiments
      Software
      Combining plot files
      Interpreting output from other programs
      Making a report
            Plain HTML
            HTML with MathJax
            LaTeX
            Sphinx
            Markdown
            Wiki formats
            DocOnce
            Worked example
      Publishing a complete project
Exercises
      Exercise 1: Refactor a flat program in terms of a function
            Remarks
      Exercise 2: Compare methods for a given time mesh
      Problem 3: Write a doctest
      Problem 4: Write a nose test
      Problem 5: Make a module
      Exercise 6: Make use of a class implementation
      Exercise 7: Generalize a class implementation
      Exercise 8: Generalize an advanced class implementation
Bibliography

Read »