Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
897 views
ubuntu2004
Kernel: SageMath 9.2

Exercise questions.

Draw the scatter plot of following laboratory observations: (2,3) ,(4,6),(6,7) ,(7,11),(10,12)

data=[(2,3),(4,6),(6,7),(7,11),(10,12)] scatter_plot(data)
Image in a Jupyter notebook

Draw the combine graph of y=sinx,y=cosx and y=3+cos2x with different colors and legends

var('x,y') p1=plot(sin(x),(x,-5*pi,5*pi),legend_label='sinx',color="green") p2=plot(cos(x),(x,-5*pi,5*pi),legend_label='cosx',color="brown") p3=plot(3+cos(2*x),(x,-5*pi,5*pi),legend_label='graph',color="yellow") show(p1+p2+p3)
Image in a Jupyter notebook

Draw the graph of 1) Astroid (x)(2/3)+(y)(2/3)=(4)(2/3)and2)6y2=x(x−2)(x)^(2/3) + (y)^(2/3) = (4)^(2/3) and 2) 6y^2 = x(x − 2) with different colors and gridlines and figuresize.

var('x,y') p1=implicit_plot((x^(2/3)+y^(2/3)-4^(2/3)),(x,0,4),(y,0,4),color="green",gridlines='True',figsize=10) p2=implicit_plot((-6*(y^2)+x*(x-2)^2),(x,0,4),(y,0,4),color="red",gridlines='True',figsize=10) show(p1+p2)
Image in a Jupyter notebook

Draw the parametric curve of cycloid x=2(t+sint),y=2(1−cost)x = 2(t + sint), y = 2(1 − cost) with proper legend and title.

var('t') f(x,y)=(2*(t+sin(t)),2*(1-cos(t))) parametric_plot(f,(t,0,2*pi),legend_label="graph",title="cycloid",thickness=3)
Image in a Jupyter notebook

5)Arrange the graphs of following curves i)r=2(1+cost),ii)r=4cos2t,iii)r=4(1−sint),iv)r=4sin5ti)r = 2(1 + cost), ii)r = 4cos2t, iii)r = 4(1 − sint), iv)r = 4sin5t in the grid of two rows and two columns with different colors,thickness,proper title and legend.

var('t') p1=polar_plot(2*(1+cos(t)),(t,-2*pi,2*pi),color="grey",legend_label="A",title="graph 1",thickness=3) p2=polar_plot(4*cos(2*t),(t,-2*pi,2*pi),color="brown",legend_label="B",title="graph 2",thickness=3) p3=polar_plot(4*(1-sin(t)),(t,-2*pi,2*pi),color="blue",legend_label="C",title="graph 3",thickness=3) p4=polar_plot(4*sin(5*t),(t,-2*pi,2*pi),color="red",legend_label="D",title="graph 4",thickness=3) L=[p1,p2,p3,p4] graphics_array(L,2,2)
Image in a Jupyter notebook

Find the graph of f(x,y,z)=xn+yn+zn−4f(x,y,z) = x^n + y^n + z^n − 4 and analize the graph by cosidering odd and even values of n.

var('x,y,z') # for n is odd. n=41 f(x,y,z)=x^n+y^n+z^n-4 implicit_plot3d(f,(x,-2,2),(y,-2,2),(z,-2,2),color='orange')
var('x,y,z') # for n is even. n=40 f(x,y,z)=x^n+y^n+z^n-4 implicit_plot3d(f,(x,-2,2),(y,-2,2),(z,-2,2),color='aqua')

7) Find the surface of revolution of y=x3y = x^3 around z axis through an angle 0 to 2π2π and through and x- axis through an angle 0to2πand0toπ0 to 2π and 0 to π

revolution_plot3d(x^3,(x,-2,2),(0,2*pi),parallel_axis='z',show_curve='true',color='pink')
revolution_plot3d(x^3,(x,-2,2),(0,pi),parallel_axis='x',show_curve='true',color='green')
revolution_plot3d(x^3,(x,-2,2),(0,2*pi),parallel_axis='x',show_curve='true',color='yellow')