MuhammadHananKhan123 commited on
Commit
b072320
·
verified ·
1 Parent(s): a8d1bbe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +50 -0
app.py CHANGED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+ def main():
4
+ # Set up the app title and description
5
+ st.title("Material Selector for Industries and Equipment")
6
+ st.write("""
7
+ This tool helps you identify the right material for designing equipment based on industry type and equipment requirements.
8
+ Select from metals, polymers, ceramics, alloys, and more by specifying the industry and equipment name.
9
+ """)
10
+
11
+ # User inputs
12
+ industry = st.text_input("Enter the industry (e.g., Automotive, Aerospace, Medical):")
13
+ equipment = st.text_input("Enter the equipment name (e.g., Pipes, Bearings, Surgical Tools):")
14
+
15
+ # Selection categories
16
+ material_type = st.selectbox(
17
+ "Select a material category:",
18
+ ["Metals", "Polymers", "Ceramics", "Alloys"]
19
+ )
20
+
21
+ # Output recommendations
22
+ if st.button("Get Material Recommendation"):
23
+ if not industry or not equipment:
24
+ st.warning("Please provide both the industry and equipment name.")
25
+ else:
26
+ recommendation = get_material_recommendation(industry, equipment, material_type)
27
+ st.success("Recommendation:")
28
+ st.write(recommendation)
29
+
30
+
31
+ def get_material_recommendation(industry, equipment, material_type):
32
+ """Returns a material recommendation based on the inputs."""
33
+ if material_type == "Metals":
34
+ return "Metals like stainless steel, aluminum alloys, and titanium are often suitable for industries like {} with equipment such as {}. These materials offer high strength, durability, and corrosion resistance.".format(industry, equipment)
35
+
36
+ elif material_type == "Polymers":
37
+ return "Polymers such as PVC, polyethylene, and nylon are ideal for lightweight and flexible equipment in the {} industry, especially for {}.".format(industry, equipment)
38
+
39
+ elif material_type == "Ceramics":
40
+ return "Ceramics, including alumina and silicon carbide, are excellent choices for {} industry applications requiring high heat resistance and insulation, such as {}.".format(industry, equipment)
41
+
42
+ elif material_type == "Alloys":
43
+ return "Alloys like brass, bronze, and nickel-based superalloys are widely used in the {} industry for {} due to their strength, wear resistance, and tailored properties.".format(industry, equipment)
44
+
45
+ else:
46
+ return "Invalid material type selected. Please choose a valid category."
47
+
48
+ if __name__ == "__main__":
49
+ main()
50
+