Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 59 additions & 59 deletions notebooks/user_guide.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2655,6 +2655,65 @@
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"#### Line flow\n",
"\n",
"The line flow is derived from the line speed and line density. It is used to determine the flow at a measurement line $l$. The values of individuals are weighted based on the proportion of the total length of the line $w$ to the length of the intersection between the line and the Voronoi cell $w_i(t)$.\n",
"The flow at the line is defined as:\n",
"\n",
"$$\n",
"j_\\text{line}(t) = \\sum_{{i | A_i(t) \\cap l \\neq \\emptyset}} v_i(t) \\cdot n_l \\cdot \\frac{1}{A_i(t)} \\cdot \\frac{w_i(t)}{w}\n",
"$$\n",
"\n",
"The line flow only includes the speed orthogonal to the line. Therefore, the speed of the pedestrians $v_i(t)$ is multiplied by the normal vector of the measuring line $n_l$.\n",
"\n",
"The line flow can also be used when pedestrians are approaching the line from both sides. In this case it is possible to analyze the data of both \"species\". In this example there will be only one species as the line is only approached from one side. \n",
"\n",
"For further details check out [this](fundamental_diagram_at_measurement_line) Notebook."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from pedpy import compute_line_flow\n",
"\n",
"line_flow = compute_line_flow(\n",
" individual_voronoi_polygons=individual_cutoff,\n",
" species=species,\n",
" measurement_line=measurement_line,\n",
" individual_speed=individual_speed_single_sided,\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": [
"hide-input"
]
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"\n",
"from pedpy import plot_flow_at_line\n",
"\n",
"fig = plt.figure()\n",
"plot_flow_at_line(flow_at_line=line_flow, title=\"Flow at line\")\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down Expand Up @@ -3171,65 +3230,6 @@
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"#### Line flow\n",
"\n",
"The line flow is derived from the line speed and line density. It can is used to determine the flow at a measurement line $l$. The values of individuals are weighted based on the proportion of the total length of the line $w$ to the length of the intersection between the line and the Voronoi cell $w_i(t)$.\n",
"The flow at the line is defined as:\n",
"\n",
"$$\n",
"j_\\text{line}(t) = \\sum_{{i | A_i(t) \\cap l \\neq \\emptyset}} v_i(t) \\cdot n_l \\cdot \\frac{1}{A_i(t)} \\cdot \\frac{w_i(t)}{w}\n",
"$$\n",
"\n",
"The line flow only includes the speed orthogonal to the line. Therefore, the speed of the pedestrians $v_i(t)$ is multiplied by the normal vector of the measuring line $n_l$.\n",
"\n",
"The line flow can also be used when pedestrians are approaching the line from both sides.In this case it is possible to analyze the data of both \"species\". In this example there will be only one species as the line is only approached from one side. \n",
"\n",
"For further details check out [this](fundamental_diagram_at_measurement_line) Notebook."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from pedpy import compute_line_flow\n",
"\n",
"line_flow = compute_line_flow(\n",
" individual_voronoi_polygons=individual_cutoff,\n",
" species=species,\n",
" measurement_line=measurement_line,\n",
" individual_speed=individual_speed_single_sided,\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"tags": [
"hide-input"
]
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"\n",
"from pedpy import plot_flow_at_line\n",
"\n",
"fig = plt.figure()\n",
"plot_flow_at_line(flow_at_line=line_flow, title=\"Flow at line\")\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down