Professional Documents
Culture Documents
D = 10 #m
T_amb = 40 + 273.15 #K
T_tank = 0 + 273.15 #K
P_amb = 1 #bar
P_init = 5 #bar
latent = 397746 #J/kg
Mr = 44.1 #g/mol
h = 20 #W/m2/K
R = 0.0082 #L.atm/mol/K
Cv = 2
Sg = 0.55
T_R = (9/5 * (T_tank - 273) + 32) + 460
t_span = [0, 3600 * 24]
rho_water = 1000 #kg/m3
rho = Sg * rho_water #kg/m3
A_tank = 4 * np.pi * (D/2)**2
V_tank = 4/3 * np.pi * (D/2)**3
V_cair = 0.8 * V_tank
Qin = h * A_tank * (T_amb - T_tank)
marker = 1
def Func(t,List):
Vc = List[0]
Ptank = List[1]
dVcdt = - Qin/(2 * latent * rho)
global marker
if Ptank >= 8:
marker = 0
elif Ptank <= 5:
marker = 1
plt.figure(0)
plt.plot(t/3600, P_ans,'-r')
plt.title('Profil Tekanan Tank vs. Waktu')
plt.xlabel('Waktu, jam')
plt.ylabel('Tekanan, bar')
plt.grid()
plt.figure(1)
plt.plot(t/3600, Vc_ans,'--b')
plt.title('Profil Volume Cairan Tank vs. Waktu')
plt.xlabel('Waktu, jam')
plt.ylabel('Volume cairan, m3')
plt.grid()
plt.show()