Difference between revisions of "Febry Panrita"

From ccitonlinewiki
Jump to: navigation, search
(Pressurized Hydrogen Storage Optimization)
(Pressurized Hydrogen Storage Optimization)
Line 47: Line 47:
 
Pada tugas kali ini saya menggunakan codingan untuk mengoptimasi pembuatan tangki hidrogen dengan maksimal budget sebesar Rp 500.000 yang berkapasistas 1 liter dengan pressure 8 bar
 
Pada tugas kali ini saya menggunakan codingan untuk mengoptimasi pembuatan tangki hidrogen dengan maksimal budget sebesar Rp 500.000 yang berkapasistas 1 liter dengan pressure 8 bar
  
import math
+
import math
 +
from scipy.optimize import minimize
  
# Function to calculate the total cost
+
def hitung_volume(diameter, tinggi):
def calculate_cost(diameter, height):
+
    jari_jari = diameter / 2
    # Calculate the volume and surface area of the tank
+
    volume = math.pi * jari_jari**2 * tinggi
    volume = math.pi * (diameter**2) * (height/4)
+
     return volume
    surface_area = (2 * math.pi * (diameter/2) * height) + (math.pi * (diameter**2) / 4)
 
   
 
    # Calculate the material cost and manufacturing cost
 
    material_cost = surface_area * cost_per_square_meter
 
    manufacturing_cost = volume * cost_per_volume
 
      
 
    # Calculate the total cost
 
    total_cost = material_cost + manufacturing_cost
 
   
 
    return total_cost
 
  
# Constants
+
def fungsi_objektif(dimensi):
cost_per_square_meter = 90000  # Cost per square meter of material
+
    diameter, tinggi = dimensi
cost_per_volume = 90000  # Cost per liter of volume
+
    return abs(hitung_volume(diameter, tinggi) - 1000)
budget_limit = 500000  # Maximum budget
 
  
# Variables
+
# Inisialisasi dimensi awal
best_cost = float('inf')
+
x0 = [1, 1] # Tebakan awal untuk diameter dan tinggi
  best_diameter = 0
 
