From 4d2bf5905caecd2bddf2e338bca6864cb3af9cae Mon Sep 17 00:00:00 2001 From: FreekPols Date: Thu, 4 Sep 2025 18:08:48 +0200 Subject: [PATCH 1/4] ... --- .../Notebook 6/Notebook 6 Measurement uncertainty.ipynb | 9 +++++++++ book/_config.yml | 8 ++++++-- requirements.txt | 3 +++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/book/Course files/Notebook 6/Notebook 6 Measurement uncertainty.ipynb b/book/Course files/Notebook 6/Notebook 6 Measurement uncertainty.ipynb index 5c9ed72..d40bfae 100644 --- a/book/Course files/Notebook 6/Notebook 6 Measurement uncertainty.ipynb +++ b/book/Course files/Notebook 6/Notebook 6 Measurement uncertainty.ipynb @@ -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": {}, diff --git a/book/_config.yml b/book/_config.yml index 85c7dd9..270f391 100644 --- a/book/_config.yml +++ b/book/_config.yml @@ -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 @@ -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: @@ -29,6 +31,8 @@ sphinx: extra_extensions: - teachbooks_favourites - sphinx_tudelft_theme - + - sphinx_nb_execution_patterns + + bibtex_bibfiles: - references.bib diff --git a/requirements.txt b/requirements.txt index 8b86f27..fd2edb3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 From d897a61161b30bb9ede70d0a7dbfe800efec9d2f Mon Sep 17 00:00:00 2001 From: FreekPols Date: Thu, 4 Sep 2025 18:49:40 +0200 Subject: [PATCH 2/4] proper links --- .../Notebook 5/Notebook 5 Data in Python.ipynb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/book/Course files/Notebook 5/Notebook 5 Data in Python.ipynb b/book/Course files/Notebook 5/Notebook 5 Data in Python.ipynb index 84fffd1..270ed7d 100644 --- a/book/Course files/Notebook 5/Notebook 5 Data in Python.ipynb +++ b/book/Course files/Notebook 5/Notebook 5 Data in Python.ipynb @@ -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/pretestdataset.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." @@ -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): " ] }, { @@ -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!)*" ] @@ -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." ] }, { @@ -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?)*" ] @@ -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" ] From 1401bc5d5dba28452d2f08eeabb5e93af344bcc3 Mon Sep 17 00:00:00 2001 From: FreekPols Date: Thu, 4 Sep 2025 18:54:42 +0200 Subject: [PATCH 3/4] small fix --- book/Course files/Notebook 5/Notebook 5 Data in Python.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/Course files/Notebook 5/Notebook 5 Data in Python.ipynb b/book/Course files/Notebook 5/Notebook 5 Data in Python.ipynb index 270ed7d..aacfcbe 100644 --- a/book/Course files/Notebook 5/Notebook 5 Data in Python.ipynb +++ b/book/Course files/Notebook 5/Notebook 5 Data in Python.ipynb @@ -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](https://github.com/Contemporary-Physicslab/FYPLC/blob/main/book/Course%20files/Notebook%205/pretestdataset.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." From 2cc2293471a8eca1a16bbaa841979494e9424288 Mon Sep 17 00:00:00 2001 From: FreekPols Date: Fri, 5 Sep 2025 13:18:52 +0200 Subject: [PATCH 4/4] correcte bestand pptx --- book/Course files/Software.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/Course files/Software.md b/book/Course files/Software.md index 506a77c..a3092cc 100644 --- a/book/Course files/Software.md +++ b/book/Course files/Software.md @@ -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.