Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168697
Image: ubuntu2004
def symbolic_function(variables, *args, **kwds): def result(f): def evalf_func(self,x,parent=None): if parent == None: return f(x) else: return parent(f(x)) return function(f.__name__, variables, evalf_func=evalf_func, *args, **kwds).operator() return result
@symbolic_function(x) def steps(x): if x < 0: return -x elif x < 3: return x else: return 3
steps(5)
steps(5)\renewcommand{\Bold}[1]{\mathbf{#1}}{\rm steps}\left(5\right)
n(steps(5))
3.00000000000000\renewcommand{\Bold}[1]{\mathbf{#1}}3.00000000000000
plot(steps(x),(x,-3,6))