$$\newcommand{\tp}{\thinspace .}$$

Computing with formulas

Hans Petter Langtangen [1, 2]

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

Jun 14, 2016

Our first examples on computer programming involve programs that evaluate mathematical formulas. You will learn how to write and run a Python program, how to work with variables, how to compute with mathematical functions such as $$e^x$$ and $$\sin x$$, and how to use Python for interactive calculations.
All the program examples associated with this document can be downloaded as a tarfile or zipfile from the web page http://hplgit.github.com/scipro-primer. I strongly recommend you to visit this page, download and pack out the files. The examples are organized in a folder tree with src as root. Each subfolder corresponds to a particular chapter. For example, the subfolder formulas contains the program examples associated with this first chapter. The relevant subfolder name is listed at the beginning of every chapter.
The folder structure with example programs can also be directly accessed in a GitHub repository on the web. You can click on the formulas folder to see all the examples from the present chapter. Clicking on a filename shows a nicely typeset version of the file. The file can be downloaded by first clicking Raw to get the plain text version of the file, and then right-clicking in the web page and choosing Save As....