Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168699
Image: ubuntu2004
a,b,t = var('a b t') P=desolve_system_rk4([b,b*b*coth(a)+.5*cosh(a)],[a,b],ivar=t,ics=[0,.5,0],end_points=1) Q=[ [i,j] for i,j,k in P] LP=list_plot(Q) LP
a,b,t = var('a b t') P=desolve_odeint([b,b*b*coth(a)+.5*cosh(a)], [0,.5,0], srange(0,1,0.1), [a,b], ivar=t) P
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_33.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("YSxiLHQgPSB2YXIoJ2EgYiB0JykKdGltZXMgPSBzcmFuZ2UoMCwxLDAuMDUpCnNvbD1kZXNvbHZlX29kZWludChbYixiKmIqY290aChhKSsuNSpjb3NoKGEpXSwgWy41LDBdLCB0aW1lcywgW2EsYl0pCmRhdGEgPSB6aXAodGltZXMsIG1hcChsYW1iZGEgeDogeFswXSwgc29sKSkKcG9sYXJfbGlzdF9wbG90KGRhdGEp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmpKUhEMB/___code___.py", line 7, in <module> exec compile(u'polar_list_plot(data)' + '\n', '', 'single') File "", line 1, in <module> NameError: name 'polar_list_plot' is not defined
x,y=var('x,y') f=[x*(1-y),-y*(1-x)] sol=desolve_odeint(f,[0.5,2],srange(0,10,0.1),[x,y]) p=line(zip(sol[:,0],sol[:,1])) p.show()
a,b,t = var('a b t') offsets = [.1, .3, .5, .7, .9, 1.1] cutoffs = [1.8, 1.8,1.6,1.6,1.6,1.6] derivative = 0 plots = [] for i in range(min(len(cutoffs),len(offsets))): sol=desolve_odeint([b,.5*cosh(2*a)/(1+2*b*b*coth(a)*coth(a))], [offsets[i],derivative], srange(0,cutoffs[i],0.005), [a,b]) data = zip(srange(0,cutoffs[i],0.001), map(lambda x: x[0], sol)) plots.append(line(map(lambda d: [d[1]*cos(d[0]),d[1]*sin(d[0])], data))) image = plots[0] for p in plots[1:]: image = image + p show(image, xmin = 0)
a,b,t = var('a b t') offsets = [1.0, 1.1, 1.3, 1.5, 1.7, 1.9, 0] cutoffs = [1.6] derivative = 0 plots = [] des = [b,(sinh(a)**3)*cosh(a)/(sinh(a)*sinh(a)+2*b*b)] sol=desolve_odeint([b,.5*cosh(2*a)/(1+2*b*b*coth(a)*coth(a))], [offsets[0],derivative], srange(0,cutoffs[0],0.01), [a,b]) data = zip(srange(0,cutoffs[i],0.001), map(lambda x: x[0], sol)) plots.append(line(map(lambda d: [d[1]*cos(d[0]),d[1]*sin(d[0])], data))) show(plots[0])