User:Bhamakerti.mohammad
Introduction
ٱلسَّلَامُ عَلَيْكُمْ وَرَحْمَةُ ٱللَّٰهِ وَبَرَكَاتُهُ
Perkenalkan saya Bhamakerti Mohammad Aydan biasa dipanggil Bhama dengan NPM 2106728023.
Saat ini saya sedang menjalani kelas Metode Numerik 01. Saya berharap bisa terus belajar dengan consciousness yang tinggi.
Progress Pekan 1
Tugas : Optimasi tangki hidrogen dengan kapasitas 1 liter, pressure 8 bar, dan biaya produksi maksimal Rp. 500.000
Pada pekan 1, saya membaca sebuah paper dari Jiai Chen, dkk(2018) dengan judul "Design And Optimization of High-Pressure Hydrogen Cylinders For Intermodal Container Transportation".
Pada paper tersebut, ada beberapa parameter yang mejadi fokus untuk melakukan optimisasi pada desain tabung hydrogen
1. Geometri dari tabung Pada bagian geometri, akan didapatkan nilai outer diameter (2r), length of cylinder (l), dan thickness of cylinder(t)
2. Tekanan Optimal hidrogen Parameter ini dicari untuk menentukan geometri dan ukuran dari tabung
3. Packing Problem Paper ini juga memperhatikan bagaimana mentransport hydrogen seefisien mungkin
Adapun workflow yang digunakan adalah sebagai berikut First, for a single cylinder with the external diameter (2𝑟) and the length of the cylinder body (𝑙), we will search for the optimal hydrogen pressure (Section 3). Second, with a given external diameter (2𝑟) of the cylinders, we will find the optimal body length (𝑙 ) (Section 4). Third, in the cross-section, circle packing problem in a square will be studied and optimal external diameter (2𝑟 ) will be found (Section 5). Finally, combining Sections 3-5, the optimal strategy can be attained.
Progress Pekan 2
Final Report
1) Dimensi optimal Dalam melakukan desain optimasi dari tabung hidrogen, parameter yang pertama diperhitungkan adalah dimensi dari tabung,
Adapun constraintnya adalah : Tekanan 8 bar, volume 1 L, dan harga Rp.500.000
Untuk memperhitungkan optimasi dimensi, saya menggunakan pemrograman melalui kode berikut :
import numpy as np
from scipy.optimize import minimize
def objective_function(x, density, price_per_unit):
radius, height, thickness = x
# Calculate the weight of the cylinder (assuming density of aluminium)
inner_radius = radius - thickness
inner_volume = np.pi * inner_radius**2 * height
outer_volume = np.pi * radius**2 * height
shell_volume = outer_volume - inner_volume
weight = shell_volume * density
# Calculate the cost of the cylinder (based on material price per kg)
cost = weight * price_per_unit
return cost
def volume_constraint(x, target_volume):
radius, height, thickness = x
volume = np.pi * radius**2 * height * 1000 # Convert to liters
return volume - target_volume
def pressure_constraint(x, target_pressure, allowable_stress):
radius, height, thickness = x
inner_radius = radius - thickness
stress = target_pressure * inner_radius / thickness
return allowable_stress - stress
# Target volume in liters
target_volume = 1
# Target pressure in bar
target_pressure = 8
# Density of aluminium in kg/m^3
density_aluminium = 2700
# Allowable stress for aluminium in Pa
allowable_stress = 250e6
# Initial guess for radius, height, and thickness
x0 = [10.0, 50.0, 1.0]
# Define the bounds for radius, height, and thickness
bounds = [(0.1, None), (0.1, None), (0.01, None)]
# Define the constraint functions
volume_constraint_func = lambda x: volume_constraint(x, target_volume)
pressure_constraint_func = lambda x: pressure_constraint(x, target_pressure, allowable_stress)
# Define the optimization problem
problem = {
'fun': objective_function,
'x0': x0,
'bounds': bounds,
'constraints': [{'type': 'eq', 'fun': volume_constraint_func}, {'type': 'ineq', 'fun': pressure_constraint_func}],
'args': (density_aluminium, price_per_unit),
'method': 'SLSQP'
}
# Solve the optimization problem
result = minimize(**problem)
# Extract the optimized dimensions
optimal_radius, optimal_height, optimal_thickness = result.x
# Convert dimensions to mm
optimal_radius_mm = optimal_radius * 10
optimal_height_mm = optimal_height * 10
optimal_thickness_mm = optimal_thickness * 10
# Calculate the weight of the cylinder
inner_volume = np.pi * (optimal_radius - optimal_thickness)**2 * optimal_height / 1000
outer_volume = np.pi * optimal_radius**2 * optimal_height / 1000
weight = (outer_volume - inner_volume) * density_aluminium
# Print the optimized results
print("Optimization Results:")
print("Optimal Radius: {:.2f} mm".format(optimal_radius_mm))
print("Optimal Height: {:.2f} mm".format(optimal_height_mm)) }
Sehingga didapatkan hasil
Optimization Results:
Optimal Radius: 100.00 mm
Optimal Height: 500.00 mm