Numerical integration (level 2)

In this module we’ll get to work with functions and random numbers. With these Python components we can implement methdos that can determine the integral of just about any function! You don’t need to have done any calculus to partake in this module, but some intuition with mathematical functions is quite relevant.

In the video below, meet Lydia Brenner and Jelle Aalbers from Nikhef who tell you about their experiences with programming simulations for their research.

Day 1: roots

  1. Learn more about functions in Python

  2. Assignment Determine the roots of a polynomial

Day 2: Riemann

  1. Learn more about the Riemann sum

  2. Assignment Harness the power of a computer to determine the Riemann sum.

Day 3: random

  1. Learn more about the use of random numbers.

  2. Assignment Random fact.

  3. Assignment Calculate the average distance between two points in a square

  4. Assignment Analyse with a histogram the output of the random function

Day 4: Monte Carlo

  1. Learn more about the Monte-Carlo method

  2. Assignment: Use random values to calculate integrals with the Monte Carlo method

  3. Assignment: Calculate the surface of an odd shape: the Twitter egg

Submitting

When you’re ready to submit, head to the submit page for this module.

The Twitter Egg assignment can’t be submitted but you might show off your code during office hours :-)

Evaluation

Have you submitted each problem from this module? Then you’re done! Let us know by e-mail if you have any remarks on the quality of this module. It’s important for us to get feedback on the course’s content, and we actually use it to improve!