Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
19 views
ubuntu2204
# the differential equation # y'' +4y=5exp(-x) f(x)=sin(2*x)+ exp(-x) TP1=taylor(f(x),x,pi/2,0) TP2=taylor(f(x),x,pi/2,1) TP3=taylor(f(x),x,pi/2,1) TP4=taylor(f(x),x,pi/2,3) TP5=taylor(f(x),x,pi/2,4) TP6=taylor(f(x),x,pi/2,5) p=plot(f(x), -10,50, ymin=-10, ymax=10, gridlines='true') tp1=plot(TP1, -10,50, ymin=-10, ymax=10, gridlines='true', color='green') tp2= plot(TP2,-10,50, ymin=-10, ymax=10, gridlines='true', color='red') tp3= plot(TP3, -10,50, ymin=-10, ymax=10, gridlines='true', color='yellow') tp4= plot(TP4, -10,50, ymin=-10, ymax=10, gridlines='true', color='purple') tp5= plot(TP5, -10,50, ymin=-10, ymax=10, gridlines='true', color='orange') (p+tp1+tp2+tp3+tp4+tp5).show()
a,b=var('a,b') data=[[1,47.70],[2,25.00],[3,11.35],[4,7.00],[5,4.68],[6,3.02],[7,1.34],[8,0.72],[9,0.49],[10,.31],[11,0.20]] p1=scatter_plot(data) p1.show() model(x)=a*x+b fit=find_fit(data,model) print(fit) a=-3.4976363636461727 b=30.241272727336504 y=a*x+b p2=plot(y, 0, 15, ymin=0, ymax=50, frame=True, gridlines=True) print('the line of regression') show(p1+p2) print('looking at the graph I would say that the movies gross for the 12th weekend would be 0 or less than that which would mean the movie would lose money')
[a == -3.4976363636461727, b == 30.241272727336504] the line of regression
looking at the graph I would say that the movies gross for the 12th weekend would be 0 or less than that which would mean the movie would lose money