Skip to article frontmatterSkip to article content

This assignment has to be made individually. You can start at 13:30h, it has to submitted before 17:30h.

You are allowed to use previous materials you made and used in Python.

Important:

provide enough information so we can understand what you are doing.
you can create cells (as markdown) to create comments and explanations.
you can use # as well to comment.
always use significant figures and units (if given) for your final answer

You are allowed to calculate things by hand as well, but then show or explain your final answer.

import matplotlib.pyplot as plt
import numpy as np

from scipy.optimize import curve_fit 
from scipy.stats import norm

Task 1

In this task you will show that you understand the basics of Python.

  1. Make an array “x_raw” running from 0 to 100 (including both 0 and 100) with an interval where all elements are integers (so [0,1,2,3...100]). (1pt)

  2. Now use x_raw to make a new array “x_even” which consists of all even numbers in the array “x_raw”. (1pt)

  3. Define a function f(a,x)f(a,x) that returns ax2a \cdot x^2. Use it to make an array y=f(2.0,xy = f(2.0,x_even)even). (1pt)

  4. Now, replace y=f(2.0,20)y=f(2.0,20) by 2500. Note, counting to the index corresponding to f(2.0,20)f(2.0, 20) by hand is not allowed! (1pt)

We now have a distorted dataset.

  1. Use curve fitting to find the best value of aa and the uncertainty in aa. Present the two values as an experimental physicist would do. (3pt)

  2. Make a test array from 0 to 100 with an interval of 0.1 and use this test array to graph the function fit into the data. Show the function fit as a dotted red line. (3pt)

### YOUR CODE

Task 2

A physical quantity AA has been measured in order to calculate a different physical quantity ZZ. The value of AA is 1.075 ± 0.003.

Calculate the physical quantity ZZ and its uncertainty using the calculus approach for:

  1. Z=2.5sin(2πA)Z = 2.5 \cdot \sin(2\pi A) (3pt)

and the functional approach for:

  1. Z=3A4Z = \sqrt{3}\cdot A^{4} (3pt)

(Disregard the unit(s))

### YOUR CODE

Task 3

Eliza is taking repeated independent measurements using a digital multimeter. However, she notes that every time the same value is showing up. Does this mean that the quantity she is measuring has no uncertainty? Explain. (1pt)

### YOUR ANSWER

Task 4

In your final project you received a dataset stored in ‘data.csv’. You are asked to (1) investigate the pattern in the data, (2) define a function that probably fits that pattern, (3) use curve fitting to present the values of the parameters and their uncertainties, (4) plot the fit on the data and study the residuals: investigate whether this these are random noise that can be described using a Gaussian distribution and if so, what the standard deviation is of that noise.

First load the ‘data.csv’ file. Then carry out this data-analysis. (9pt)

### YOUR CODE