{ "cells": [ { "cell_type": "markdown", "id": "0f1fbed2", "metadata": {}, "source": [ "## Exploring reaching equilibrium, first on a shorter timescale and then a longer one \n", "### (but both with identical time steps.)\n", "\n", "The system starts out with a \"concentration pulse\" in bin 2 (the 3rd bin from the left) - i.e. that bin is initially the only one with a non-zero concentration of the only chemical species.\n", "\n", "Notice the diffusing pulse \"bouncing\" off the left wall after total time 30.\n", "\n", "Then the system is left undisturbed, and followed to equilibrium." ] }, { "cell_type": "markdown", "id": "a3aae8c3-6fb0-449b-9977-1505838e5330", "metadata": {}, "source": [ "### TAGS : \"diffusion 1D\", \"basic\"" ] }, { "cell_type": "code", "execution_count": 1, "id": "7e006be5-d9eb-48ed-9f44-07577e4a9629", "metadata": {}, "outputs": [], "source": [ "LAST_REVISED = \"May 2, 2025\"\n", "LIFE123_VERSION = \"1.0.0rc3\" # Library version this experiment is based on" ] }, { "cell_type": "code", "execution_count": 2, "id": "0c06c6dc-a14a-4798-b9a9-ed383a47d2c8", "metadata": {}, "outputs": [], "source": [ "#import set_path # Using MyBinder? Uncomment this before running the next cell!" ] }, { "cell_type": "code", "execution_count": 3, "id": "b72ad9b1", "metadata": { "tags": [] }, "outputs": [], "source": [ "#import sys\n", "#sys.path.append(\"C:/some_path/my_env_or_install\") # CHANGE to the folder containing your venv or libraries installation!\n", "# NOTE: If any of the imports below can't find a module, uncomment the lines above, or try: import set_path \n", "\n", "from life123 import BioSim1D, ChemData, check_version" ] }, { "cell_type": "code", "execution_count": 4, "id": "9c7bc97f-257b-4e77-a58f-2bed0bb4ed25", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "OK\n" ] } ], "source": [ "check_version(LIFE123_VERSION)" ] }, { "cell_type": "code", "execution_count": null, "id": "a78e0e35-61f5-402a-96a8-4b2ea92840fb", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 5, "id": "0cb73921", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "SYSTEM STATE at Time t = 0:\n", "10 bins and 1 chemical species:\n" ] }, { "data": { "text/html": [ "
| \n", " | Species | \n", "Diff rate | \n", "Bin 0 | \n", "Bin 1 | \n", "Bin 2 | \n", "Bin 3 | \n", "Bin 4 | \n", "Bin 5 | \n", "Bin 6 | \n", "Bin 7 | \n", "Bin 8 | \n", "Bin 9 | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | \n", "Chemical 1 | \n", "0.1 | \n", "0.0 | \n", "0.0 | \n", "10.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "