Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168745
Image: ubuntu2004
#auto # -*- coding: utf-8 -*- var('u,v') html("<h1>Solids of Revolution (x and y axis)</h1>") html("<h2>Disk method</h2>") @interact def _(krivka=selector(["First Example (První příklad): 01a","Second Example (Druhý příklad): 01b","Third Example (Třetí příklad): 02c"], label="Curve (Křivka)", nrows=3, ncols=1, buttons=True), #a=slider(0, 3, step_size=1, default=0, label="Lower Limit (Dolní mez)"), #b=slider(4,10, step_size=1, default=4, label="Upper Limit (Horní mez)"), rotace=slider(0,360, step_size=1, default=220, label="Rotation in Degrees (Rotace ve stupních)"), #auto_update=False, ): #tachyon=("Raytrace", False) pet=krivka[0:1] if pet == "F": f(x)=sqrt(3+x) popisek="\sqrt{3+x}" a=-1 b=3 elif pet == "S": f(x)=sqrt((x-2)/(2*x+1)) popisek="\sqrt{(x-2)/(2x+1)}" a=2 b=3 elif pet == "T": f(x)=sqrt((2-x)/(3+2*x)) popisek="\sqrt{(2-x)/(3+2x)}" a=1 b=2 horniv=rotace/360*2*pi # neviditelné html("$y=f(x)=%s,\quad x\in<%s,%s>$"%(popisek,a,b)) """ f(x)=sqrt(x) a=1 b=4 f(x)=x a=0 b=2 """ #F(x,y)=y-f(x) Fx=f(x) # F(x,y) #Fy=y^2 V=integral(pi*Fx^2,x,a,b) derx=diff(Fx,x) S=integral(2*pi*Fx*sqrt(1+derx^2),x,a,b) print "\nFor full rotation...\n" print "Vx =",V,"[units^3]" print "Vx = %4.4f" % (V),"[units^3]\n" print "Sx =",S,"[units^2]" print "Sx = %4.4f" % (S),"[units^2]\n" #print "y=f(x)=%s" % (f(x)) #print "a=%s" % (a) #print "b=%s" % (b) mycurve = plot(f(x),a,b,color="orange") show(mycurve,aspect_ratio=1,figsize=3) #Sx=integral(2*pi*F #return # mypc=parametric_plot3d([u*cos(0),u*sin(0),f(u)],(u,a,b),color="orange",thickness=8) mypb=parametric_plot3d([u*cos(v),u*sin(v),f(u)],(u,a,b),(v,0,2*pi),color="blue", opacity=0.05) mysb=parametric_plot3d([u,sin(v)*f(u),cos(v)*f(u)],(u,a,b),(v,0,2*pi),color="green", opacity=0.05) # myp=parametric_plot3d([u*cos(v),u*sin(v),f(u)],(u,a,b),(v,0,horniv),color="blue") mys=parametric_plot3d([u,sin(v)*f(u),cos(v)*f(u)],(u,a,b),(v,0,horniv),color="green") # #myr=parametric_plot3d([u,sin(v)*g(u),cos(v)*g(u)],(u,5,6),(v,0,2*pi),color="yellow") show(mypb+mysb+myp+mys+mypc,aspect_ratio=1,figsize=5, viewer="jmol") #(mypb+mysb+myp+mys+mypc).save("moje.png",aspect_ratio=1,figsize=6,viewer="jmol")

Solids of Revolution (x and y axis)

Disk method

Curve (Křivka) 
Rotation in Degrees (Rotace ve stupních) 
[removed]
[removed]
[removed]
[removed]