Difference between revisions of "Final Report of Hydrogen Storage Optimization Project, Darell Jeremia Sitompul, 6 Juni 2023"

From ccitonlinewiki
Jump to: navigation, search
m
m
Line 7: Line 7:
 
DRAFT PROGRAM
 
DRAFT PROGRAM
  
 +
Finding Smallest Surface Area of the capsule with radius from 0 to 20 centimeters
  
 
     import numpy as np
 
     import numpy as np

Revision as of 23:58, 8 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])