Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168758
Image: ubuntu2004
import csv,string,sympy from numpy import array import time t1=time.clock() file_to_read = file(DATA+'data2','r') read_from = csv.reader(file_to_read,delimiter='\t') read_from.next() datalist = [ map(float, row[:]) for row in read_from ] # now the real data data = array(datalist, dtype = float) elapsed=time.clock()-t1 print elapsed data var("b n x y") model(x) = 1.375640e-1-exp(-b*x**n) find_fit(data, model) model.subs( find_fit(data, model, solution_dict=True) )
0.0 x |--> -e^(-0.0706704084976261*x^1.60634074116379) + 0.137564000000000
digits=100 z(x)=model.subs( find_fit(data, model, solution_dict=True) ) plot(z(x), (5,20))
maxima.plot_list(data)
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/sage/sagenb/sage_notebook/worksheets/chelovek/2/code/266.py", line 6, in <module> exec compile(ur'maxima.plot_list(data)' + '\n', '', 'single') File "", line 1, in <module> TypeError: plot_list() takes at least 3 arguments (2 given)