Joshua RuffDon Van HuyckBatman's GobletMath 152Spring 2014Instructor: Yasskinrestart;with(plots):The following points and lines are defined in order to make the goblet fit the dimensions required as well as to achieve the asthetic design we were aiming for. bMin is defined as 25.5. bMin will be the lowest z coordinate value for the bowl which holds liquid. bMin:=25.5;The following three equations represent the first three lines for the upper part of the goblet. The upper part is designed based on a batman symbol. r1:=-sqrt(10*(28-z))+10:r2:=-sqrt(10*(40-z))+18.5:r3:=sqrt(10*(z-bMin)):The following points restrict the domain of r1-r3 as well as being used to calculate the slope and domain of the line r4 which connects r2 and r3. mp1z:=37:mp2z:=198/5:mp1r:=(eval(r3,z=mp1z)); mp2r:=(eval(r2,z=mp2z));r4:=((mp2r-mp1r)/(mp2z-mp1z))*(z-mp1z)+mp1r:r5 - r8 define the lines for the base and the stem of the goblet. The stem is chosen to be r7 because r7 is a logarithmic function which expands towards infinity as it approaches zero. r7 will be cut off at the z value where it intersects with r1 LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYnLUkjbWlHRiQ2JVEjc29GJy8lJ2l0YWxpY0dRJmZhbHNlRicvJSxtYXRodmFyaWFudEdRJ25vcm1hbEYnLUkjbW9HRiQ2LVEifkYnRjIvJSZmZW5jZUdGMS8lKnNlcGFyYXRvckdGMS8lKXN0cmV0Y2h5R0YxLyUqc3ltbWV0cmljR0YxLyUobGFyZ2VvcEdGMS8lLm1vdmFibGVsaW1pdHNHRjEvJSdhY2NlbnRHRjEvJSdsc3BhY2VHUSYwLjBlbUYnLyUncnNwYWNlR0ZJLUYsNiVRJXRoYXRGJ0YvRjJGNUYyLUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYqLUkjbWlHRiQ2JVEkdGhlRicvJSdpdGFsaWNHUSZmYWxzZUYnLyUsbWF0aHZhcmlhbnRHUSdub3JtYWxGJy1JI21vR0YkNi1RIn5GJ0YyLyUmZmVuY2VHRjEvJSpzZXBhcmF0b3JHRjEvJSlzdHJldGNoeUdGMS8lKnN5bW1ldHJpY0dGMS8lKGxhcmdlb3BHRjEvJS5tb3ZhYmxlbGltaXRzR0YxLyUnYWNjZW50R0YxLyUnbHNwYWNlR1EmMC4wZW1GJy8lJ3JzcGFjZUdGSUY1LUYsNiVRJWJhc2VGJ0YvRjJGNUY1LUYsNiVRI2lzRidGL0YyRjI= fully connected to the cup of the goblet. r8 is defined strangely because it is the horizontal part at the base of the goblet. r5:=12-sqrt(-z^2+8*z):r6:=sqrt((-(49/12)*z^2)+49):r7:=(7*z+4)/(7*z-24):r8:=z;Each of the following points are solved for by finding the intersection of two r equations. i71 is the intersection of r7 and r1, and i42 is the intersection of r4 and r2, ect. These points are also used to restrict the domain of different r's. i71:=fsolve(r1=r7,z=5..30);i21:=fsolve(r1=r2,z);i42:=fsolve(r4=r2,z);i43:=fsolve(r4=r3,z);i75:=fsolve(r7=r5,z);i85 and i86 are uniquely defined as r values instead of z values. Because r8 is a horizontal line, plotting it in the same way as the rest of the r values would be impossible.i85:=eval(r5,z=0);i86:=eval(r6,z=0);r6max represents the maximum value of the Ellipse which cuts a hole out of the base of the goblet. r6max:=abs(fsolve(r6=0));p1 - p7 are 2d plots of r1 - r7 with their range restricted by various points. These create the 2d image of the slice to be rotated around the z axis, and create the 3d image of the goblet. p1:=plot([r1,z,z=i71..i21]):p2:=plot([r2,z,z=i21..mp2z]):p3:=plot([r3,z,z=bMin..mp1z]):p4:=plot([r4,z,z=mp1z..mp2z]):p5:=plot([r5,z,z=0..i75]):p6:=plot([r6,z,z=0..r6max]):p7:=plot([r7,z,z=i75..i71]):A display of p1 - p4. This is the cup of the goblet, and you can clearly see how the design was inspired by the batman symbol in this picture. display([p1,p2,p3,p4]);This display shows the full 2d slice of the goblet, which will be rotated around the z axis to form the 3d projection. display([p1,p2,p3,p4,p5,p6,p7],scaling=constrained);p31 - p38 are the 3d plots of r1-r8 rotated around the z axis. The domain and range of these functions is restricted by points defined earlier. Plots which are almost identical in shape to other plots are not displayed. p31:=plot3d([r1*cos(t),r1*sin(t),z],z=i71..i21, t=0..2*Pi,color=white,transparency=.2,light=[45,45,0,0,1], grid=[25,181]):p32:=plot3d([r2*cos(t),r2*sin(t),z],z=i21..mp2z, t=0..2*Pi, color=white,transparency=.7,light=[45,45,0,0,1], grid=[25,181]):p33:=plot3d([r3*cos(t),r3*sin(t),z],z=bMin..mp1z, t=0..2*Pi, color=white,transparency=.2,light=[45,45,0,0,1], grid=[25,181]):p34:=plot3d([r4*cos(t),r4*sin(t),z],z=mp1z..mp2z, t=0..2*Pi, color=white,transparency=.2,light=[45,45,0,0,1], grid=[25,181]):p35:=plot3d([r5*cos(t),r5*sin(t),z],z=0..i75, t=0..2*Pi, color=white,transparency=.2,light=[45,45,0,0,1], grid=[25,181]):p36:=plot3d([r6*cos(t),r6*sin(t),z],z=0..r6max, t=0..2*Pi,color=white,transparency=.2,light=[45,45,0,0,1], grid=[25,181]):p37:=plot3d([r7*cos(t),r7*sin(t),z],z=i75..i71, t=0..2*Pi,color=white,transparency=.2,light=[45,45,0,0,1], grid=[25,181]):p38:=plot3d([r8*cos(t),r8*sin(t),0],z=i86..i85, t=0..2*Pi, color=white,transparency=.2,light=[45,45,0,0,1], grid=[25,181]):This display shows the entire goblet, as it will appear upon completion. goblet:=display([p31,p32,p33,p34,p35,p36,p37,p38],scaling=constrained, orientation=[15,75]):%;myfile:=FileTools:-JoinPath([currentdir(), "GobletRuffVanHuyck.dxf"]);
plottools[exportplot](myfile,goblet);myfile:=FileTools:-JoinPath([currentdir(), "GobletRuffVanHuyck.stl"]);
plottools[exportplot](myfile,goblet);v1-v7 represent the volume enclosed by r1 - r7 when they are rotated around the z axis. These will be used to calculate the volume of the liquid which the goblet can hold as well as the volume of glass needed to create the goblet. v1:=Int(Pi*r1^2,z=i71..i21);value(%);v2:=Int(Pi*1.0*r2^2,z=i21..mp2z);value(%);v3:=Int(Pi*1.0*r3^2,z=bMin..mp1z);value(%);v4:=Int(Pi*1.0*r4^2,z=mp1z..mp2z);value(%);v5:=Int(Pi*1.0*r5^2,z=0..i75);value(%);v6:=Int(Pi*1.0*r6^2,z=0..r6max);value(%);v7:=Int(Pi*1.0*r7^2,z=i75..i71);value(%);volumeLiquid and vl represent the calculated volume of liquid which can be held by the goblet. volumeLiquid:=(v3+v4):vl:= value(%);
volumeGlass and vg represents the calculated volume of glass needed to create the goblet. volumeGlass:=(v1+v2-v3-v4+v5-v6+v7):vg:=value(%);This represents the minimum ratio of vl/vg which is acceptable for the requirements. 177/120.0;This represents the maximum ratio of vl/vg which is acceptable for the requirements. 237/120.0;Our ratio of vl/vg falls within the required ratio. vl/vg;scale is the divisor by which we will get the maximum volume of glass and still remain within the proper ratio. scale:=vg/120;vl/number gives us the actual volume of liquid in cm cubed. vl/scale;vg/number gives us the actual volume of glass in cm cubed. vg/scale;R:=(scale)^(1/3);maxCM is the maximum z value which the center of mass can lie at. mcm is a plot of this maximum value in green and it is shown on the display below. maxCM:=i85*3;The actual max center of mass in centimeters is shown here. maxCM/R; mcm:=plot(maxCM,x=0..15,color=green);display([p1,p2,p3,p4,p5,p6,p7,mcm],scaling=constrained);VA is the volume of the glass above the maximum center of mass line. VA:=(Int(Pi*1.0*r2^2,z=36..mp2z)-Int(Pi*1.0*r4^2,z=mp1z..mp2z)-Int(Pi*1.0*r3^2,z=36..mp1z)):value(%);percent is the percentage of the volume below the maximum allowable center of mass line. It comes out to be 85% of the mass below this line which means it is physically impossible for the actual center of mass to be above that maximum. percent:=((vg-VA)/vg)*100:value(%);m1-m7 are defined as the volume integrals v1-v7 with the change that they all have an extra z term within them. They will be used to calculate the center of mass. m1:=Int(z*Pi*r1^2,z=i71..i21); value(%);m2:=Int(z*Pi*1.0*r2^2,z=i21..mp2z); value(%);m3:=Int(z*Pi*1.0*r3^2,z=bMin..mp1z); value(%);m4:=Int(z*Pi*1.0*r4^2,z=mp1z..mp2z); value(%);m5:=Int(z*Pi*1.0*r5^2,z=0..i75); value(%);m6:=Int(Pi*1.0*r6^2,z=0..r6max); value(%);m7:=Int(Pi*1.0*r7^2,z=i75..i71); value(%);m1-m7 are added together to find Mtot, which is divided by the volume of the glass in order to find zbar, the vertical center of mass. Mtot:=m1+m2-m3-m4+m5-m6+m7: value(%);This value is well below our maximum hight line.zbar:=Mtot/vg:value(%);The actual center of mass is shown here in cm. zbar/R: value(%);zplot:=plot(zbar,r=0..15,color=blue);A 2d display of the goblet with the maximum allowable center of mass marked in green and the actual centerof mass marked in blue is shown here. display([p1,p2,p3,p4,p5,p6,p7,mcm,zplot],scaling=constrained);