<commit_before>{
  "cells": [
    {
      "cell_type": "markdown",
      "source": [
        "<a id=\"topcell\"></a>\n",
        "\n",
        "# COMBINE Archive Basics\n",
        "\n",
        "Tellurium offers the ability to edit entire COMBINE archives within notebook cells. This notebook shows some basic examples of COMBINE archives and how to use them in Tellurium. You can export any of these examples by clicking the diskette icon in the upper right part of the cell.\n",
        "\n",
        "## OMEX cells\n",
        "\n",
        "### About\n",
        "\n",
        "In Tellurium, a special type of IPython cell exists for Combine archives (i.e. the Open Modeling EXchange format, OMEX). It is denoted by a small Combine archive icon next to the execution counter in the upper left corner of the cell. \n",
        "\n",
        "### Creating\n",
        "\n",
        "A Combine archive cell may be created by importing from a Combine archive on disk. Move the mouse past the last cell in a notebook to show the cell creator bar. Click on the \"Import\" button, and choose \"Import Combine archive...\". Alternatively, simply click \"New\" -> \"Combine archive\" to create an empty Combine archive cell.\n",
        "\n",
        "# Contents\n",
        "\n",
        "### [Example 1: Basic demo](#basicdemo)\n",
        "\n",
        "### [Example 2: Dual Simulations](#dualdemo)\n",
        "\n",
        "### [Example 3: Stochastic Ensemble](#ensemble)\n",
        "\n",
        "### [Example 4: Phase plot](#phaseplot)\n",
        "\n### [Example 5: Parameter scanning](#paramscan)"
      ],
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "<a id=\"basicdemo\"></a>\n",
        "\n",
        "# Example 1: Basic demo\n",
        "\n",
        "The example shows a minimal Combine archive containing an SBML model (myModel) representing conversion of species S1 to S2, a single timecourse simulation, and a plot.\n",
        "\n### [Back to top](#topcell)"
      ],
      "metadata": {}
    },
    {
      "cell_type": "code",
      "source": [
        "// -- Begin Antimony block\n",
        "model *myModel()\n",
        "  // Compartments and Species:\n",
        "  species S1, S2;\n",
        "\n",
        "  // Reactions:\n",
        "  _J0: S1 -> S2; k1*S1;\n",
        "\n",
        "  // Species initializations:\n",
        "  S1 = 10;\n",
        "  S2 = 0;\n",
        "\n",
        "  // Variable initializations:\n",
        "  k1 = 1;\n",
        "\n",
        "  // Other declarations:\n",
        "  const k1;\n",
        "end\n",
        "// -- End Antimony block\n",
        "\n",
        "// -- Begin PhraSEDML block\n",
        "// Models\n",
        "model1 = model \"myModel\"\n",
        "\n",
        "// Simulations\n",
        "sim1 = simulate uniform(0, 5, 100)\n",
        "\n",
        "// Tasks\n",
        "task1 = run sim1 on model1\n",
        "\n",
        "// Outputs\n",
        "plot \"Figure 1\" time vs S1, S2\n",
        "// -- End PhraSEDML block"
      ],
      "outputs": [],
      "execution_count": 1,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false,
        "tellurium": {
          "te_cell_type": "omex"
        }
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "<a id=\"dualdemo\"></a>\n",
        "\n",
        "# Example 2: Dual Simulations\n",
        "\n",
        "This example plots a deterministic simulation and a stochastic simulation of the same system.\n",
        "\n### [Back to top](#topcell)"
      ],
      "metadata": {}
    },
    {
      "cell_type": "code",
      "source": [
        "// SBML Part\n",
        "model *myModel()\n",
        "  // Reactions:\n",
        "  J0: A -> B; k*A;\n",
        "  A = 10;\n",
        "  k = 1;\n",
        "end\n",
        "// SED-ML Part\n",
        "// Models\n",
        "model1 = model \"myModel\"\n",
        "// Simulations\n",
        "simulation1 = simulate uniform(0, 5, 100)\n",
        "simulation2 = simulate uniform_stochastic(0, 5, 100)\n",
        "// Tasks\n",
        "task1 = run simulation1 on model1\n",
        "task2 = run simulation2 on model1\n",
        "// Outputs\n",
        "plot \"Deterministic Solution\" task1.time vs task1.A, task1.B\n",
        "plot \"Stochastic Solution\" task2.time vs task2.A, task2.B"
      ],
      "outputs": [],
      "execution_count": 2,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false,
        "tellurium": {
          "te_cell_type": "omex"
        }
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "<a id=\"ensemble\"></a>\n",
        "\n",
        "# Example 3: Stochastic Ensemble\n",
        "\n",
        "This example uses a repeated task to run multiple copies of a stochastic simulation, then plots the ensemble.\n",
        "\n### [Back to top](#topcell)"
      ],
      "metadata": {}
    },
    {
      "cell_type": "code",
      "source": [
        "// SBML Part\n",
        "model *myModel()\n",
        "  // Reactions:\n",
        "  J0: A -> B; k*A;\n",
        "  A = 100;\n",
        "  k = 1;\n",
        "end\n",
        "// SED-ML Part\n",
        "// Models\n",
        "model1 = model \"myModel\"\n",
        "// Simulations\n",
        "simulation1 = simulate uniform_stochastic(0, 5, 100)\n",
        "// Tasks\n",
        "task1 = run simulation1 on model1\n",
        "repeat1 = repeat task1 for \\\n",
        "  local.x in uniform(0,25,25), reset=True\n",
        "// Outputs\n",
        "plot \"Stochastic Ensemble\" repeat1.time vs repeat1.A, repeat1.B"
      ],
      "outputs": [],
      "execution_count": 3,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false,
        "tellurium": {
          "te_cell_type": "omex"
        }
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "<a id=\"phaseplot\"></a>\n",
        "\n",
        "# Example 4: Phase plot\n",
        "\n",
        "In addition to timecourse plots, SED-ML can also be used to create phase portraits. This is useful to show the presenence (or absence, in this case) of limit cycles. Here, we use the well-known Lorenz attractor to show this feature.\n",
        "\n### [Back to top](#topcell)"
      ],
      "metadata": {}
    },
    {
      "cell_type": "code",
      "source": [
        "// -- Begin Antimony block\n",
        "model *lorenz()\n",
        "  // Rate Rules:\n",
        "  x' = sigma*(y - x);\n",
        "  y' = x*(rho - z) - y;\n",
        "  z' = x*y - beta*z;\n",
        "\n",
        "  // Variable initializations:\n",
        "  x = 0.96259;\n",
        "  sigma = 10;\n",
        "  y = 2.07272;\n",
        "  rho = 28;\n",
        "  z = 18.65888;\n",
        "  beta = 2.67;\n",
        "\n",
        "  // Other declarations:\n",
        "  var x, y, z;\n",
        "  const sigma, rho, beta;\n",
        "end\n",
        "// -- End Antimony block\n",
        "\n",
        "// -- Begin PhraSEDML block\n",
        "// Models\n",
        "model1 = model \"lorenz\"\n",
        "\n",
        "// Simulations\n",
        "sim1 = simulate uniform(0, 15, 2000)\n",
        "\n",
        "// Tasks\n",
        "task1 = run sim1 on model1\n",
        "\n",
        "// Outputs\n",
        "plot \"Phase Plot\" z vs x\n",
        "// -- End PhraSEDML block"
      ],
      "outputs": [],
      "execution_count": 4,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false,
        "tellurium": {
          "te_cell_type": "omex"
        }
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "<a id=\"paramscan\"></a>\n",
        "\n",
        "# Example 5: Parameter scanning\n",
        "\n",
        "Through the use of repeated tasks, SED-ML can be used to scan through parameter values. This example shows how to scan through a set of predefined values for a kinetic parameter (**J1_KK2**).\n",
        "\n### [Back to top](#topcell)"
      ],
      "metadata": {}
    },
    {
      "cell_type": "code",
      "source": [
        "// -- Begin Antimony block\n",
        "model *MAPKcascade()\n",
        "  // Compartments and Species:\n",
        "  compartment compartment_;\n",
        "  species MKKK in compartment_, MKKK_P in compartment_, MKK in compartment_;\n",
        "  species MKK_P in compartment_, MKK_PP in compartment_, MAPK in compartment_;\n",
        "  species MAPK_P in compartment_, MAPK_PP in compartment_;\n",
        "\n",
        "  // Reactions:\n",
        "  J0: MKKK => MKKK_P; J0_V1*MKKK/((1 + (MAPK_PP/J0_Ki)^J0_n)*(J0_K1 + MKKK));\n",
        "  J1: MKKK_P => MKKK; J1_V2*MKKK_P/(J1_KK2 + MKKK_P);\n",
        "  J2: MKK => MKK_P; J2_k3*MKKK_P*MKK/(J2_KK3 + MKK);\n",
        "  J3: MKK_P => MKK_PP; J3_k4*MKKK_P*MKK_P/(J3_KK4 + MKK_P);\n",
        "  J4: MKK_PP => MKK_P; J4_V5*MKK_PP/(J4_KK5 + MKK_PP);\n",
        "  J5: MKK_P => MKK; J5_V6*MKK_P/(J5_KK6 + MKK_P);\n",
        "  J6: MAPK => MAPK_P; J6_k7*MKK_PP*MAPK/(J6_KK7 + MAPK);\n",
        "  J7: MAPK_P => MAPK_PP; J7_k8*MKK_PP*MAPK_P/(J7_KK8 + MAPK_P);\n",
        "  J8: MAPK_PP => MAPK_P; J8_V9*MAPK_PP/(J8_KK9 + MAPK_PP);\n",
        "  J9: MAPK_P => MAPK; J9_V10*MAPK_P/(J9_KK10 + MAPK_P);\n",
        "\n",
        "  // Species initializations:\n",
        "  MKKK = 90;\n",
        "  MKKK_P = 10;\n",
        "  MKK = 280;\n",
        "  MKK_P = 10;\n",
        "  MKK_PP = 10;\n",
        "  MAPK = 280;\n",
        "  MAPK_P = 10;\n",
        "  MAPK_PP = 10;\n",
        "\n",
        "  // Compartment initializations:\n",
        "  compartment_ = 1;\n",
        "\n",
        "  // Variable initializations:\n",
        "  J0_V1 = 2.5;\n",
        "  J0_Ki = 9;\n",
        "  J0_n = 1;\n",
        "  J0_K1 = 10;\n",
        "  J1_V2 = 0.25;\n",
        "  J1_KK2 = 8;\n",
        "  J2_k3 = 0.025;\n",
        "  J2_KK3 = 15;\n",
        "  J3_k4 = 0.025;\n",
        "  J3_KK4 = 15;\n",
        "  J4_V5 = 0.75;\n",
        "  J4_KK5 = 15;\n",
        "  J5_V6 = 0.75;\n",
        "  J5_KK6 = 15;\n",
        "  J6_k7 = 0.025;\n",
        "  J6_KK7 = 15;\n",
        "  J7_k8 = 0.025;\n",
        "  J7_KK8 = 15;\n",
        "  J8_V9 = 0.5;\n",
        "  J8_KK9 = 15;\n",
        "  J9_V10 = 0.5;\n",
        "  J9_KK10 = 15;\n",
        "\n",
        "  // Other declarations:\n",
        "  const compartment_, J0_V1, J0_Ki, J0_n, J0_K1, J1_V2, J1_KK2, J2_k3, J2_KK3;\n",
        "  const J3_k4, J3_KK4, J4_V5, J4_KK5, J5_V6, J5_KK6, J6_k7, J6_KK7, J7_k8;\n",
        "  const J7_KK8, J8_V9, J8_KK9, J9_V10, J9_KK10;\n",
        "end\n",
        "// -- End Antimony block\n",
        "\n",
        "// -- Begin PhraSEDML block\n",
        "// Models\n",
        "model1 = model \"MAPKcascade\"\n",
        "\n",
        "// Simulations\n",
        "sim1 = simulate uniform(0, 4000, 1000)\n",
        "\n",
        "// Tasks\n",
        "task1 = run sim1 on model1\n",
        "\n",
        "// Repeated Tasks\n",
        "repeat1 = repeat task1 for model1.J1_KK2 in [1, 10, 40], reset=true\n",
        "\n",
        "// Outputs\n",
        "plot \"Sampled Simulation\" repeat1.time vs repeat1.MKK, repeat1.MKK_P, repeat1.MAPK_PP\n",
        "// -- End PhraSEDML block"
      ],
      "outputs": [],
      "execution_count": 5,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false,
        "tellurium": {
          "te_cell_type": "omex"
        }
      }
    }
  ],
  "metadata": {
    "kernelspec": {
      "name": "python3",
      "language": "python",
      "display_name": "Python 3"
    },
    "kernel_info": {
      "name": "python3"
    },
    "language_info": {
      "name": "python",
      "version": "3.6.1",
      "mimetype": "text/x-python",
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "pygments_lexer": "ipython3",
      "nbconvert_exporter": "python",
      "file_extension": ".py"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 4
}<commit_msg>improve omex examples<commit_after>{
  "cells": [
    {
      "cell_type": "markdown",
      "source": [
        "<a id=\"topcell\"></a>\n",
        "\n",
        "# COMBINE Archive Basics\n",
        "\n",
        "Tellurium offers the ability to embed entire COMBINE archives within notebook cells. These *inline OMEX* cells are represented in a human-readable format that can be easily edited by hand. \n",
        "\n",
        "This notebook shows some basic examples of COMBINE archives and how to use them in Tellurium. You can export any of these examples by clicking on the diskette icon in the upper right part of the cell.\n",
        "\n",
        "## OMEX cells\n",
        "\n",
        "### About\n",
        "\n",
        "In Tellurium, a special type of IPython cell exists for Combine archives (a.k.a. the Open Modeling EXchange format, OMEX). It is denoted by a small Combine archive icon next to the execution counter in the upper left corner of the cell. \n",
        "\n",
        "### Creating\n",
        "\n",
        "A Combine archive cell may be created by importing from a Combine archive on disk. Move the mouse past the last cell in a notebook to show the cell creator bar. Click on the \"Import\" button, and choose \"Import Combine archive...\". Alternatively, simply click \"New\" -> \"Combine archive\" to create an empty Combine archive cell.\n",
        "\n",
        "# Contents\n",
        "\n",
        "### [Example 1: Basic demo](#basicdemo)\n",
        "\n",
        "### [Example 2: Dual Simulations](#dualdemo)\n",
        "\n",
        "### [Example 3: Stochastic Ensemble](#ensemble)\n",
        "\n",
        "### [Example 4: Phase plot](#phaseplot)\n",
        "\n### [Example 5: Parameter scanning](#paramscan)"
      ],
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "<a id=\"basicdemo\"></a>\n",
        "\n",
        "# Example 1: Basic demo\n",
        "\n",
        "The example shows a minimal Combine archive containing an SBML model (myModel) representing conversion of species S1 to S2, a single timecourse simulation, and a plot.\n",
        "\n### [Back to top](#topcell)"
      ],
      "metadata": {}
    },
    {
      "cell_type": "code",
      "source": [
        "// -- Begin Antimony block\n",
        "model *myModel()\n",
        "  // Compartments and Species:\n",
        "  species S1, S2;\n",
        "\n",
        "  // Reactions:\n",
        "  _J0: S1 -> S2; k1*S1;\n",
        "\n",
        "  // Species initializations:\n",
        "  S1 = 10;\n",
        "  S2 = 0;\n",
        "\n",
        "  // Variable initializations:\n",
        "  k1 = 1;\n",
        "\n",
        "  // Other declarations:\n",
        "  const k1;\n",
        "end\n",
        "// -- End Antimony block\n",
        "\n",
        "// -- Begin PhraSEDML block\n",
        "// Models\n",
        "model1 = model \"myModel\"\n",
        "\n",
        "// Simulations\n",
        "sim1 = simulate uniform(0, 5, 100)\n",
        "\n",
        "// Tasks\n",
        "task1 = run sim1 on model1\n",
        "\n",
        "// Outputs\n",
        "plot \"Figure 1\" time vs S1, S2\n",
        "// -- End PhraSEDML block"
      ],
      "outputs": [],
      "execution_count": 1,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false,
        "tellurium": {
          "te_cell_type": "omex"
        }
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "<a id=\"dualdemo\"></a>\n",
        "\n",
        "# Example 2: Dual Simulations\n",
        "\n",
        "This example plots a deterministic simulation and a stochastic simulation of the same system.\n",
        "\n### [Back to top](#topcell)"
      ],
      "metadata": {}
    },
    {
      "cell_type": "code",
      "source": [
        "// SBML Part\n",
        "model *myModel()\n",
        "  // Reactions:\n",
        "  J0: A -> B; k*A;\n",
        "  A = 10;\n",
        "  k = 1;\n",
        "end\n",
        "// SED-ML Part\n",
        "// Models\n",
        "model1 = model \"myModel\"\n",
        "// Simulations\n",
        "simulation1 = simulate uniform(0, 5, 100)\n",
        "simulation2 = simulate uniform_stochastic(0, 5, 100)\n",
        "// Tasks\n",
        "task1 = run simulation1 on model1\n",
        "task2 = run simulation2 on model1\n",
        "// Outputs\n",
        "plot \"Deterministic Solution\" task1.time vs task1.A, task1.B\n",
        "plot \"Stochastic Solution\" task2.time vs task2.A, task2.B"
      ],
      "outputs": [],
      "execution_count": 2,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false,
        "tellurium": {
          "te_cell_type": "omex"
        }
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "<a id=\"ensemble\"></a>\n",
        "\n",
        "# Example 3: Stochastic Ensemble\n",
        "\n",
        "This example uses a repeated task to run multiple copies of a stochastic simulation, then plots the ensemble.\n",
        "\n### [Back to top](#topcell)"
      ],
      "metadata": {}
    },
    {
      "cell_type": "code",
      "source": [
        "// SBML Part\n",
        "model *myModel()\n",
        "  // Reactions:\n",
        "  J0: A -> B; k*A;\n",
        "  A = 100;\n",
        "  k = 1;\n",
        "end\n",
        "// SED-ML Part\n",
        "// Models\n",
        "model1 = model \"myModel\"\n",
        "// Simulations\n",
        "simulation1 = simulate uniform_stochastic(0, 5, 100)\n",
        "// Tasks\n",
        "task1 = run simulation1 on model1\n",
        "repeat1 = repeat task1 for \\\n",
        "  local.x in uniform(0,25,25), reset=True\n",
        "// Outputs\n",
        "plot \"Stochastic Ensemble\" repeat1.time vs repeat1.A, repeat1.B"
      ],
      "outputs": [],
      "execution_count": 3,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false,
        "tellurium": {
          "te_cell_type": "omex"
        }
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "<a id=\"phaseplot\"></a>\n",
        "\n",
        "# Example 4: Phase plot\n",
        "\n",
        "In addition to timecourse plots, SED-ML can also be used to create phase portraits. This is useful to show the presenence (or absence, in this case) of limit cycles. Here, we use the well-known Lorenz attractor to show this feature.\n",
        "\n### [Back to top](#topcell)"
      ],
      "metadata": {}
    },
    {
      "cell_type": "code",
      "source": [
        "// -- Begin Antimony block\n",
        "model *lorenz()\n",
        "  // Rate Rules:\n",
        "  x' = sigma*(y - x);\n",
        "  y' = x*(rho - z) - y;\n",
        "  z' = x*y - beta*z;\n",
        "\n",
        "  // Variable initializations:\n",
        "  x = 0.96259;\n",
        "  sigma = 10;\n",
        "  y = 2.07272;\n",
        "  rho = 28;\n",
        "  z = 18.65888;\n",
        "  beta = 2.67;\n",
        "\n",
        "  // Other declarations:\n",
        "  var x, y, z;\n",
        "  const sigma, rho, beta;\n",
        "end\n",
        "// -- End Antimony block\n",
        "\n",
        "// -- Begin PhraSEDML block\n",
        "// Models\n",
        "model1 = model \"lorenz\"\n",
        "\n",
        "// Simulations\n",
        "sim1 = simulate uniform(0, 15, 2000)\n",
        "\n",
        "// Tasks\n",
        "task1 = run sim1 on model1\n",
        "\n",
        "// Outputs\n",
        "plot \"Phase Plot\" z vs x\n",
        "// -- End PhraSEDML block"
      ],
      "outputs": [],
      "execution_count": 4,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false,
        "tellurium": {
          "te_cell_type": "omex"
        }
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "<a id=\"paramscan\"></a>\n",
        "\n",
        "# Example 5: Parameter scanning\n",
        "\n",
        "Through the use of repeated tasks, SED-ML can be used to scan through parameter values. This example shows how to scan through a set of predefined values for a kinetic parameter (**J1_KK2**).\n",
        "\n### [Back to top](#topcell)"
      ],
      "metadata": {}
    },
    {
      "cell_type": "code",
      "source": [
        "// -- Begin Antimony block\n",
        "model *MAPKcascade()\n",
        "  // Compartments and Species:\n",
        "  compartment compartment_;\n",
        "  species MKKK in compartment_, MKKK_P in compartment_, MKK in compartment_;\n",
        "  species MKK_P in compartment_, MKK_PP in compartment_, MAPK in compartment_;\n",
        "  species MAPK_P in compartment_, MAPK_PP in compartment_;\n",
        "\n",
        "  // Reactions:\n",
        "  J0: MKKK => MKKK_P; J0_V1*MKKK/((1 + (MAPK_PP/J0_Ki)^J0_n)*(J0_K1 + MKKK));\n",
        "  J1: MKKK_P => MKKK; J1_V2*MKKK_P/(J1_KK2 + MKKK_P);\n",
        "  J2: MKK => MKK_P; J2_k3*MKKK_P*MKK/(J2_KK3 + MKK);\n",
        "  J3: MKK_P => MKK_PP; J3_k4*MKKK_P*MKK_P/(J3_KK4 + MKK_P);\n",
        "  J4: MKK_PP => MKK_P; J4_V5*MKK_PP/(J4_KK5 + MKK_PP);\n",
        "  J5: MKK_P => MKK; J5_V6*MKK_P/(J5_KK6 + MKK_P);\n",
        "  J6: MAPK => MAPK_P; J6_k7*MKK_PP*MAPK/(J6_KK7 + MAPK);\n",
        "  J7: MAPK_P => MAPK_PP; J7_k8*MKK_PP*MAPK_P/(J7_KK8 + MAPK_P);\n",
        "  J8: MAPK_PP => MAPK_P; J8_V9*MAPK_PP/(J8_KK9 + MAPK_PP);\n",
        "  J9: MAPK_P => MAPK; J9_V10*MAPK_P/(J9_KK10 + MAPK_P);\n",
        "\n",
        "  // Species initializations:\n",
        "  MKKK = 90;\n",
        "  MKKK_P = 10;\n",
        "  MKK = 280;\n",
        "  MKK_P = 10;\n",
        "  MKK_PP = 10;\n",
        "  MAPK = 280;\n",
        "  MAPK_P = 10;\n",
        "  MAPK_PP = 10;\n",
        "\n",
        "  // Compartment initializations:\n",
        "  compartment_ = 1;\n",
        "\n",
        "  // Variable initializations:\n",
        "  J0_V1 = 2.5;\n",
        "  J0_Ki = 9;\n",
        "  J0_n = 1;\n",
        "  J0_K1 = 10;\n",
        "  J1_V2 = 0.25;\n",
        "  J1_KK2 = 8;\n",
        "  J2_k3 = 0.025;\n",
        "  J2_KK3 = 15;\n",
        "  J3_k4 = 0.025;\n",
        "  J3_KK4 = 15;\n",
        "  J4_V5 = 0.75;\n",
        "  J4_KK5 = 15;\n",
        "  J5_V6 = 0.75;\n",
        "  J5_KK6 = 15;\n",
        "  J6_k7 = 0.025;\n",
        "  J6_KK7 = 15;\n",
        "  J7_k8 = 0.025;\n",
        "  J7_KK8 = 15;\n",
        "  J8_V9 = 0.5;\n",
        "  J8_KK9 = 15;\n",
        "  J9_V10 = 0.5;\n",
        "  J9_KK10 = 15;\n",
        "\n",
        "  // Other declarations:\n",
        "  const compartment_, J0_V1, J0_Ki, J0_n, J0_K1, J1_V2, J1_KK2, J2_k3, J2_KK3;\n",
        "  const J3_k4, J3_KK4, J4_V5, J4_KK5, J5_V6, J5_KK6, J6_k7, J6_KK7, J7_k8;\n",
        "  const J7_KK8, J8_V9, J8_KK9, J9_V10, J9_KK10;\n",
        "end\n",
        "// -- End Antimony block\n",
        "\n",
        "// -- Begin PhraSEDML block\n",
        "// Models\n",
        "model1 = model \"MAPKcascade\"\n",
        "\n",
        "// Simulations\n",
        "sim1 = simulate uniform(0, 4000, 1000)\n",
        "\n",
        "// Tasks\n",
        "task1 = run sim1 on model1\n",
        "\n",
        "// Repeated Tasks\n",
        "repeat1 = repeat task1 for model1.J1_KK2 in [1, 10, 40], reset=true\n",
        "\n",
        "// Outputs\n",
        "plot \"Sampled Simulation\" repeat1.time vs repeat1.MKK, repeat1.MKK_P, repeat1.MAPK_PP\n",
        "// -- End PhraSEDML block"
      ],
      "outputs": [],
      "execution_count": 5,
      "metadata": {
        "collapsed": false,
        "outputHidden": false,
        "inputHidden": false,
        "tellurium": {
          "te_cell_type": "omex"
        }
      }
    }
  ],
  "metadata": {
    "kernelspec": {
      "name": "python3",
      "language": "python",
      "display_name": "Python 3"
    },
    "kernel_info": {
      "name": "python3"
    },
    "language_info": {
      "name": "python",
      "version": "3.6.1",
      "mimetype": "text/x-python",
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "pygments_lexer": "ipython3",
      "nbconvert_exporter": "python",
      "file_extension": ".py"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 4
}
{'fraction_non_alphanumeric': 0.18380150570711568, 'fraction_numerical': 0.031652230227475105, 'mean_word_length': 1.6040261382799326, 'pattern_counts': {'":': 182, '<': 27, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6700993', 'n_tokens_mistral': 9515, 'n_tokens_neox': 8907, 'n_words': 2068}