{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# MuMoT test notebook for using letters from the Greek alphabet" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This notebook tests some basic functionality of MuMoT when reactants and rates are Greek letters (with Greek indices). The analysis is based on the honeybee stop-signal model (Seeley et al. (2012) & Pais et al. (2013)) studied in more detail in the user manual. " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import mumot\n", "\n", "mumot.__version__" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "model1 = mumot.parseModel(r\"\"\"\n", "U -> \\alpha : g_1\n", "U -> \\Gamma_\\beta : g_2\n", "\\alpha -> U : a_1\n", "\\Gamma_\\beta -> U : a_2\n", "\\alpha + U -> \\alpha + \\alpha : r_1\n", "\\Gamma_\\beta + U -> \\Gamma_\\beta + \\Gamma_\\beta : r_2\n", "\\alpha + \\Gamma_\\beta -> \\alpha + U : \\sigma\n", "\\alpha + \\Gamma_\\beta -> \\Gamma_\\beta + U : \\sigma\n", "\"\"\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "int1 = model1.integrate(showStateVars=['\\\\alpha', '\\\\Gamma_\\\\beta', 'U'],\n", " initWidgets={'maxTime':[10,5,50,1], \n", " 'initialState':{'U': [0.5,0,1,0.01],'\\\\Gamma_\\\\beta': [0.5,0,1,0.1],'\\\\alpha': [0,0,1,0.1]},\n", " 'g_{1}':[0.5,0,1,0.01]},\n", " \n", " conserved=True)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "int1.showLogs()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "model2 = model1.substitute('a_1 = 1/v_1, a_2 = 1/v_2, g_1 = v_1, g_2 = v_2, r_1 = v_1, r_2 = v_2')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "model3 = model2.substitute('v_1 = \\\\mu + \\\\Delta/2, v_2 = \\\\mu - \\\\Delta/2')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "model3.showODEs()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "model3.show()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "model4 = model3.substitute('U = N - \\\\alpha - \\\\Gamma_\\\\beta')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "modelBifCont1 = model4.bifurcation('\\\\sigma','\\\\alpha-\\\\Gamma_\\\\beta', \n", " initWidgets={'mu':[3, 1, 5, 0.5], 'Delta':[0, 0, 2, 0.1], \n", " 'initBifParam':[4.8, 3, 5, 0.1]},\n", " choose_xrange=[0, 5])" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "modelStreamCont1 = model4.stream('\\\\alpha', '\\\\Gamma_\\\\beta',fontsize=25, xlab=r'this is the x-label', \n", " showFixedPoints=False, showNoise=False)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "model4.SSA()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "model4.showODEs(method='vanKampen')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "model4.showMasterEquation()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "model4.showFokkerPlanckEquation()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": false }, "outputs": [], "source": [ "model4.showVanKampenExpansion()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.5.4" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }