{
"cells": [
{
"cell_type": "markdown",
"id": "29473a1b-493c-40a0-80b6-4873d04b9407",
"metadata": {},
"source": [
"## Diffusion of a bell-shaped initial concentration along an persistent gradient\n",
"Similar to the experiment *diffusion_along_gradient_1*, but now the gradient is NOT an initial condition; rather, it's a persistent dynamic condition (explored in experiment *gradient_1*).\n",
"\n",
"The one-chemical system starts out with a uniform concentration. \n",
"The persistent concentration gradient is attained by continuosly injecting and draining, at opposite ends.\n",
"\n",
"After a stable gradient is established, a one-time injection is performed, to\n",
"add a bell-shape concentration near one end of the system, on the \"uphill\" side of the gradient.\n",
"\n",
"Just as seen in the case of *diffusion_along_gradient_1*, the concentration peak\n",
"remains in place, and simply spreads out from there\n",
"\n",
"LAST REVISED: July 14, 2023"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "5a0abd3f-24d7-4be0-a71f-dac5335828df",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Added 'D:\\Docs\\- MY CODE\\BioSimulations\\life123-Win7' to sys.path\n"
]
}
],
"source": [
"import set_path # Importing this module will add the project's home directory to sys.path"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "9f96dbc0",
"metadata": {},
"outputs": [],
"source": [
"from src.life_1D.bio_sim_1d import BioSim1D\n",
"\n",
"import plotly.express as px\n",
"from src.modules.chemicals.chem_data import ChemData as chem"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "99ab76d6",
"metadata": {},
"outputs": [],
"source": [
"# Initialize the system with a uniform concentration (of the only species)\n",
"chem_data = chem(names=[\"A\"], diffusion_rates=[3.])\n",
"bio = BioSim1D(n_bins=200, chem_data=chem_data)\n",
"\n",
"bio.set_uniform_concentration(species_index=0, conc=150.)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "d1c3fcac-410b-4f3f-85dd-972964b7e607",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
" \n",
" "
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"hovertemplate": "Bin number=%{x}
[A]=%{y}