<jupyter_start><jupyter_text>**Thermodynamics: an Engineering Approach, 7th Ed**Cengel & Boles  Chapter 1: Introduction and Basic Concepts Example 1-1, Page.8<jupyter_code>#Diketahui:
El_USD = 0.09 # Harga Listrik adalah 0.09 $/kWh
P_wt = 30 # Wind Turbine power rate,  kW
t_wt = 2200 # Durasi kerja Wind Turbine dalam satu tahun, hours

#Dicari: pengiritan per tahun (?)
#Jawab:
E_tot = P_wt * t_wt
print ('Total energi adalah %f kWh' %round(E_tot,0))

#Uang yang diirit:
Saved_USD = E_tot * El_USD
print ('Total pengiritan adalah %f USD' %round(Saved_USD,0))<jupyter_output>Total energi adalah 66000.000000 kWh
Total pengiritan adalah 5940.000000 USD<jupyter_text>Example 1-2, Page No.9<jupyter_code>#Diketahui:
p=850;# densitas [kg/m^3]
V=2;  # volume tangki [m^3]

#Dicari: Massa (?)
m=p*V;# rumus massa

#Hasil:
print ('Massa minyak di dalam tangki adalah %i kg' %round(m,0))<jupyter_output>Massa minyak di dalam tangki adalah 1700 kg<jupyter_text>Example 1-3, Page No.10<jupyter_code>#Diketahui
m=1; # massa seberat 1 lbm 
#Konstanta yang dipakai
g=32.174;# konstanta gravitasi, ft/s^2

#Dicari: Berat (w)
lbf = 32.174 # Konversi 1 lbf = 32.174 lbm.ft/s^2
w=(m*g)*(1/lbf); # berat = massa * gravitasi
                 # konversi lbf ke lbm diperlukan


#Result
print ('Berat benda tersebut di bumi adalah %i lbf' %w)<jupyter_output>Berat benda tersebut di bumi adalah 1 lbf<jupyter_text>Example 1-4, Page No.21<jupyter_code># Diketahui
Tc=10; #deltaT karena proses pemberian kalor, C

# Calculations
Tk=Tc;
Tr=1.8*Tk;#Konversi dari R ke K
Tf=Tr;
# Dihitung dengan rumus di atas

#Hasil
print ('perubahan suhu tersebut adalah %i K' %Tk)
print ('perubahan suhu tersebut adalah %i R' %Tr)
print ('perubahan suhu tersebut adalah %i F' %Tf)<jupyter_output>perubahan suhu tersebut adalah 10 K
perubahan suhu tersebut adalah 18 R
perubahan suhu tersebut adalah 18 F<jupyter_text>Example 1-5, Page No.23<jupyter_code>#Diketahui
Patm=14.5; #tekanan atmosfir, psi
Pvac=5.8;  #pembacaan vacuum gage, psi

#Proses perhitungan
Pabs=Patm-Pvac;#vacuum selalu dihitung sbg tekanan negatif

#Hasil
print('P_absolut dari ruangan tersebut adalah %f psi'%round(Pabs,1))<jupyter_output>P_absolut dari ruangan tersebut adalah 8.700000 psi<jupyter_text>Example 1-6, Page No.26<jupyter_code>#Diketahui:
pw=1000; # Densitas air, kg/m^3;
g=9.81; # Gravitasi, m/s^2;
SG=0.85;# Specific Gravity/Dens. Relatif fluida di manometer
meter = 100 # 1 m = 100 cm, cm
h=55/meter;# tinggi dalam satuan, cm
Patm=96;# Tekanan Atmosfir, kPa

# Jawab
# Menghitung P menggunakan likuid pada ketinggian yang sama
p=SG*pw;
Ptank_abs=Patm+(p*g*h/1000); 


#Results
print ('absolute pressure in tank %f kPa' %round(Ptank_abs,1))<jupyter_output>absolute pressure in tank 100.600000 kPa<jupyter_text>Example 1-7, Page No.28<jupyter_code>#Constants used
g=9.81;#acceleration due to gravity in m/s^2;

#Given values
h1=0.1;# distance b/w point 1 at air-water interface and point 2 at mercury-air interface in m
h2=0.2;# distance b/w oil-water interface and  mercury-oil interface in m
h3=0.35;# distance b/w air-mercury interface and  mercury-oil interface in m
pw=1000;# density of water in kg/m^3
pHg=13600;# density of mercury in kg/m^3
poil=800;# density of oil in kg/m^3
Patm=85.6;# atmospheric pressure in kPa

#Calculation
P1=Patm-(pw*g*h1+poil*g*h2-pHg*g*h3)/1000;#calculating pressure using liquid at same height have same pressure

#Results
print ('the air pressure in tank %i kPa' %round(P1))<jupyter_output>the air pressure in tank 130 kPa<jupyter_text>Example 1-8, Page No.31<jupyter_code>#Constants used
g=9.81;# acceleration due to gravity in m/s^2;

#Given values
pHg=13570;# density of mercury at 10 C in kg/m^3
h=0.74;# converting barometric reading into m from mm

#Calculationa
Patm=pHg*g*h/1000;# standard  pressure formula

#Results
print ('the atmospheric pressure %f kPa' %round(Patm,1))<jupyter_output>the atmospheric pressure 98.500000 kPa<jupyter_text>Example 1-9, Page No.31<jupyter_code>#constants used
g=9.81;#acceleration due to gravity in m/s^2;

#given values
m=60;# mass of piston in kg
Patm=0.97;# atmospheric pressure in kPa
A=0.04;# cross-sectional area in m^2

#calculation
P=Patm+(m*g/A)/100000;# standard  pressure formula
print ('The pressure inside the cylinder %f bar' %round(P,2))
#The volume change will have no effect on the free-body diagram drawn in part (a), and therefore the pressure inside the cylinder will remain the same
print('If some heat is transferred to the gas and its volume is doubled, there is no change in pressure');<jupyter_output>The pressure inside the cylinder 1.120000 bar
If some heat is transferred to the gas and its volume is doubled, there is no change in pressure<jupyter_text>Example 1-10, Page No.32<jupyter_code>import math
from scipy.integrate import quad 
from pylab import *

#Constants used
g=9.81;#acceleration due to gravity in m/s^2;

#Given values
p=1040;# density on the water surface in kg/m^3
h1=0.8;# thickness of surface zone
H=4;# thickness of gradient zone
x0=0.0;# lower limit of integration
x1=4.0;# upper limit of integration


#Calculations
P1=p*g*h1/1000;#standard  pressure determination formula
#P2 = integration of the exp. p*g*(math.sqrt(1+(math.tan(math.pi*z/4/H)^2))) b/w 0-4
def intgrnd1(z): 
 return (p*g*(math.sqrt(1+(math.tan(math.pi*(z)/4/H)**2))) )#integrant
P2, err = quad(intgrnd1, x0, x1) 
P2=P2/1000;#converting into kPa
P=P1+P2;

#Results
print ('the gage pressure at the bottom of gradient zone %f kPa' %round(P,0))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.113245153107447, 'fraction_numerical': 0.057619133901069035, 'mean_word_length': 5.381502890173411, 'pattern_counts': {'":': 0, '<': 32, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '2588', 'license': 'MIT', 'n_tokens_mistral': 2485, 'n_tokens_neox': 2242, 'n_words': 667, 'path': 'Thermodynamics_an Eng Approach_5Ed_Cengel_IDN/.ipynb_checkpoints/Chapter_1_1-checkpoint.ipynb', 'repo_name': 'msuherma/termodinamika', 'size': '5519'}