| | import streamlit as st |
| |
|
| | |
| | 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"], |
| | } |
| |
|
| | |
| | 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"], |
| | } |
| |
|
| | |
| | st.title("Material Selection Tool") |
| |
|
| | st.sidebar.header("Select Properties and Materials") |
| |
|
| | |
| | selected_properties = st.sidebar.multiselect( |
| | "Select Material Properties", options=list(properties.keys()) |
| | ) |
| |
|
| | |
| | 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.") |
| |
|
| | |
| | selected_materials = st.sidebar.multiselect( |
| | "Select Material Types", options=list(materials.keys()) |
| | ) |
| |
|
| | |
| | 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.") |
| |
|
| | |
| | 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!") |
| |
|