|
32 | 32 | "metadata": {}, |
33 | 33 | "outputs": [], |
34 | 34 | "source": [ |
35 | | - "# We import everything we need for the noterbook at the start\n", |
36 | 35 | "import numpy as np\n", |
37 | 36 | "import scipy as sp\n", |
38 | 37 | "import sympy as sym\n", |
|
62 | 61 | "metadata": {}, |
63 | 62 | "outputs": [], |
64 | 63 | "source": [ |
65 | | - "# Define a function that decsribes the Ricker wavelet\n", |
66 | 64 | "def ricker(t, f=10, A=1):\n", |
67 | 65 | " trm = (np.pi * f * (t - 1 / f)) ** 2\n", |
68 | 66 | " return A * (1 - 2 * trm) * np.exp(-trm)" |
|
559 | 557 | { |
560 | 558 | "cell_type": "code", |
561 | 559 | "execution_count": 10, |
562 | | - "metadata": {}, |
| 560 | + "metadata": { |
| 561 | + "tags": [ |
| 562 | + "nbval-ignore-output" |
| 563 | + ] |
| 564 | + }, |
563 | 565 | "outputs": [ |
564 | 566 | { |
565 | 567 | "data": { |
|
860 | 862 | { |
861 | 863 | "cell_type": "code", |
862 | 864 | "execution_count": 16, |
863 | | - "metadata": {}, |
| 865 | + "metadata": { |
| 866 | + "tags": [ |
| 867 | + "nbval-ignore-output" |
| 868 | + ] |
| 869 | + }, |
864 | 870 | "outputs": [ |
865 | 871 | { |
866 | 872 | "name": "stdout", |
|
880 | 886 | } |
881 | 887 | ], |
882 | 888 | "source": [ |
883 | | - "# This cost function optimises the Coefficients for agreement in Fourier\n", |
884 | | - "# space as per the work of Tam and Webb, Caunt\n", |
885 | 889 | "def objective(a):\n", |
886 | 890 | " x = np.linspace(0, np.pi/2, 201)\n", |
887 | 891 | " m = np.arange(1, len(a) + 1)\n", |
|
903 | 907 | { |
904 | 908 | "cell_type": "code", |
905 | 909 | "execution_count": 17, |
906 | | - "metadata": {}, |
| 910 | + "metadata": { |
| 911 | + "tags": [ |
| 912 | + "nbval-ignore-output" |
| 913 | + ] |
| 914 | + }, |
907 | 915 | "outputs": [ |
908 | 916 | { |
909 | 917 | "data": { |
|
1277 | 1285 | "cell_type": "markdown", |
1278 | 1286 | "metadata": {}, |
1279 | 1287 | "source": [ |
1280 | | - "We again use Sequential Least Squares Programming (SLSQP) to perform a constrained minimisation of this cost function, with the same constraints on $a_m$. Notice that we must pick a $h$ and $\\Delta t$ to optimise for." |
| 1288 | + "We again use Sequential Least Squares Programming (SLSQP) to perform a constrained minimisation of this cost function, with the same constraints on $a_m$. Notice that we must pick a $h$ and $\\Delta t$ to optimise for.\n", |
| 1289 | + "\n", |
| 1290 | + "Warning: Depending on your computer's hardware, this cell may take a long time to run!" |
1281 | 1291 | ] |
1282 | 1292 | }, |
1283 | 1293 | { |
1284 | 1294 | "cell_type": "code", |
1285 | 1295 | "execution_count": 27, |
1286 | | - "metadata": {}, |
| 1296 | + "metadata": { |
| 1297 | + "tags": [ |
| 1298 | + "nbval-ignore-output" |
| 1299 | + ] |
| 1300 | + }, |
1287 | 1301 | "outputs": [ |
1288 | 1302 | { |
1289 | 1303 | "name": "stdout", |
|
1333 | 1347 | { |
1334 | 1348 | "cell_type": "code", |
1335 | 1349 | "execution_count": 28, |
1336 | | - "metadata": {}, |
| 1350 | + "metadata": { |
| 1351 | + "tags": [ |
| 1352 | + "nbval-ignore-output" |
| 1353 | + ] |
| 1354 | + }, |
1337 | 1355 | "outputs": [ |
1338 | 1356 | { |
1339 | 1357 | "data": { |
|
1583 | 1601 | } |
1584 | 1602 | ], |
1585 | 1603 | "metadata": { |
| 1604 | + "kernelspec": { |
| 1605 | + "display_name": "Python 3 (ipykernel)", |
| 1606 | + "language": "python", |
| 1607 | + "name": "python3" |
| 1608 | + }, |
1586 | 1609 | "language_info": { |
1587 | | - "name": "python" |
| 1610 | + "codemirror_mode": { |
| 1611 | + "name": "ipython", |
| 1612 | + "version": 3 |
| 1613 | + }, |
| 1614 | + "file_extension": ".py", |
| 1615 | + "mimetype": "text/x-python", |
| 1616 | + "name": "python", |
| 1617 | + "nbconvert_exporter": "python", |
| 1618 | + "pygments_lexer": "ipython3", |
| 1619 | + "version": "3.12.7" |
1588 | 1620 | } |
1589 | 1621 | }, |
1590 | 1622 | "nbformat": 4, |
|
0 commit comments