diff --git a/notebooks/2a_pre_knowledge_waves.ipynb b/notebooks/2a_pre_knowledge_waves.ipynb
new file mode 100644
index 0000000..a27947b
--- /dev/null
+++ b/notebooks/2a_pre_knowledge_waves.ipynb
@@ -0,0 +1,233 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "08b7ff1c-1e3c-4917-bc39-d046ecfa68eb",
+ "metadata": {},
+ "source": [
+ ""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "562c17ce-311a-46be-acdf-e360ce7dd3ee",
+ "metadata": {},
+ "source": [
+ "# Week 2a: Pre-knowledge waves"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "593e05c2-cc9c-4c0d-a9bb-bf0fee870c29",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "%run Initialize/init_2a.ipynb"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "adc11ad6-a933-4eb2-ae1e-c3ccc9282a81",
+ "metadata": {},
+ "source": [
+ "This optional section focuses on the material studied in Waves that is related to the dispersion relationship. A brief summary is given in Sections 3.2-2.6 of the Coastal Dynamics textbook. This notebook can be used to test whether you master the dispersion relationship sufficiently. We will discuss how the wavelength can be calculated through an iterative approach, by tables, and by an explicit formula and then ask you to calculate various wave parameters."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "31bed71d-9b3b-4fa5-af1b-c10b831b92b4",
+ "metadata": {},
+ "source": [
+ "## 1) Dispersion relation"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "34b967c8-fb0d-4456-a1b8-96fc5b785c73",
+ "metadata": {},
+ "source": [
+ "In the questions below will guide you through te different ways the wavelength can be computed through the dispersion relationship. You can fillin and check the answers individually by pressing the check buttons. The correct answer will be given after 3 attempts. You can then redo the question with different numbers by running the cell again."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2a114d05-5f24-4e67-9d96-db68b161b910",
+ "metadata": {},
+ "source": [
+ "### 1.1) Iterative approach"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "97b3d1ef-453f-4d14-8d9b-04f946859ff0",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "W2_Q1()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "949fa014-71b0-4bab-a725-f4a9928c7a43",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# You can use this cell to answer the question"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "571d9f63-5282-4b09-945b-b15a1b9e7f41",
+ "metadata": {},
+ "source": [
+ "### 1.2) Wavelength through table"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "9d501454-fe56-4519-a24f-c67031a4218c",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "W2_Q2()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "6a6ed4f5-73a2-4608-9a0b-78604e6bb825",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# You can use this cell to answer the question"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0be84b2b-bce7-49f1-9886-9319d134191b",
+ "metadata": {},
+ "source": [
+ "### 1.3) Explicit formula"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "ee3b2444-0ade-4387-ae7a-97d86d803ec9",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "W2_Q3()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "451e2351-93f3-48ba-85a5-d4da1023b2ea",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# You can use this cell to answer the question"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6ed154de-80a9-4b69-ab37-07aa09da42ee",
+ "metadata": {},
+ "source": [
+ "## 2.1) The dispersion relation"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "1396d7b3-fe65-4105-a1cc-03db7ff11489",
+ "metadata": {},
+ "source": [
+ "Various wave characteristics can be computed given the water depth and wave period or wavelength. Can you calculate the wave characteristics asked in the questions below? "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "426fe0d5-f7a5-4c7d-a5e7-8755c23a56f1",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "W2_Q4()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "d15a07ab-14be-4228-85c4-36d4f5c850ed",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# You can use this cell to answer the question"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "7f22d79a-8d43-4896-b945-60308b37e733",
+ "metadata": {},
+ "source": [
+ "## 2.2) Shallow, intermediate, and deep water"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d087bc0d-2be5-4acb-9eb2-e2a3472a1053",
+ "metadata": {},
+ "source": [
+ "The wave experiences deep, intermediate, or shallow water conditions. Can you asses which conditions the wave experiences? You can use the cell below for your computations."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "ce0a360e-4558-4ebc-8b1b-f161cdd66608",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "W2_Q5()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "fca378b7-7841-42a9-8f3f-83becd1a473c",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# You can use this cell to answer the question"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3 (ipykernel)",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.11.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/notebooks/2b_wave_dispersion_and_grouping.ipynb b/notebooks/2b_wave_dispersion_and_grouping.ipynb
new file mode 100644
index 0000000..7e85bf4
--- /dev/null
+++ b/notebooks/2b_wave_dispersion_and_grouping.ipynb
@@ -0,0 +1,566 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "08b7ff1c-1e3c-4917-bc39-d046ecfa68eb",
+ "metadata": {},
+ "source": [
+ ""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3c71bf9e-1d95-44b8-9450-f307e4c0bf0e",
+ "metadata": {},
+ "source": [
+ "## Answered version"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "562c17ce-311a-46be-acdf-e360ce7dd3ee",
+ "metadata": {},
+ "source": [
+ "# Week 2b: Wave dispersion and grouping"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "593e05c2-cc9c-4c0d-a9bb-bf0fee870c29",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "%run Initialize/init_2b.ipynb"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ce68662a-75b4-482d-bb7f-81a4f8b5e1e1",
+ "metadata": {},
+ "source": [
+ "Wind-generated and tidal waves can travel great distances until they finally reach the coast. In this section, we discuss the propagation of both individual waves and the behaviour of a group of waves together. It is recommended to read chapter 3 of the book Coastal Dynamics when studying this codebook."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9121657e-c30b-4690-a84c-cdc1719ebcb5",
+ "metadata": {},
+ "source": [
+ "## 1) Dispersion relation for tsunami waves"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ca701a8c-c317-479e-9286-70f894afe575",
+ "metadata": {},
+ "source": [
+ "The dispersion relation can be used for all kinds of waves, including tsunami waves. Can you assess the characteristics of tsunami waves at various water depth classifications? The questions are equivalent to the question in footnote 2 on page 114 of the textbook. You can use previously created functions and the cell below for answering."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "cf276d18-2b08-445f-ae9a-60c76fc7e3f8",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "W2_Q6()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "e9e71193-992a-4d51-8246-d8b5159c0426",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# You can use this cell to answer the question\n",
+ "\n",
+ "h = 4000\n",
+ "T1 = 5 * 60 # 5 min\n",
+ "T4 = 60 * 60 # 60 min\n",
+ "\n",
+ "Q0 = 'Between which periods are tsunami waves at intermediate depth, according to the dispersion relationship?'\n",
+ "L_lower = h/0.5\n",
+ "k_lower = 2*np.pi/L_lower\n",
+ "w_lower = (9.81*k_lower*np.tanh(k_lower*h))**0.5 # dispersion relationship\n",
+ "T_lower = 2*np.pi/w_lower\n",
+ "L_up = h/0.05\n",
+ "k_up =2*np.pi/L_up\n",
+ "w_up = (9.81*k_up*np.tanh(k_up*h))**0.5\n",
+ "T_up = 2*np.pi/w_up\n",
+ "answer0 = round(T_up,1), round(T_lower,1)\n",
+ "print(Q0, '\\n',answer0, 's', '\\n')\n",
+ "\n",
+ "Q1 = \"What is the wavelength of the tsunami wave at those 4 points?\"\n",
+ "L1 = wave_length(T=T1, h=h)\n",
+ "L2 = h / 0.5\n",
+ "L3 = h / 0.05\n",
+ "L4 = wave_length(T=T4, h=h)\n",
+ "Q1_answers = round(L1 / 1000, 1), L2 / 1000, L3 / 1000, round(L4 / 1000, 1)\n",
+ "print(Q1, '\\n', Q1_answers, 'km', '\\n')\n",
+ "\n",
+ "Q2 = \"What is the wave period of the tsunami wave at those 4 points?\"\n",
+ "w1 = 2 * np.pi / T1\n",
+ "w2 = dispersion(k=2*np.pi/L2, h=h)\n",
+ "w3 = dispersion(k=2*np.pi/L3, h=h)\n",
+ "w4 = 2 * np.pi / T4\n",
+ "T2 = 2*np.pi/w2\n",
+ "T3 = 2*np.pi/w3\n",
+ "print(Q2, '\\n',T1, round(T2,1), round(T3,1), T4 , 's', '\\n')\n",
+ "\n",
+ "Q3 = \"What is the wave celerity (c) of the tsunami wave at those 4 points?\"\n",
+ "c1 = L1 / T1\n",
+ "c2 = L2 / T2\n",
+ "c3 = L3 / T3\n",
+ "c4 = L4 / T4\n",
+ "print(Q3, '\\n',round(c1,1), round(c2,1), round(c3,1), round(c4,1) , 'm/s', '\\n')\n",
+ "\n",
+ "Q4 = \"What is the wave group velocity (cg) of the tsunami at those 4 points?\"\n",
+ "k1 = 2 * np.pi / L1\n",
+ "k2 = 2 * np.pi / L2\n",
+ "k3 = 2 * np.pi / L3\n",
+ "k4 = 2 * np.pi / L4\n",
+ "\n",
+ "n1 = 0.5 + k1 * h / np.sinh(2 * k1 * h)\n",
+ "n2 = 0.5 + k2 * h / np.sinh(2 * k2 * h)\n",
+ "n3 = 0.5 + k3 * h / np.sinh(2 * k3 * h)\n",
+ "n4 = 0.5 + k4 * h / np.sinh(2 * k4 * h)\n",
+ "\n",
+ "cg1 = c1 * n1\n",
+ "cg2 = c2 * n2\n",
+ "cg3 = c3 * n3\n",
+ "cg4 = c4 * n4\n",
+ "Q4_answers = round(cg1, 1), round(cg2, 1), round(cg3, 1), round(cg4, 1)\n",
+ "print(Q4, '\\n', Q4_answers, 'm/s')"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "22671e3e-a2c0-4b12-883d-c405d476e939",
+ "metadata": {},
+ "source": [
+ "## 2) Dispersion relation in the cross-shore direction"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "011ad064-a9f8-4da1-90e9-603a9e76a8f7",
+ "metadata": {},
+ "source": [
+ "Both the water depth and the wave period influence the wave propagation speed, as we have seen in the previous question. In deep water, the depth is so large relative to the wavelength that the orbital velocities of the wave do not reach the bottom and no interaction between the waves and the bed is possible. In this case, the wave celerity is only affected by the wave period. The other extreme is in shallow water, where only the water depth influences the wave celerity, and the wave period is irrelevant (non-dispersive waves). Thus, two waves of different periods but at the same location have the same celerity if both waves meet the requirements for shallow water conditions. Only if the water depth for one or both of these waves is classified as intermediate or deep water, the waves have a different celerity. \n",
+ "\n",
+ "The wave celerity and the wavelength change when waves propagate in the cross-shore direction. In the interactive graph below you can study the impact of changing the bed slope (1:x) and the water depth (at the most seaward point) on the three waves (components). Here you will see that waves might have a different water depth classification (deep/intermediate/shallow) at the same time and location. Below the graph are a few practical questions that assess the effect of wave period, depth, and bathymetry on the wavelength and period."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "0faea40d-0f0d-4d05-a35a-9dbd53ee8e31",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "W2_Q7()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "e8c3f038-9ec9-4170-b317-d59ca3985702",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# You can use this cell for computations\n",
+ "\n",
+ "# No computations are needed, the line is straight in deep water and overlapping in shallow water. \n",
+ "answer1 = 'wave1' + 'wave2'\n",
+ "answer2 = 'wave2' + 'wave3'\n",
+ "answer3 = None"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "54250805-5302-4c09-a3f9-03f7b164d2c2",
+ "metadata": {},
+ "source": [
+ "## 3) Wave groups"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a2c4770d-dd03-4307-b959-8d8565ecb132",
+ "metadata": {},
+ "source": [
+ "Multiple waves (components) can coexist, influencing the sea surface elevation, currents, etc. The sea surface elevation can be described by substituting the harmonic components, as expressed in formula 1.\n",
+ "\n",
+ "\\begin{equation}\n",
+ "\\tag{1}\n",
+ "\\eta = a_1 sin(w_1t-k_1x) + a_2 sin(w_2t-k_2x)\n",
+ "\\end{equation}\n",
+ "\n",
+ "This can be rewritten to formula 2, when $a_1 = a_2 = a$.\n",
+ "\n",
+ "\\begin{equation}\n",
+ "\\tag{2}\n",
+ "\\eta = 2a sin(\\frac{\\omega_2+\\omega_1}{2}t - \\frac{k_2+k_1}{2}x)cos(\\frac{\\omega_2-\\omega_1}{2}t-\\frac{k_2-k_1}{2}x)\n",
+ "\\end{equation}\n",
+ "\n",
+ "Which can be expressed in terms of differences ($\\Delta$) and averaged values (indicated with a bar) for the radial frequency and wave number, resulting in:\n",
+ "\n",
+ "\\begin{equation}\n",
+ "\\tag{3}\n",
+ "\\eta = 2a sin(\\bar\\omega t - \\bar k x)cos(\\frac{\\Delta\\omega}{2}t - \\frac{\\Delta k}{2}x)\n",
+ "\\end{equation}\n",
+ "\n",
+ "This formula consists of two parts, a slowly varying amplitude with $2a cos(\\frac{\\Delta\\omega}{2}t - \\frac{\\Delta k}{2}x)$ and a carrier wave through $sin(\\bar\\omega t - \\bar k x)$. Which contains the group length through $\\Delta k = 2 \\pi/L_{group}$ and the group period from $\\Delta \\omega = 2 \\pi/T_{group}$."
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0abc3151-66d3-405a-9c0b-9d06227e5795",
+ "metadata": {},
+ "source": [
+ "### 3.1) Waves with same wave amplitude"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "beea6290-758a-4fe8-9ed8-064660e607b6",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "W2_Q9()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "9b76310f-e126-4ae8-8aa3-0eba5534eb94",
+ "metadata": {},
+ "source": [
+ "### 3.1.1) Time series of water elevation"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "73f82e34-93a8-4bf2-97a3-2c8881a7cc72",
+ "metadata": {},
+ "source": [
+ "Below is the beginning of three functions, to calculate the water elevation at a single point in space, and the corresponding varying amplitude and wave envelope. The outcome of these functions will be plotted when you run the cell below. The top graph will check the outcome of eta_t(), and the bottom graph will show you all three functions on top of each other."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "67c6517f-b63c-4394-a087-1cfa4c2ca2da",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "a1, a2, T1, T2 = 0,0,0,0\n",
+ "def eta_t():\n",
+ " ...\n",
+ " return eta\n",
+ "\n",
+ "def varying_amplitude_t():\n",
+ " ...\n",
+ " return ...\n",
+ "\n",
+ "def envelope_t():\n",
+ " ...\n",
+ " return ...\n",
+ "\n",
+ "Show_Q9A()\n",
+ "\n",
+ "# possible answer\n",
+ "print('Start output of the answer.')\n",
+ "\n",
+ "# This is only for here, students have to define them manually\n",
+ "a1, a2, T1, T2, L1, L2, x_max, xp, t_max, tp, L_group, T_group = W2_Q9_param\n",
+ "\n",
+ "def eta_t(a1,a2,T1,T2,L1,L2,t,xp):\n",
+ " eta1_T = a1*np.sin(2*np.pi/T1*t-2*np.pi/L1*xp)\n",
+ " eta2_T = a2*np.sin(2*np.pi/T2*t-2*np.pi/L2*xp)\n",
+ " eta_T = eta1_T + eta2_T\n",
+ " return eta_T\n",
+ "\n",
+ "def varying_amplitude_t(a1,a2,T1,T2,L1, L2, t, xp):\n",
+ " w1 = 2*np.pi/T1\n",
+ " w2 = 2*np.pi/T2\n",
+ " k1 = 2*np.pi/L1\n",
+ " k2 = 2*np.pi/L2\n",
+ " Delta_w = np.abs(w1-w2)\n",
+ " Delta_k = k2 - k1\n",
+ " var_amp = (a1 + a2)*np.cos(0.5*Delta_w*t - 0.5*Delta_k*xp)\n",
+ " return var_amp\n",
+ "\n",
+ "def envelope_t(a1,a2,T1,T2,t):\n",
+ " envelope = np.abs( varying_amplitude_t(a1,a2,T1,T2,L1, L2, t, xp) )\n",
+ " return envelope\n",
+ "\n",
+ "Show_Q9A()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "d71a2647-cae1-42d3-9245-15d4de5a7591",
+ "metadata": {},
+ "source": [
+ "### 3.1.2) Spatial distribution of the water elevation"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a35a8ac8-2378-4120-922a-2f5dca9aacb6",
+ "metadata": {},
+ "source": [
+ "Use this code to make a plot to make a spatial distribution of the water elevation. The structure of this question is similarly as that one for the timeseries."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "404ed490-52f8-40c1-aa45-725678ef1385",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "def eta_x():\n",
+ " ...\n",
+ " return eta\n",
+ "\n",
+ "def varying_amplitude_x():\n",
+ " ...\n",
+ " return ...\n",
+ "\n",
+ "def envelope_x():\n",
+ " ...\n",
+ " return ...\n",
+ "\n",
+ "Show_Q9B()\n",
+ "\n",
+ "# possible answer\n",
+ "print('Start output of the answer.')\n",
+ "\n",
+ "# This is only for here, students have to define them\n",
+ "a1, a2, T1, T2, L1, L2, x_max, xp, t_max, tp, L_group, T_group = W2_Q9_param\n",
+ "\n",
+ "def eta_x(a1,a2,T1,T2,L1,L2,tp,x):\n",
+ " eta1_X = a1*np.sin(2*np.pi/T1*tp-2*np.pi/L1*x)\n",
+ " eta2_X = a2*np.sin(2*np.pi/T2*tp-2*np.pi/L2*x)\n",
+ " eta_X = eta1_X + eta2_X\n",
+ " return eta_X\n",
+ "\n",
+ "def varying_amplitude_x(a1,a2,T1,T2,L1, L2, tp, x):\n",
+ " w1 = 2*np.pi/T1\n",
+ " w2 = 2*np.pi/T2\n",
+ " k1 = 2*np.pi/L1\n",
+ " k2 = 2*np.pi/L2\n",
+ " Delta_w = np.abs(w1-w2)\n",
+ " Delta_k = k2 - k1\n",
+ " var_amp = (a1 + a2)*np.cos(0.5*Delta_w*tp - 0.5*Delta_k*x)\n",
+ " return var_amp\n",
+ "\n",
+ "def envelope_x(a1,a2,T1,T2,L1, L2, tp, x):\n",
+ " envelope = np.abs( varying_amplitude_x(a1,a2,T1,T2,L1, L2, tp, x) )\n",
+ " return envelope\n",
+ "\n",
+ "Show_Q9B()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "4fba317c-aa5a-4e42-a522-a1d22331a0ed",
+ "metadata": {},
+ "source": [
+ "### 3.1.3) Theory question"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "0b082ed6-eaed-433f-9e47-4c97d6b40c26",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "Q10()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b3249c10-e57e-47ec-a907-5d81781021dc",
+ "metadata": {},
+ "source": [
+ "### 3.2) Waves with diffent wave amplitude"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "0eedfd77-4083-4d28-9be2-db994f6084a2",
+ "metadata": {},
+ "source": [
+ "The variable amplitude shows a sinusoidal pattern when the wave amplitudes are equal. The amplitude does not go to zero when different wave amplitudes are used, since they don't cancel each other out at the nodes. The Hilbert Transform can calculate the wave amplitude when $a_1$ and $a_2$ differ. This transformation goes beyond the content of this course but is applied in the interactive graph below which shows the temporal and spatial signal for two different wave components. Feel free to use this graph to analyse the wave signals for various conditions. "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "1fc35b78-e5f2-4edc-ba0b-61f38f10e2bc",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "W2_wave_groups()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "a7eeb5ca-8c30-43de-9895-50273efd2d08",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "Q11()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "1e85e366-4747-4815-9957-72e4b72e84b7",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "W2_Q12()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "aeeaaa7f-66cf-4822-8ec6-fd75eb543f48",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "T1 = 7 # Wave period 1 [s]\n",
+ "T2 = 6.2 # Wave period 1 [s]\n",
+ "h = 20 # water depth [m]\n",
+ "\n",
+ "Delta_k = ...\n",
+ "Delta_w = ...\n",
+ "\n",
+ "Check_W2_Q12A()\n",
+ "\n",
+ "#### begin answer\n",
+ "print('\\n Begin output of the answer')\n",
+ "T1 = 7 # Wave period 1 [s]\n",
+ "T2 = 6.2 # Wave period 1 [s]\n",
+ "h = 20 # water depth [m]\n",
+ "\n",
+ "# The calculation\n",
+ "L1 = wave_length(T1, h\n",
+ " )\n",
+ "L2 = wave_length(T2, h)\n",
+ "k1 = 2*np.pi/L1\n",
+ "k2 = 2*np.pi/L2\n",
+ "w1 = 2*np.pi/T1\n",
+ "w2 = 2*np.pi/T2\n",
+ "\n",
+ "Delta_k = np.abs(k2-k1)\n",
+ "Delta_w = np.abs(w2-w1)\n",
+ "\n",
+ "Check_W2_Q12A()\n",
+ "# The answers are given after 3 attempts, the counter resets when running W2_Q12()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a0a2aa76-f6c4-415c-a8b2-3f7229929f00",
+ "metadata": {},
+ "source": [
+ "Can you also calculate the group velocity (c_group), the wave group length (L_group), and the wave group period (T_group)?"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "5c94e3f6-79a6-4c23-af67-1895e3f91c4c",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "c_group = ...\n",
+ "L_group = ...\n",
+ "T_group = ...\n",
+ "\n",
+ "Check_W2_Q12B()\n",
+ "#### begin answer\n",
+ "print('\\n Begin output of the answer')\n",
+ "\n",
+ "c_group = Delta_w/Delta_k\n",
+ "L_group = 2*np.pi/Delta_k\n",
+ "T_group = 2*np.pi/Delta_w\n",
+ "\n",
+ "Check_W2_Q12B()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "ebcf5b3f-dcd1-44ee-8395-dc592e03170a",
+ "metadata": {},
+ "source": [
+ "Here are some follow-up questions, \n",
+ "- How many waves are there (approximately) in the wave group in space and in time?\n",
+ "- Can you set the graph above such that the number of waves in the group in space and time are equal?\n",
+ "- When is the difference between the number of waves in a group for space and time about a factor of 2?"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "41f264f4-107d-48c4-b2a3-34ece0bff14a",
+ "metadata": {},
+ "source": [
+ "Below is a graph that shows two wave components propagating. You can define the amplitude and period of two wave components and set the water depth. (Not the wavelength) You can zoom in and out to obtain a specific number of waves of the wave group on the x-axis by setting \"n_waves group\". The Hilbert Transform is applied to show the variable wave amplitude.\n",
+ "\n",
+ "Can you find out when the waves are dispersive and when not? How is this visible on the graph?
\n",
+ "Unfortunately is the graph very computationally demanding, resulting in low frames per second, so it is a challenge to see the action, but you might think of the correct reasoning."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "f8c8c81c-640d-42f0-b860-cb349298a87b",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "W2_Wave_animation()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "c7148d6d-8fb4-4fae-bae7-641c15c6174b",
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3 (ipykernel)",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.11.6"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}