Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
| Download
Project: LAB 4 GROUP
Path: Capstone-1(week9).ipynb
Views: 342Image: ubuntu2004
Kernel: SageMath 9.7
In [1]:
In [0]:
In [0]:
In [2]:
In [0]:
In [3]:
In [4]:
In [0]:
In [5]:
In [3]:
Out[3]:
In [5]:
In [6]:
Out[6]:
In [7]:
In [8]:
Out[8]:
In [10]:
In [11]:
Out[11]:
In [9]:
In [10]:
Out[10]:
In [0]:
In [12]:
Out[12]:
In [2]:
Out[2]:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
File /ext/sage/9.7/src/sage/plot/plot.py:3088
, in list_plot(data, plotjoined, **kwargs)
3087 from sage.rings.real_double import RDF
-> 3088 RDF(data[0])
3089 data = list(enumerate(data))
TypeError: 'zip' object is not subscriptable
During handling of the above exception, another exception occurred:
TypeError Traceback (most recent call last)
Input In [2], in <cell line: 8>()
4 sol=desolve_odeint([birthrate*N - RealNumber('0.01')*N*P, RealNumber('0.5')*RealNumber('0.01')*N*P - RealNumber('0.2')*P], ics=[Integer(100),Integer(200)],
5 dvars=[N,P], times=t)
6 return list_plot(zip(t,sol[:,Integer(1)]), legend_label ="N") + list_plot(zip(t,sol[:,Integer(0)]), color = "red", legend_label = "P")
----> 8 laziness(RealNumber('0.7'))
9 laziness(RealNumber('0.9'))
10 laziness(RealNumber('1.1'))
Input In [2], in laziness(birthrate)
3 t = srange(Integer(0),Integer(100),RealNumber('0.1'))
4 sol=desolve_odeint([birthrate*N - RealNumber('0.01')*N*P, RealNumber('0.5')*RealNumber('0.01')*N*P - RealNumber('0.2')*P], ics=[Integer(100),Integer(200)],
5 dvars=[N,P], times=t)
----> 6 return list_plot(zip(t,sol[:,Integer(1)]), legend_label ="N") + list_plot(zip(t,sol[:,Integer(0)]), color = "red", legend_label = "P")
File /ext/sage/9.7/src/sage/misc/decorators.py:491
, in options.__call__.<locals>.wrapper(*args, **kwds)
489 options['__original_opts'] = kwds
490 options.update(kwds)
--> 491 return func(*args, **options)
File /ext/sage/9.7/src/sage/plot/plot.py:3098
, in list_plot(data, plotjoined, **kwargs)
3089 data = list(enumerate(data))
3090 except TypeError: # we can get this TypeError if the element is a list
3091 # or tuple or numpy array, or an element of CC, CDF
3092 # We also want to avoid doing CC(data[0]) here since it will go
(...)
3096 # So, the only other check we need to do is whether data[0] is an
3097 # element of the Symbolic Ring.
-> 3098 if data[0] in sage.symbolic.ring.SR:
3099 data = list(enumerate(data))
3101 try:
TypeError: 'zip' object is not subscriptable
In [20]:
Out[20]:
In [0]:
In [0]:
In [0]: