Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
4218 views

Your turn!

  1. Follow the link http://mathbits.com/MathBits/TISection/Statistics2/sinusoidal.htmlto find data for the two other cities. Type in the data and create separate scatter plots. Then find the sinusoidal model for each.

  2. Plot the function: f(x)=sin(2x-π)-2, g(x)=-3sec(πx); h(x)=tan(x-π/2) in a single graphing window from [-2π,2π]. Use different colors for each graph!

#Washington DC scatter plot data=[(1, 43),(2,47),(3,56),(4,67),(5,75),(6,84),(7,88),(8,87),(9,80),(10,68),(11,58),(12,47)] p=scatter_plot(data) p
#Austin TX scatter plot data=[(1, 62),(2,65),(3,72),(4,80),(5,87),(6,92),(7,96),(8,97),(9,91),(10,82),(11,71),(12,63)] p=scatter_plot(data) p
data=[(1, 43),(2,47),(3,56),(4,67),(5,75),(6,84),(7,88),(8,87),(9,80),(10,68),(11,58),(12,47)] a,b,c,d=var('a,b,c,d') model(x)=a * sin(b*(x - c))+d values=find_fit(data,model,initial_guess=(23,pi/7,8,65))#you will edit the guess values based on the scatterplot params=[a,b,c,d] for i in range(4): params[i]=values[i].rhs() model(x)=params[0] * sin(params[1]*(x - params[2]))+params[3] model(x) p=scatter_plot(data,xmin=-2,xmax=14,ymin=-10,ymax=100) p+=plot(model(x),xmin=-2,xmax=14,ymin=-10,ymax=100) p
22.75041653280617*sin(0.49416225719140544*x - 1.947019818693464) + 65.36784865289428
data=[(1, 62),(2,65),(3,72),(4,80),(5,87),(6,92),(7,96),(8,97),(9,91),(10,82),(11,71),(12,63)] a,b,c,d=var('a,b,c,d') model(x)=a * sin(b*(x - c))+d values=find_fit(data,model,initial_guess=(18,pi/7,8,79))#you will edit the guess values based on the scatterplot params=[a,b,c,d] for i in range(4): params[i]=values[i].rhs() model(x)=params[0] * sin(params[1]*(x - params[2]))+params[3] model(x) p=scatter_plot(data,xmin=-2,xmax=14,ymin=-10,ymax=100) p+=plot(model(x),xmin=-2,xmax=14,ymin=-10,ymax=100) p
17.757730783071462*sin(0.503454430130402*x - 2.00468907691436) + 79.14963299380213
plot(sin(2*x-pi)-2,(x,-2*pi,2*pi),color='red') plot(sec(x*pi),(x,-2*pi,2*pi),color='green') plot(tan(x-pi/2),(x,-2*pi,2*pi),color='purple')