Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

| Download
Project: exam
Views: 35
Image: ubuntu2204
## project one # V= l*w*h # V=(3-2*x)*(8-2*x)*x # V=(4*x^2-22*x+24)*x #V= (4*x^3-22*x^2+24*x) V(x)= 4*x^3-22*x^2+24*x diff(V(x),x) Vquad=solve([4*x^2-44*x+24==0],x) print(Vquad) # x equates to .57557 and 10.4244 # which means the x for the equation would be .57557 because if it was 10 then the length would be negative and that cannot happen #so the maximum volume is .57557 print('x=.57557 and x=10.4244') print('which means that x=.57557 because the volume cannot be negative cannot be negative') s=simplify(8*3*0.57557) print('therefore the maximum volume of the box is', s)
12*x^2 - 44*x + 24 [ x == -1/2*sqrt(97) + 11/2, x == 1/2*sqrt(97) + 11/2 ] x=.57557 and x=10.4244 which means that x=.57557 because the volume cannot be negative cannot be negative therefore the maximum volume of the box is 13.8136800000000
## project two p=var('p') x=1000-p p=1000-x #C(x)=cost C(x)= 3000+20*x #R(x)=revenue R(x)=x*(1000-x) #the revenue print(R(x)) p1=plot(R(x), -100,1000, ymin=-4000, ymax=300000, gridlines='minor', linestyle='-', color='blue') p1.show() # the profit P(x)=R(x)-C(x) print(P(x)) p2=plot(P(x), -100,100, ymin=-4000, ymax=30000, gridlines='minor', linestyle='-', color='red') p2.show() #maximize production with 500 units per day print('the cost of 500 units a day',C(500)) #maximum profit pf(x)=diff(P(x),x) solve(pf(x),x) print('maximum profit is 490')
-(x - 1000)*x
-(x - 1000)*x - 20*x - 3000
the cost of 500 units a day 13000 [x == 490] maximum profit is 490
##project three ##create p(x) ##.9906y(1000-y) # = y((.9906*1000)/a)-(.9906y/b)) y=var('y') p=.9906*y*(1000-y) p1=plot_slope_field(p,(x,0,100),(y,-10,1000), headlength=5, headaxislength=5, color='blue') p1.show() p(x)=990.6/(.9906+(990.6-.9906)*exp(-.9906*x)) p2= plot(p(x), 0, 100, ymin=0, ymax=1000, gridlines= 'minor', color='red') p2.show() show(p1+p2) print('the number of sick kids in six days would be',p(6)) print('since this is an exponential function all students will eventually get infected, unless someone finds a cure') print('since there is no cure found yet, there is no recovered person in the data yet.However, we can see the numbers plateau at 1000')
the number of sick kids in six days would be 276.247000452510 since this is an exponential function all students will eventually get infected, unless someone finds a cure since there is no cure found yet, there is no recovered person in the data yet.However, we can see the numbers plateau at 1000
## project 4 pw= piecewise([((0, pi/2),-1), ((pi/2, pi), 2)]) print(pw) p=plot(pw,x,-10,10, ymin=-10, ymax=10, gridlines='minor', linestyle='-', color='red') p.show() fsp1=pw.fourier_series_partial_sum(5) print(fsp1) p1=plot(fsp1,-3,3, ymin=-3, ymax=3, gridlines='minor', linestyle='-', color='blue') show(p1) fsp2=pw.fourier_series_partial_sum(10) print(fsp2) p2=plot(fsp2,-3,3, ymin=-3, ymax=3, gridlines='minor', linestyle='-', color='red') fsp3=pw.fourier_series_partial_sum(15) print(fsp3) p3=plot(fsp,-3,3, ymin=-3, ymax=3, gridlines='minor', linestyle='-', color='green') show(p1+p2+p3) print('we can notice that it fluctuates in the same general areas and will most likely continue that pattern') pw2= piecewise([((-1,0),-x),((0, 1),x)]) print(pw2) fsp4=pw2.fourier_series_partial_sum(10) p4=plot(fsp4,-3,3, ymin=-3, ymax=3, gridlines='minor', linestyle='-', color='orange') p4.show()
piecewise(x|-->-1 on (0, 1/2*pi), x|-->2 on (1/2*pi, pi); x) verbose 0 (3935: plot.py, generate_plot_points) WARNING: When plotting, failed to evaluate function at 168 points. verbose 0 (3935: plot.py, generate_plot_points) Last error message: 'Unable to compute f(10.0)'
-6/5*sin(10*x)/pi - 2*sin(6*x)/pi - 6*sin(2*x)/pi + 1/2
-2/3*sin(18*x)/pi - 6/7*sin(14*x)/pi - 6/5*sin(10*x)/pi - 2*sin(6*x)/pi - 6*sin(2*x)/pi + 1/2 -2/5*sin(30*x)/pi - 6/13*sin(26*x)/pi - 6/11*sin(22*x)/pi - 2/3*sin(18*x)/pi - 6/7*sin(14*x)/pi - 6/5*sin(10*x)/pi - 2*sin(6*x)/pi - 6*sin(2*x)/pi + 1/2
we can notice that it fluctuates in the same general areas and will most likely continue that pattern piecewise(x|-->-x on (-1, 0), x|-->x on (0, 1); x)