Engr-arehmankhan786 commited on
Commit
1bbbd41
·
verified ·
1 Parent(s): ebe6803

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -9
app.py CHANGED
@@ -1,12 +1,24 @@
1
  import gradio as gr
2
 
3
  def estimate_ac_capacity(length, width, height):
4
- # Volume of the room in cubic feet
5
  volume = length * width * height
6
- # Adjusted factor for hot climate (Punjab summer) to maintain < 40°C
7
- btu = volume * 0.16 # Increased from 0.133 for extreme heat conditions
8
- tons = btu / 12000 # 1 ton = 12,000 BTU/hr
9
- return f"Estimated AC Capacity: {btu:.0f} BTU/hr ({tons:.2f} tons)"
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
  demo = gr.Interface(
12
  fn=estimate_ac_capacity,
@@ -16,11 +28,11 @@ demo = gr.Interface(
16
  gr.Number(label="Height (feet)")
17
  ],
18
  outputs="text",
19
- title="AC Capacity Estimator for Punjab Summer",
20
  description=(
21
- "Enter room dimensions to estimate air conditioning capacity needed "
22
- "to keep temperature below 40°C during hot summer conditions in the plains of Punjab."
23
  )
24
  )
25
 
26
- demo.launch()
 
1
  import gradio as gr
2
 
3
  def estimate_ac_capacity(length, width, height):
4
+ # Room volume-based cooling load
5
  volume = length * width * height
6
+ room_btu = volume * 0.16 # Adjusted for Punjab summer
7
+
8
+ # Equipment heat load (BTU/hr)
9
+ rectifier_btu = 6 * 3000 # 6 rectifier cabins
10
+ dry_tr_btu = 2 * 2000 # 2 dry-type transformers
11
+ wet_tr_btu = 4 * 1500 # 4 wet-type transformers
12
+ equipment_btu = rectifier_btu + dry_tr_btu + wet_tr_btu
13
+
14
+ # Total BTU/hr and tonnage
15
+ total_btu = room_btu + equipment_btu
16
+ tons = total_btu / 12000
17
+
18
+ return (
19
+ f"Estimated AC Capacity: {total_btu:.0f} BTU/hr ({tons:.2f} tons)\n"
20
+ f"(Room load: {room_btu:.0f} BTU/hr, Equipment load: {equipment_btu} BTU/hr)"
21
+ )
22
 
23
  demo = gr.Interface(
24
  fn=estimate_ac_capacity,
 
28
  gr.Number(label="Height (feet)")
29
  ],
30
  outputs="text",
31
+ title="AC Capacity Estimator with Equipment Load",
32
  description=(
33
+ "Estimate AC capacity needed to keep room temperature < 40°C in Punjab summer conditions. "
34
+ "This includes heat from 6 rectifier cabins, 2 dry-type transformers, and 4 wet-type transformers used for NaClO generator operation."
35
  )
36
  )
37
 
38
+ demo.launch()