CoCalc Public Files2020-11-05-233707.ipynb
Author: Anh Trinh
Views : 38
Compute Environment: Ubuntu 20.04 (Default)
In [1]:
#F.E. 2.3.3
#a
plot_1=plot(6*x^5, (x, 1.5, 2.5), color="blue")
plot_2=plot(480*x-768, (x, 1.5, 2.5), color="green")
plot_1+plot_2

In [2]:
#b
plot_b=plot(7*x^3+2, (x, 3, 4), color="purple")
plot_b2=plot(257*x-597.375, (x, 3, 4), color="orange")
plot_b+plot_b2

In [3]:
#c
plot_c=plot(sin, (x, -3.5, -2.5), color="red")
plot_c2=plot(-0.989*x-3.107, (x, -3.5, -2.5), color="brown")
plot_c+plot_c2

In [3]:
#d
plot_d=plot(sin(ln(x^3+1)), (x, 3.5, 4.5), color="pink")
plot_d2=plot(-0.378*x+0.652, (x, 3.5, 4.5), color="black")
plot_d+plot_d2

In [20]:
#EX 2.4.4
p=plot(x^2, (x,-10,10), ymin=-10, ymax=10)
plot_point=point([2,4], color="blue")
p+plot_point

In [21]:
#EX 2.4.4
p=plot(x^2, (x,-5,5), ymin=-5, ymax=5)
plot_point=point([2,4], color="blue")
p+plot_point

In [23]:
#EX 2.4.4
p=plot(x^2, (x,-1,2), ymin=-1, ymax=5)
plot_point=point([2,4], color="blue")
p+plot_point

In [24]:
#EX 2.4.4
p=plot(x^2, (x,0,2), ymin=0, ymax=5)
plot_point=point([2,4], color="blue")
p+plot_point

In [25]:
#EX 2.4.4
p=plot(x^2, (x,1.5,2.5), ymin=-1, ymax=5)
plot_point=point([2,4], color="blue")
p+plot_point

In [30]:
#EX 2.4.7
p=plot(abs(x), (x,-10,10), ymin=0, ymax=10)
show(p)

In [31]:
#EX 2.4.7
p=plot(abs(x), (x,-5,5), ymin=0, ymax=5)
show(p)

In [35]:
#EX 2.4.7
p=plot(abs(x), (x,-1,1), ymin=0, ymax=0.5)
show(p)

In [36]:
#EX 2.4.7
p=plot(abs(x), (x,-0.5,0.5), ymin=0, ymax=0.1)
show(p)

In [4]:
plot_c=plot(sin, (x, -10, 10), color="red")
plot_c

In [5]:
plot_c=plot(sin(x), (x, -10, 10), color="red")

--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-5-dbb103d34b56> in <module>() ----> 1 plot_c=plot(sin(x), (x, -Integer(10), -Integer(10)), color="red") /ext/sage/sage-9.1/local/lib/python3.7/site-packages/sage/misc/decorators.py in wrapper(*args, **kwds) 491 options['__original_opts'] = kwds 492 options.update(kwds) --> 493 return func(*args, **options) 494 495 #Add the options specified by @options to the signature of the wrapped /ext/sage/sage-9.1/local/lib/python3.7/site-packages/sage/plot/plot.py in plot(funcs, *args, **kwds) 1958 1959 if hasattr(funcs, 'plot'): -> 1960 G = funcs.plot(*args, **original_opts) 1961 1962 # If we have extra keywords already set, then update them /ext/sage/sage-9.1/local/lib/python3.7/site-packages/sage/symbolic/expression.pyx in sage.symbolic.expression.Expression.plot (build/cythonized/sage/symbolic/expression.cpp:63573)() 12100 except NotImplementedError: 12101 return self.function(param) > 12102 return plot(f, *args, **kwds) 12103 12104 def _plot_fast_callable(self, *vars): /ext/sage/sage-9.1/local/lib/python3.7/site-packages/sage/misc/decorators.py in wrapper(*args, **kwds) 491 options['__original_opts'] = kwds 492 options.update(kwds) --> 493 return func(*args, **options) 494 495 #Add the options specified by @options to the signature of the wrapped /ext/sage/sage-9.1/local/lib/python3.7/site-packages/sage/plot/plot.py in plot(funcs, *args, **kwds) 1977 # if there is one extra arg, then it had better be a tuple 1978 elif n == 1: -> 1979 G = _plot(funcs, *args, **kwds) 1980 elif n == 2: 1981 # if there are two extra args, then pull them out and pass them as a tuple /ext/sage/sage-9.1/local/lib/python3.7/site-packages/sage/plot/plot.py in _plot(funcs, xrange, parametric, polar, fill, label, randomize, **options) 2093 orig_funcs = funcs # keep the original functions (for use in legend labels) 2094 excluded_points = [] -> 2095 funcs, ranges = setup_for_eval_on_grid(funcs, [xrange], options['plot_points']) 2096 xmin, xmax, delta = ranges[0] 2097 xrange=ranges[0][:2] /ext/sage/sage-9.1/local/lib/python3.7/site-packages/sage/plot/misc.py in setup_for_eval_on_grid(funcs, ranges, plot_points, return_vars) 132 range_steps = [abs(range[1] - range[0])/(p-1) for range, p in zip(ranges, plot_points)] 133 if min(range_steps) == float(0): --> 134 raise ValueError("plot start point and end point must be different") 135 136 options = {} ValueError: plot start point and end point must be different 
In [ ]: