S-114.1100 Computational Science
Exercise instructions

Exercise points can be obtained by reporting solutions to the exercises, which have been marked with (X points) on the problem sheet (for example: "Problem 2. (computer) (3 points)"). The due date is given in the problem sheet.

One third of the total points is required to be allowed to take the exam.

Approximative exercise point distribution (guideline - this may change a bit according to exercises) (round1 +...+ round10):
6+6+4+4+3+2+4+5+5+5 = 44

In the last exercise there are 4 extra points available for those who might have difficulties in obtaining the required 1/3 of the points otherwise. These will not add up to points you get from the exam. You'll need to have a look at the last lecture notes in order to complete these extra assignments.

Return the exercises as one PDF file by email to
lasktiede@gmail.com

The name of the file and the subject of the email should be
2013_exerciseX_12345K(.pdf for filename)
where X is the current exercise round and 12345K is replaced by your student number.

Present the results in a human/assistant readable form. Only returning the code is not enough.

The structure of the report should be as follows:
Your name and student number.
Exercise round number X

Exercise 1. Plots and conclusions.
Exercise 2. Plots and conclusions.
...
Appendix
Exercise 1. Code
Exercise 2. Code
...

QUESTIONS? If you have questions regarding the exercises, please email them to lasktiede@gmail.com. If you have questions about the lectures, contact the lecturer.

How to create .pdf report

You can use open office (command ooffice on linux), and proceed followingly.
1) Create a text document, where you place your plots, explanations, codes etc.
2) Choose export as PDF (or print to file to create a PS file)

Use of python (pylab/matplotlib) is recommended for coding and graphics, but you can also make plots with gnuplot, xfig or matlab.
NOTE: Using matlab for coding is restricted to certain exercises.

PYTHON INSTRUCTIONS:

Tutorials:
hetland.org/writing/instant-python.html
www.scipy.org/Cookbook/Matplotlib/MultilinePlots

Quick hands-on:
Type on command-line:
ipython
OR
pydev

The program should start. You can try running these commands:
from pylab import *

help(plot)
help(loglog)

x = arange(-pi,pi,0.1)
y = sin(x)
plot(x, y)
show()


xList = []
y1List = []
y2List = []
outFile = file("filename.txt", "w")
for i in range(10):
    value = sin(float(i))
    value2 = cos(float(i))
    y1List.append(value)
    y2List.append(value2)
    xList.append(i)
    print >> outFile, i, value, value2

plot(xList, y1List, '-b', xList, y2List, '--r')
xlabel('x')
ylabel('y')
legend( ('sin', 'cos') )
show()


# note:
print 1 / 6 # prints 0
# use instead:
print 1.0 / 6.0 # prints 0.166666
# OR  (this needs to be at the beginning of each script when used)
from __future__ import division
print 1 / 6 # prints 0.166666

# in ipython, scripts can be run with the command %run filename.py