best_height = 0
 
  
# Iterate over possible diameters and heights
+
# Batasan dimensi
for diameter in range(1, 100):
+
batasan_dimensi = [(0, None), (0, None)# Batasan diameter dan tinggi: non-negatif
    for height in range(1, 100):
 
        # Calculate the total cost for the current diameter and height
 
        total_cost = calculate_cost(diameter, height)
 
       
 
        # Check if the total cost is within the budget and better than the previous best
 
        if total_cost <= budget_limit and total_cost < best_cost:
 
            best_cost = total_cost
 
            best_diameter = diameter
 
            best_height = height
 
  
# Print the optimal solution
+
# Optimisasi untuk mencari dimensi optimal
print(" Diameter (m):", best_diameter)
+
solusi = minimize(fungsi_objektif, x0, bounds=batasan_dimensi)
print(" Height (m):", best_height)
 
print(" Total Cost (Rupiah):", best_cost)
 
  
Codingan tersebut dibuat untuk mendapatkan diameter, tinggi, dan budget produksi yang se-optimal mungkin untuk didapatkan. Pada codingan diatas didapatkan hasil ketika di run sebagai berikut :
+
# Ekstraksi dimensi optimal
[[File:hasil run codingan febry.png|1000x1000px]]
+
diameter_optimal, tinggi_optimal = solusi.x
  
Untuk mendapatkan grafik optimasi dari tangki hidrogen diatas, digunakan code seperti dibawah ini,
+
print("Dimensi optimal untuk volume 1000 cm^3:")
 
+
print("Jari-jari:", diameter_optimal / 2, "cm")
import numpy as np
+
print("Tinggi:", tinggi_optimal, "cm")
import matplotlib.pyplot as plt
 
 
 
# Constants
 
pressure = 8  # Pressure in bar
 
capacity = 1  # Capacity in liters
 
budget_limit = 500000  # Maximum budget in Rupiah
 
 
 
# Function to calculate the cost
 
def calculate_cost(diameter, height):
 
    surface_area = (2 * np.pi * (diameter/2) * height) + (np.pi * (diameter**2) / 4)
 
    cost_per_tank = surface_area * cost_per_surface_area
 
    return cost_per_tank
 
 
 
# Constants for cost calculation
 
cost_per_surface_area = 90000  # Cost per square meter of surface area
 
 
 
# Lists to store the results
 
diameters = []
 
heights = []
 
costs = []
 
 
 
# Iterate over possible diameters and heights
 
for diameter in np.arange(0.1, 10.1, 0.1):
 
    for height in np.arange(0.1, 10.1, 0.1):
 
        # Calculate the cost for the current diameter and height
 
        cost = calculate_cost(diameter, height)
 
       
 
        # Check if the cost is within the budget
 
        if cost <= budget_limit:
 
            diameters.append(diameter)
 
            heights.append(height)
 
            costs.append(cost)
 
 
 
# Plot the optimization results
 
fig = plt.figure()
 
ax = fig.add_subplot(111, projection='3d')
 
ax.scatter(diameters, heights, costs, c=costs, cmap='viridis')
 
ax.set_xlabel('Diameter')
 
ax.set_ylabel('Height')
 
ax.set_zlabel('Cost (Rupiah)')
 
ax.set_title('Hydrogen Storage Optimization')
 
plt.show()
 
 
 
Pada codingan diatas didapatkan grafik berbentuk 3d yang menggambarkan optimalisasi tangki hidrogen
 

Revision as of 21:41, 15 June 2023

Introduction

Assalammulaikum, Perkenalkan saya Febry Panrita sebagai mahasiswa Teknik Perkapalan Universitas Indonesia tahun 2021

Resume Perkuliahan 26/05/2023

Pertemuan pertama tanggal 26/05, Pak DAI menjelaskan kepada mahasiswa bagaimana cara mengejar yang beliau sisipkan pada kita yaitu melalui Consiousness atau kesadaran diri kita sendiri. Sebelum mencari dari penyelesaian masalah, kita sebagai mahasiswa harus paham apa itu Consiousness agar dapat penyelesaian atau solusi yang lebih baik dan mempertimbangkan dari segala arah sudut pandang terhadap masalah tersebut. Hal ini Pak DAI contohkan pada study case yaitu berupa soal operasi matematika. Kita sebelumnnya beranggapan bahwa sebuah operasi/masalah matematika pasti akan memiliki solusis atau penyelesaian nilai yang eksak atau pasti, namun pada study case tersebut memberikan hasil yang tidak pasti. Pada pertemuan pada tanggal 26/05 juga Pak DAI menugaskan untuk membuat tabung hidrogen dengan volume 1 liter bertekanan 8 bar yang mana kita harus membuatnya dengan maksimal budget sebesar Rp 500.000. Pada akhir kelas Pak DAI juga menekankan kepada kita sebagai mahasiswa untuk ikut kelas tidak hanya menitipkan absen, karena dengan ikut perkuliahan kita sebagai mahasiswa dapat manfaat yang membuat kita semakin berubah untuk masa depan.

Design and Optimization of Pressurized Hydrogen Storage System

A Pressurized Hydrogen System refers to a system that stores hydrogen gas under high pressure. It is a method of storing and transporting hydrogen in its gaseous form, usually compressed to achieve a higher energy density.

Specification

- Volume    : 1 L
- Pressure  : 8 Bar
- Cost      : Rp 500.000

Designing a hydrogen systems involves several considerations to ensure its safety and efficient. Iam using chatGPT to know the step to make hydrogen systems. So here are the step that we have to follow :

Determine the Capacity and Size

Decide how much hydrogen you want to store in the tank. This capacity will affect the size and dimensions of the tank. Also, consider the energy requirements that the hydrogen will provide. In this case, the tank has to be 1-Liter Sized.

Select Tank Material

Hydrogen tanks are typically made from materials that are strong and capable of withstanding high pressures. Common materials used include alloy steel or carbon fiber reinforced with epoxy resin. Make sure the selected material has sufficient resistance to hydrogen corrosion.

Determine Working Pressure

Hydrogen can be stored in tanks either in compressed form or as a liquid. For compression storage, determine the working pressure based on your application needs. Higher working pressures require tanks with thicker and stronger walls.

Design Tank Structure

Hydrogen tanks usually have a cylindrical design with end caps. In the design, consider structural strength, tank mass, and thermal performance to avoid leaks or structural failures.

Consider Safety Systems

Safety is a critical aspect of hydrogen tank design. Ensure that the tank is equipped with pressure relief valves, and other necessary safety features to reduce the risk of hazards or accidents.

Cost Optimization

Minimize costs by considering factors such as material selection, manufacturing processes, and economies of scale because in this case the maximum cost to spend is Rp 500.000. Explore different manufacturing techniques, such as filament winding or automated fiber placement, to optimize production costs.

Test and Validation

Once the design is complete, conduct testing and validation to ensure the tank meets the required standards and safety regulations. Pressure tests, leak tests, and strength tests are some examples of tests that can be performed.

Pressurized Hydrogen Storage Optimization

Pada tugas kali ini saya menggunakan codingan untuk mengoptimasi pembuatan tangki hidrogen dengan maksimal budget sebesar Rp 500.000 yang berkapasistas 1 liter dengan pressure 8 bar

import math from scipy.optimize import minimize

def hitung_volume(diameter, tinggi):

   jari_jari = diameter / 2
   volume = math.pi * jari_jari**2 * tinggi
   return volume

def fungsi_objektif(dimensi):

   diameter, tinggi = dimensi
   return abs(hitung_volume(diameter, tinggi) - 1000)
  1. Inisialisasi dimensi awal

x0 = [1, 1] # Tebakan awal untuk diameter dan tinggi

  1. Batasan dimensi

batasan_dimensi = [(0, None), (0, None)] # Batasan diameter dan tinggi: non-negatif

  1. Optimisasi untuk mencari dimensi optimal

solusi = minimize(fungsi_objektif, x0, bounds=batasan_dimensi)

  1. Ekstraksi dimensi optimal

diameter_optimal, tinggi_optimal = solusi.x

print("Dimensi optimal untuk volume 1000 cm^3:") print("Jari-jari:", diameter_optimal / 2, "cm") print("Tinggi:", tinggi_optimal, "cm")