diff --git a/notebooks/sir/julia.ipynb b/notebooks/sir/julia.ipynb index 34b64bbc5..e2972d4ce 100644 --- a/notebooks/sir/julia.ipynb +++ b/notebooks/sir/julia.ipynb @@ -20,7 +20,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -29,41 +29,31 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 2, "metadata": {}, "outputs": [ { - "name": "stderr", - "output_type": "stream", - "text": [ - "┌ Warning: Symbolic calculations could not initiate. Likely there's a function which is not differentiable by SymEngine.\n", - "└ @ ParameterizedFunctions C:\\Users\\Chris Rackauckas\\.julia\\dev\\ParameterizedFunctions\\src\\ode_def_opts.jl:244\n" - ] - }, - { - "ename": "ErrorException", - "evalue": "invalid redefinition of constant SIRModel", - "output_type": "error", - "traceback": [ - "invalid redefinition of constant SIRModel", - "", - "Stacktrace:", - " [1] top-level scope at C:\\Users\\Chris Rackauckas\\.julia\\dev\\ParameterizedFunctions\\src\\utils.jl:2", - " [2] top-level scope at In[10]:1" - ] + "data": { + "text/plain": [ + "#358 (generic function with 2 methods)" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ - "sir_ode = @ode_def SIRModel begin\n", - " dS = -b*S*I\n", - " dI = b*S*I-g*I\n", - " dR = g*I\n", + "sir_ode = @ode_def begin\n", + " ds = -b*s*i\n", + " di = b*s*i-g*i\n", + " dr = g*i\n", "end b g" ] }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -72,7 +62,7 @@ "(0.0, 200.0)" ] }, - "execution_count": 11, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -85,7 +75,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -96,7 +86,7 @@ "u0: [0.99, 0.01, 0.0]" ] }, - "execution_count": 12, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -107,7 +97,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -171,7 +161,7 @@ " [0.20984, 0.0144731, 0.775687] " ] }, - "execution_count": 13, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -189,16 +179,33 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 6, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/html": [ + " \n" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "using Plots" ] }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -207,134 +214,134 @@ "\n", "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", "\n", - " \n", + " \n", " \n", " \n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", + "\n", "0\n", "\n", - "\n", + "\n", "50\n", "\n", - "\n", + "\n", "100\n", "\n", - "\n", + "\n", "150\n", "\n", - "\n", + "\n", "200\n", "\n", - "\n", + "\n", "0.00\n", "\n", - "\n", + "\n", "0.25\n", "\n", - "\n", + "\n", "0.50\n", "\n", - "\n", + "\n", "0.75\n", "\n", - "\n", + "\n", "1.00\n", "\n", - "\n", + "\n", "Time\n", "\n", - "\n", + "\n", "Number\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "S(t)\n", + "\n", + "s(t)\n", "\n", - "\n", - "\n", - "I(t)\n", + "\n", + "i(t)\n", "\n", - "\n", - "\n", - "R(t)\n", + "\n", + "r(t)\n", "\n", "\n" ] }, - "execution_count": 15, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -988,7 +995,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -1052,7 +1059,7 @@ " [0.20984, 0.0144731, 0.775687] " ] }, - "execution_count": 16, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" }