import gradio as gr def estimate_ac_capacity(length, width, height): # Room volume-based cooling load volume = length * width * height room_btu = volume * 0.16 # Adjusted for Punjab summer # Equipment heat load (BTU/hr) rectifier_btu = 6 * 3000 # 6 rectifier cabins dry_tr_btu = 2 * 2000 # 2 dry-type transformers wet_tr_btu = 4 * 1500 # 4 wet-type transformers equipment_btu = rectifier_btu + dry_tr_btu + wet_tr_btu # Total BTU/hr and tonnage total_btu = room_btu + equipment_btu tons = total_btu / 12000 return ( f"Estimated AC Capacity: {total_btu:.0f} BTU/hr ({tons:.2f} tons)\n" f"(Room load: {room_btu:.0f} BTU/hr, Equipment load: {equipment_btu} BTU/hr)" ) demo = gr.Interface( fn=estimate_ac_capacity, inputs=[ gr.Number(label="Length (feet)"), gr.Number(label="Width (feet)"), gr.Number(label="Height (feet)") ], outputs="text", title="AC Capacity Estimator with Equipment Load", description=( "Estimate AC capacity needed to keep room temperature < 40°C in Punjab summer conditions. " "This includes heat from 6 rectifier cabins, 2 dry-type transformers, and 4 wet-type transformers used for NaClO generator operation." ) ) demo.launch()