Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions book/Course files/Notebook 5/Notebook 5 Data in Python.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"* post-test: test your skills after Notebook 5. Check whether you learned enough.\n",
"\n",
"**Doing an analysis**\n",
"Eric so far survived the first weeks of his employment. As he showed some true skills, he is asked to help in building an RC-filter. First, some initial data needs to be analysed. He receives a datafile called 'pretestdata.csv'. Once he retrieved (loaded) this data, he plots it first. He then uses the theoretical formula that should describe the pattern in the data: $\\frac{U_C}{U_{max}}=\\frac{1}{\\sqrt{1+(wRC)^2}}$, where $w$ is the angular frequency given by $w=2\\pi f$. $RC$ can be considered a constant which can be found using least-square fitting.\n",
"Eric so far survived the first weeks of his employment. As he showed some true skills, he is asked to help in building an RC-filter. First, some initial data needs to be analysed. He receives a datafile called [pretestdata.csv](https://github.com/Contemporary-Physicslab/FYPLC/blob/main/book/Course%20files/Notebook%205/pretestdata.csv). Once he retrieved (loaded) this data, he plots it first. He then uses the theoretical formula that should describe the pattern in the data: $\\frac{U_C}{U_{max}}=\\frac{1}{\\sqrt{1+(wRC)^2}}$, where $w$ is the angular frequency given by $w=2\\pi f$. $RC$ can be considered a constant which can be found using least-square fitting.\n",
"- Retrieve the data and plot these using a log-scale on the x-axis. Think about the scientific rules for making plots.\n",
"- Find the best estimate of RC and plot the fitfunction on top of the dataset.\n",
"- Carry out a residual analysis."
Expand Down Expand Up @@ -160,7 +160,7 @@
"\n",
"It can handle any type of **delimiter**: the default is any whitespace (tab or space), but this can also be configured using the `delimiter=` keyword argument. It also does not care about the file extension: for example, it is fine if a CSV file does not have a `.csv` extension (it doesn't even have to have an extension!). A typical convention is to name the files containing ASCII text data with an extension `.dat`.\n",
"\n",
"Let's give it a try using the file `v_vs_time.dat`: "
"Let's give it a try using the file [v_vs_time.dat](https://github.com/Contemporary-Physicslab/FYPLC/blob/main/book/Course%20files/Notebook%205/v_vs_time.dat): "
]
},
{
Expand Down Expand Up @@ -287,7 +287,7 @@
},
"source": [
"**`Exercise 5.1`** \\\n",
"Load the data from the file `exercise_data.dat`. The first column represents a measurement time in seconds, and the second represents a measurement voltage in volts. How many points are in the dataset? \n",
"Load the data from the file [exercise_data.dat](https://github.com/Contemporary-Physicslab/FYPLC/blob/main/book/Course%20files/Notebook%205/exercise_data.dat). The first column represents a measurement time in seconds, and the second represents a measurement voltage in volts. How many points are in the dataset? \n",
"\n",
"*(Important: make sure that you use different variable names than t and v for the data you load, since we will continue to use the data we loaded in the example code in the sections below!)*"
]
Expand Down Expand Up @@ -408,7 +408,7 @@
"metadata": {},
"source": [
"**`Exercise 5.2`** \\\n",
"Make a testarray $x$ running from 1 to 100 with an interval of 0.1. Write a function $y=3.05*x+0.95$. Use this function to make a new array for $y$. Save your data in the file 'testfile.csv' using ; as a delimiter (NOTE: delimiters are sometimes \";\" and sometimes \",\" Always inspect the datafile first.). If all went well, when running the subsequent cell your data are loaded and shown in a plot."
"Make a testarray $x$ running from 1 to 100 with an interval of 0.1. Write a function $y=3.05 x + 0.95$. Use this function to make a new array for $y$. Save your data in the file 'testfile.csv' using ; as a delimiter (NOTE: delimiters are sometimes \";\" and sometimes \",\" Always inspect the datafile first.). If all went well, when running the subsequent cell your data are loaded and shown in a plot."
]
},
{
Expand Down Expand Up @@ -658,7 +658,7 @@
},
"source": [
"**`Exercise 5.5`** \\\n",
"Another way to get the exponent is to plot $\\log(V)$ vs $\\log(t)$ (a log-log plot). If the data really follows a power law relation, then this should give a straight line with a slope determined by the exponent. Try this, and then add a straight line $\\log(V) = p * \\log(t)$ to the plot. Play around with the value of $p$ until the line has the same slope as the data. For this plot, use solid filled circle for the data and a solid line for the theory.\n",
"Another way to get the exponent is to plot $\\log(V)$ vs $\\log(t)$ (a log-log plot). If the data really follows a power law relation, then this should give a straight line with a slope determined by the exponent. Try this, and then add a straight line $\\log(V) = p \\log(t)$ to the plot. Play around with the value of $p$ until the line has the same slope as the data. For this plot, use solid filled circle for the data and a solid line for the theory.\n",
"\n",
"*(Do you get a warning message? Why?)*"
]
Expand Down Expand Up @@ -1395,7 +1395,7 @@
"metadata": {},
"source": [
"**`Exercise 5.9`** \\\n",
"In 'dataset.csv' we have made you a dataset where you have to find the formula describing it. Find the parameters and their associated uncertainties. Don't forget to analyse your residuals to see whether you found the proper formula.\n",
"In [dataset.csv](https://github.com/Contemporary-Physicslab/FYPLC/blob/main/book/Course%20files/Notebook%205/dataset.csv) we have made you a dataset where you have to find the formula describing it. Find the parameters and their associated uncertainties. Don't forget to analyse your residuals to see whether you found the proper formula.\n",
"\n",
"Note! This excercise consumes a lot of your time...\n"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
"# Measurements and their uncertainty\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(2+3)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
2 changes: 1 addition & 1 deletion book/Course files/Software.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Python is an interpreter programming language and thus needs an interpreter (some software). For programming it is always useful to have some software that helps you in writing code and running it. For this course we recommend you to install Mini-Conda, but provide instructions for other software as well.

This [presentation](https://github.com/Contemporary-Physicslab/FYPLC/blob/main/book/Course%20files/software%20installation.pptx) may help you installing the required/recommended software.
This [presentation](software installation.pptx) may help you installing the required/recommended software.

## VSC
A popular code editor is [Visual Studio Code](https://code.visualstudio.com/). It allows you to program in different languages, where it recognizes the commands in that language and adjusts the FONT so that it becomes better readable. Moreover, it allows you to install various packages (such as Jupyter Notebook). It also integrates GIT and allows to code using Co-Pilot, an AI pair programmer. We advise to use VSC as it allows for multiple programming languages.
Expand Down
8 changes: 6 additions & 2 deletions book/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ author: Freek Pols
logo: figures/TUDelft_logo_rgb.png #add your own logo here

execute:
execute_notebooks: "off"
execute_notebooks: "auto"

only_build_toc_files: true

Expand All @@ -13,6 +13,8 @@ html:

sphinx:
config:
nb_execution_includepatterns:
- "Course files/Notebook 6/Notebook 6 Measurement uncertainty.ipynb"
html_js_files:
- https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js
thebe_config:
Expand All @@ -29,6 +31,8 @@ sphinx:
extra_extensions:
- teachbooks_favourites
- sphinx_tudelft_theme

- sphinx_nb_execution_patterns


bibtex_bibfiles:
- references.bib
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ teachbooks # depends on jupyter-book
sphinx-tudelft-theme
git+https://github.com/TeachBooks/TeachBooks-Favourites

#testing for dennis
git+https://github.com/TeachBooks/Sphinx-NB-Execution-Patterns

# jupyterbook-patches
# # numpy

Expand Down