Skip to content

Commit

Permalink
- add example for steady state
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergmann committed Feb 2, 2023
1 parent 3dd1e77 commit 1a00bb7
Showing 1 changed file with 69 additions and 9 deletions.
78 changes: 69 additions & 9 deletions docs/notebooks/Working_with_Reports.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,66 @@
"the value in `print_headers` indicates, whether the name of the elements will be printed in the header column. "
]
},
{
"cell_type": "markdown",
"id": "609f5f04",
"metadata": {},
"source": [
"using the `table` element directly, does only work for tasks that generate output *during* the execution of the task, as in the time course example above. Other tasks, such as steady state computation only provide results *after* the task has completed. In the following we add a report for the steady state concentration (and rate of X). We use the function `wrap_copasi_string`, to indicate that we want to have the literal string `[X]` in the header, rather than the initial concentration: "
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "18b5399b",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<CReportDefinition \"X Steady-State\">"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"add_report('X Steady-State', task=T.STEADY_STATE, \n",
" header=[wrap_copasi_string('[X]'), wrap_copasi_string('X.Rate')], \n",
" footer=['[X]', 'X.Rate'])"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "69b29e21",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'name': 'X Steady-State',\n",
" 'separator': '\\t',\n",
" 'precision': 6,\n",
" 'task': 'Steady-State',\n",
" 'comment': '',\n",
" 'is_table': False,\n",
" 'header': ['String=\\\\[X\\\\]', 'String=X.Rate'],\n",
" 'body': [],\n",
" 'footer': ['[X]', 'X.Rate']}"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"get_report_dict('X Steady-State')"
]
},
{
"cell_type": "markdown",
"id": "6742259a",
Expand All @@ -265,7 +325,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 10,
"id": "8dbe7023",
"metadata": {},
"outputs": [],
Expand All @@ -275,7 +335,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 11,
"id": "cbb20d4c",
"metadata": {},
"outputs": [
Expand All @@ -292,7 +352,7 @@
" 'table': ['Time', '[X]', 'X.Rate']}"
]
},
"execution_count": 9,
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -320,7 +380,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 12,
"id": "3d916516",
"metadata": {},
"outputs": [],
Expand All @@ -338,7 +398,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 13,
"id": "251fdf2a",
"metadata": {},
"outputs": [],
Expand All @@ -358,7 +418,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 14,
"id": "1b37f539",
"metadata": {},
"outputs": [
Expand All @@ -368,7 +428,7 @@
"'X Time-Course'"
]
},
"execution_count": 12,
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -380,7 +440,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -394,7 +454,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.5"
"version": "3.10.4"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 1a00bb7

Please sign in to comment.