Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168733
Image: ubuntu2004

Dynamique de population (sans mutations)

Matrice de transition

Trajectoires

Probabilité de fixation de l'allele A

Temps de fixation

[1] -8

Probabilité de fixation à partir des états initiaux

Probabilités de fixation d'allèle A en fonction d'état initial

Temps moyen de fixation d'allèlle A en fonction d'état initial

Probabilité invariante pour le modèle avec mutation

x = var('x') m = function('m', x) f1 = (gamma*x + delta*(1-x))*m f1.derivative(x)
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_49.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("eCA9IHZhcigneCcpCm0gPSBmdW5jdGlvbignbScsIHgpCmYxID0gKGdhbW1hKnggKyBkZWx0YSooMS14KSkqbQpmMS5kZXJpdmF0aXZlKHgp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmpurO8wH/___code___.py", line 5, in <module> f1 = (gamma*x + delta*(_sage_const_1 -x))*m File "element.pyx", line 1467, in sage.structure.element.RingElement.__mul__ (sage/structure/element.c:12217) File "coerce.pyx", line 795, in sage.structure.coerce.CoercionModel_cache_maps.bin_op (sage/structure/coerce.c:7489) TypeError: unsupported operand parent(s) for '*': '<type 'function'>' and 'Symbolic Ring'
#x = var('x') var('x,gamma,delta') m = function('m', x) DE = 2*diff(m,x)*(-delta+x*(gamma+delta-2)+1)+2*(gamma+delta-1)*m-(x-1)*x*diff(m,x,2) show(DE) solve(DE,m)
\newcommand{\Bold}[1]{\mathbf{#1}}-{\left(x - 1\right)} x D[0, 0]\left(m\right)\left(x\right) + 2 \, {\left(\delta + \gamma - 1\right)} m\left(x\right) + 2 \, {\left({\left(\delta + \gamma - 2\right)} x - \delta + 1\right)} D[0]\left(m\right)\left(x\right)
[m(x) == 1/2*((x^2 - x)*D[0, 0](m)(x) - 2*((x - 1)*delta + (gamma - 2)*x + 1)*D[0](m)(x))/(delta + gamma - 1)]
#x = var('x') var('x,gamma,delta') m = function('m',x) DE = -diff((gamma*x + delta*(1-x))*m,x,1)+(1/2)*diff(x*(1-x)*m,x,2) show(DE) solve(DE,m)
\newcommand{\Bold}[1]{\mathbf{#1}}-\frac{1}{2} \, {\left(x - 1\right)} x D[0, 0]\left(m\right)\left(x\right) - {\left(x - 1\right)} D[0]\left(m\right)\left(x\right) + {\left(\delta - \gamma\right)} m\left(x\right) + {\left({\left(x - 1\right)} \delta - \gamma x\right)} D[0]\left(m\right)\left(x\right) - x D[0]\left(m\right)\left(x\right) - m\left(x\right)
[m(x) == 1/2*((x^2 - x)*D[0, 0](m)(x) - 2*((x - 1)*delta - (gamma + 2)*x + 1)*D[0](m)(x))/(delta - gamma - 1)]
-D[(-(γ x) + δ (1 - x)) m[x], x] + (1/2) D[x (1 - x) m[x], {x, 2}] == 0
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_32.py", line 10, in <module> exec compile(u"print _support_.syseval(mathematica, u'-D[(-(\\u03b3 x) + \\u03b4 (1 - x)) m[x], x] + (1/2) D[x (1 - x) m[x], {x, 2}] == 0', __SAGE_TMP_DIR__)" + '\n', '', 'single') File "", line 1, in <module> File "/sagenb/sage_install/sage-4.7.2/devel/sagenb-git/sagenb/misc/support.py", line 478, in syseval system.chdir(dir) File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/interfaces/mathematica.py", line 578, in chdir self.eval('SetDirectory["%s"]'%dir) File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/interfaces/mathematica.py", line 491, in eval s = Expect.eval(self, code, **kwds) File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1039, in eval for L in code.split('\n') if L != '']) File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/interfaces/mathematica.py", line 539, in _eval_line allow_use_file=allow_use_file, wait_for_prompt=wait_for_prompt) File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 671, in _eval_line self._start() File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 458, in _start raise RuntimeError, "Unable to start %s"%self.name() RuntimeError: Unable to start mathematica
x = var('x') m = function('m',x) DE = -diff(2*m,x) solve(DE,m)
[D[0](m)(x) == 0]
#http://www.wolframalpha.com/input/?i=-+%28%28-gamma*x%2Bdelta*%281-x%29%29*m%28x%29%29%27%2B%281%2F2%29*%28x*%281-x%29*m%28x%29%29%27%27+%3D+0
- ((-gamma*x+delta*(1-x))*m(x))'+(1/2)*(x*(1-x)*m(x))'' = 0
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_28.py", line 10, in <module> exec compile(u'print _support_.syseval(maxima, u"- ((-gamma*x+delta*(1-x))*m(x))\'+(1/2)*(x*(1-x)*m(x))\'\' = 0", __SAGE_TMP_DIR__)' + '\n', '', 'single') File "", line 1, in <module> File "/sagenb/sage_install/sage-4.7.2/devel/sagenb-git/sagenb/misc/support.py", line 481, in syseval return system.eval(cmd, sage_globals, locals = sage_globals) File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1048, in eval raise TypeError, 'error evaluating "%s":\n%s'%(code,s) TypeError: error evaluating "- ((-gamma*x+delta*(1-x))*m(x))'+(1/2)*(x*(1-x)*m(x))'' = 0": Error executing code in Maxima CODE: - ((-gamma*x+delta*(1-x))*m(x))'+(1/2)*(x*(1-x)*m(x))'' = 0; Maxima ERROR: Illegal seek incorrect syntax: ' is not an infix operator delta*(1-x))*m(x))'+ ^
-diff((-gamma*x+delta*(1-x))*m,x,1)+(1/2)*diff(x*(1-x)*m,x,2)
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_30.py", line 10, in <module> exec compile(u"print _support_.syseval(maxima, u'solve(-diff((-gamma*x+delta*(1-x))*m,x,1)+(1/2)*diff(x*(1-x)*m,x,2))', __SAGE_TMP_DIR__)" + '\n', '', 'single') File "", line 1, in <module> File "/sagenb/sage_install/sage-4.7.2/devel/sagenb-git/sagenb/misc/support.py", line 481, in syseval return system.eval(cmd, sage_globals, locals = sage_globals) File "/sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/interfaces/expect.py", line 1048, in eval raise TypeError, 'error evaluating "%s":\n%s'%(code,s) TypeError: error evaluating "solve(-diff((-gamma*x+delta*(1-x))*m,x,1)+(1/2)*diff(x*(1-x)*m,x,2))": Error executing code in Maxima CODE: solve(-diff((-gamma*x+delta*(1-x))*m,x,1)+(1/2)*diff(x*(1-x)*m,x,2)); Maxima ERROR: More unknowns than equations - `solve' Unknowns given : [gamma,delta,m] Equations given: [-m*(-gamma-delta)-m] -- an error. To debug this try: debugmode(true);