Difference between revisions of "Final Report of Hydrogen Storage Optimization Project, Darell Jeremia Sitompul, 6 Juni 2023"
Darell0306 (talk | contribs) m |
Darell0306 (talk | contribs) m |
||
Line 35: | Line 35: | ||
print("Radius = ", a[0][0]) | print("Radius = ", a[0][0]) | ||
print("Surface Area : ", a[0][1]) | print("Surface Area : ", a[0][1]) | ||
+ | |||
+ | |||
+ | When we run the program, the result will be shown like this | ||
+ | |||
+ | |||
+ | : Radius : Surface Area : | ||
+ | : 1.0 : 2004.18879 : | ||
+ | : 2.0 : 1016.75516 : | ||
+ | : 3.0 : 704.36578 : | ||
+ | : 4.0 : 567.02064 : | ||
+ | : 5.0 : 504.71976 : | ||
+ | : 6.0 : 484.12978 : | ||
+ | : 7.0 : 490.96501 : | ||
+ | : 8.0 : 518.08257 : | ||
+ | : 9.0 : 561.51423 : | ||
+ | : 10.0 : 618.87902 : | ||
+ | : 11.0 : 688.6618 : | ||
+ | : 12.0 : 769.85246 : | ||
+ | : 13.0 : 861.7517 : | ||
+ | : 14.0 : 963.86002 : | ||
+ | : 15.0 : 1075.81113 : | ||
+ | : 16.0 : 1197.33029 : | ||
+ | : 17.0 : 1328.20743 : | ||
+ | : 18.0 : 1468.27914 : | ||
+ | : 19.0 : 1617.41642 : | ||
+ | : 20.0 : 1775.51608 : | ||
+ | Minimum surface area will be found when | ||
+ | Radius = 6.0 | ||
+ | Surface Area : 484.12978 |
Revision as of 00:00, 9 June 2023
Requirement:
- Capacity = 1 Liter - Budget = Rp.500.000,00 (Lima ratus ribu rupiah)
DRAFT PROGRAM
Finding Smallest Surface Area of the capsule with radius from 0 to 20 centimeters
import numpy as np print(": Radius : Surface Area :") r_max = 20 a = np.zeros((r_max, 2)) for r in range (1, r_max + 1): flat_tube_height = (1000-((4*np.pi*r**3)/3))/(np.pi*(r)**2) sur_area = ((2*np.pi*r) * flat_tube_height) + ((2*np.pi*r**2)*2) a[r-1][0] = int(r) a[r-1][1] = np.round(sur_area, 5) print(": ", a[r-1][0], " "*(6 - len(str(a[r-1][0]))), " : ", a[r-1][1], " "*(12 - len(str(a[r-1][1]))), " :") for i in range(len(a)): for j in range (len(a)): if a[i][1] < a[j][1]: for n in range (2): temp = a[i][n] a[i][n] = a[j][n] a[j][n] = temp print("Minimum surface area will be found when") print("Radius = ", a[0][0]) print("Surface Area : ", a[0][1])
When we run the program, the result will be shown like this
: Radius : Surface Area : : 1.0 : 2004.18879 : : 2.0 : 1016.75516 : : 3.0 : 704.36578 : : 4.0 : 567.02064 : : 5.0 : 504.71976 : : 6.0 : 484.12978 : : 7.0 : 490.96501 : : 8.0 : 518.08257 : : 9.0 : 561.51423 : : 10.0 : 618.87902 : : 11.0 : 688.6618 : : 12.0 : 769.85246 : : 13.0 : 861.7517 : : 14.0 : 963.86002 : : 15.0 : 1075.81113 : : 16.0 : 1197.33029 : : 17.0 : 1328.20743 : : 18.0 : 1468.27914 : : 19.0 : 1617.41642 : : 20.0 : 1775.51608 : Minimum surface area will be found when Radius = 6.0 Surface Area : 484.12978