File size: 2,165 Bytes
871a046
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import streamlit as st

# Define the properties and their details
properties = {
    "Mechanical": ["Tensile Strength", "Hardness", "Elasticity", "Ductility"],
    "Chemical": ["Corrosion Resistance", "Reactivity", "pH Resistance"],
    "Thermal": ["Thermal Conductivity", "Thermal Expansion", "Melting Point"],
    "Electrical": ["Electrical Conductivity", "Resistivity", "Dielectric Strength"],
    "Magnetic": ["Magnetic Permeability", "Coercivity", "Magnetic Retentivity"],
    "Optical": ["Refractive Index", "Transparency", "Color"],
}

# Define the materials and their details
materials = {
    "Metals": ["Iron", "Copper", "Aluminum", "Gold", "Silver"],
    "Non-metals": ["Sulfur", "Carbon", "Oxygen"],
    "Metalloids": ["Boron", "Silicon", "Arsenic"],
    "Ceramics": ["Porcelain", "Glass", "Zirconia"],
    "Polymers": ["Polyethylene", "Nylon", "Polycarbonate"],
    "Alloys": ["Steel", "Brass", "Bronze"],
}

# Streamlit app layout
st.title("Material Selection Tool")

st.sidebar.header("Select Properties and Materials")

# Allow user to select properties
selected_properties = st.sidebar.multiselect(
    "Select Material Properties", options=list(properties.keys())
)

# Display the selected properties and their details
if selected_properties:
    st.subheader("Selected Properties")
    for prop in selected_properties:
        st.write(f"**{prop}**: {', '.join(properties[prop])}")
else:
    st.write("No properties selected.")

# Allow user to select materials
selected_materials = st.sidebar.multiselect(
    "Select Material Types", options=list(materials.keys())
)

# Display the selected materials and their details
if selected_materials:
    st.subheader("Selected Materials")
    for mat in selected_materials:
        st.write(f"**{mat}**: {', '.join(materials[mat])}")
else:
    st.write("No materials selected.")

# Provide additional information based on selections
if selected_properties and selected_materials:
    st.subheader("Summary")
    st.write(
        "You selected the following properties and materials. Use this information to refine your design process!"
    )

st.write("Customize the app further to suit your needs!")