Difference between revisions of "User:Bhamakerti.mohammad"

From ccitonlinewiki
Jump to: navigation, search
(Progress Pekan 2)
Line 40: Line 40:
 
== Progress Pekan 2 ==
 
== Progress Pekan 2 ==
 
Berikut adalah program yang sudah saya coba buat
 
Berikut adalah program yang sudah saya coba buat
 +
 +
 
import math
 
import math
 
from scipy.optimize import minimize
 
from scipy.optimize import minimize

Revision as of 08:57, 5 June 2023

Introduction

Bhamakerti Mohammad Aydan.jpg

ٱلسَّلَامُ عَلَيْكُمْ وَرَحْمَةُ ٱللَّٰهِ وَبَرَكَاتُهُ

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

Berikut adalah program yang sudah saya coba buat


import math from scipy.optimize import minimize

def calculate_cylinder_volume(radius, height):

   return math.pi * radius**2 * height

def calculate_cylinder_surface_area(radius, height):

   return 2 * math.pi * radius * (radius + height)

def calculate_cylinder_weight(radius, height, thickness, density):

   inner_radius = radius - thickness
   inner_surface_area = calculate_cylinder_surface_area(inner_radius, height)
   return inner_surface_area * thickness * density

def objective_function(dimensions, target_capacity, target_pressure, density, price_per_unit):

   radius, height, thickness = dimensions
   volume = calculate_cylinder_volume(radius, height) / 1000  # Convert to cubic meters
   pressure = target_pressure * 1e5  # Convert to pascal
   error = pressure - target_pressure
   weight = calculate_cylinder_weight(radius, height, thickness, density)
   cost = weight * price_per_unit
   return error + cost

def optimize_cylinder_dimensions(target_capacity, target_pressure, density, price_per_unit):

   initial_guess = [0.1, 0.1, 0.01]  # initial guess for radius, height, and thickness
   bounds = [(0.1, None), (0.1, None), (0.001, None)]  # bounds for radius, height, and thickness
   result = minimize(objective_function, initial_guess, args=(target_capacity, target_pressure, density, price_per_unit), bounds=bounds)
   radius, height, thickness = result.x
   weight = calculate_cylinder_weight(radius, height, thickness, density)
   cost = weight * price_per_unit
   return radius, height, thickness, weight, cost
  1. Input Parameeter

target_capacity = 1 # target capacity in liters target_pressure = 8 # target pressure in bar density = 2700 # density of aluminium in kg/m^3 price_per_unit = 10500 # price per unit weight of the material

radius, height, thickness, weight, cost = optimize_cylinder_dimensions(target_capacity, target_pressure, density, price_per_unit)

print("Optimized Cylinder Dimensions:") print("Radius:", radius * 1000, "mm") print("Height:", height * 1000, "mm") print("Thickness:", thickness * 1000, "mm") print("Weight:", weight, "kg") print("Cost:", cost, "currency")


Namun, hasilnya masih kurang benar, sehingga masih perlu perbaikan