Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168731
Image: ubuntu2004
def f(x): return(x^0.5-e(x)-1) def fp (x): return(0.5*x-0.5-e(x)) def phi1(x): return(0.5*x-0.5-e(x)) def newton1(x_start,eps): x=x_start x_old=x+10*eps while(abs(x-x_old)>eps): x_old=x x=phi1(x) return(x)
newton1(0.e-7)
__main__:14: DeprecationWarning: Substitution using function-call syntax and unnamed arguments is deprecated and will be removed from a future release of Sage; you can use named arguments instead, like EXPR(x=..., y=...)
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_3.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("bmV3dG9uMSgwLjEsMS5lLTcp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmpOXNqvg/___code___.py", line 3, in <module> exec compile(u'newton1(_sage_const_0p1 ,_sage_const_1pen7 )' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmpXSjuDM/___code___.py", line 14, in newton1 x=phi1(x) File "/tmp/tmpXSjuDM/___code___.py", line 8, in phi1 return(_sage_const_0p5 *x-_sage_const_0p5 -e(x)) File "expression.pyx", line 3486, in sage.symbolic.expression.Expression.__call__ (sage/symbolic/expression.cpp:16046) File "ring.pyx", line 638, in sage.symbolic.ring.SymbolicRing._call_element_ (sage/symbolic/ring.cpp:6584) ValueError: the number of arguments must be less than or equal to 0