{ "cells": [ { "cell_type": "markdown", "id": "ae6b41c6-4d22-4b8c-a2ea-56bab06cd6a2", "metadata": {}, "source": [ "# Test d1d2 function" ] }, { "cell_type": "code", "execution_count": null, "id": "d4a44f1a-91ca-4a3b-9ae0-db3b71c44adc", "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", "import timflow.transient as tft" ] }, { "cell_type": "code", "execution_count": null, "id": "71faea22-e475-4c89-b56f-1042293807bc", "metadata": {}, "outputs": [], "source": [ "ml1 = tft.ModelMaq(\n", " kaq=10, z=[11, 10, 0], c=100, Saq=0.001, topboundary=\"semi\", tmin=1, tmax=10\n", ")\n", "ls1 = tft.River(model=ml1, x1=-100, y1=0, x2=100, y2=0, tsandh=[(0, 1)])\n", "ml1.solve()" ] }, { "cell_type": "code", "execution_count": null, "id": "8fac8a40-95d5-4b63-997c-deaa29f58491", "metadata": {}, "outputs": [], "source": [ "ml2 = tft.ModelMaq(\n", " kaq=10, z=[11, 10, 0], c=100, Saq=0.001, topboundary=\"semi\", tmin=1, tmax=10\n", ")\n", "ls2 = tft.RiverHo(model=ml2, x1=-100, y1=0, x2=100, y2=0, tsandh=[(0, 1)], order=0)\n", "ml2.solve()" ] }, { "cell_type": "code", "execution_count": null, "id": "73d0e061-1f5b-4e1b-9914-074d7ef447b7", "metadata": {}, "outputs": [], "source": [ "ylim = 30 * ml1.aq.lababs.item()\n", "N = 100\n", "x = np.zeros(N)\n", "y = np.linspace(0, ylim, N)\n", "h1 = ml1.headalongline(x, y, 10).squeeze()\n", "h2 = ml2.headalongline(x, y, 10).squeeze()\n", "plt.semilogx(y[1:], h1[1:])\n", "plt.semilogx(y[1:], h1[1:], \"--\")" ] }, { "cell_type": "markdown", "id": "8bea397d-e819-45a5-8df7-7c3bdbe081b4", "metadata": {}, "source": [ "Head goes to zero at 30 times largest lambda" ] }, { "cell_type": "code", "execution_count": null, "id": "057ee390-575a-4a54-ab30-60797d2ea936", "metadata": {}, "outputs": [], "source": [ "ml1.head(0, ylim - 1e-6, 10), ml2.head(0, ylim, 10)" ] }, { "cell_type": "code", "execution_count": null, "id": "ef80e9a9-5b33-4ebc-a05e-58d56918c21d", "metadata": {}, "outputs": [], "source": [ "ml2.head(0, ylim - 1e-6, 10), ml2.head(0, ylim, 10)" ] } ], "metadata": { "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 5 }