File size: 1,823 Bytes
bc4f43c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import streamlit as st

def evaluate_erosion_protection(dispersive, sand, height, slope_angle):
    if dispersive:
        if height <= 3:
            return "mattress"
        else:  # height > 3
            if slope_angle <= 15:
                return "mattress"
            else:
                return "soil bag"
    else:  # not dispersive
        if sand:
            if height <= 3:
                return "geofabric"
            else:  # height > 3
                if slope_angle <= 15:
                    return "geofabric"
                else:
                    return "soil bag"
        else:  # not sand
            if height <= 6:
                if slope_angle <= 30:
                    return "sodding"
                else:
                    return "geofabric"
            else:  # height > 6
                return "geofabric"

st.title("Erosion Protection Method Evaluator")

st.write("This app helps you determine the recommended method for erosion protection based on soil and slope characteristics.")

dispersive = st.checkbox("Is the soil dispersive?")
sand = st.checkbox("Is the soil sand?")
height = st.number_input("Enter the height of the slope (in meters)", min_value=0.0, value=1.0, step=0.1)
slope_angle = st.number_input("Enter the slope angle (in degrees)", min_value=0.0, max_value=90.0, value=15.0, step=0.1)

if st.button("Evaluate"):
    method = evaluate_erosion_protection(dispersive, sand, height, slope_angle)
    st.write(f"The recommended erosion protection method is: **{method}**")

st.sidebar.header("About")
st.sidebar.info("This app uses a decision tree model to recommend erosion protection methods based on soil characteristics and slope geometry.")
st.sidebar.warning("Always consult with a geotechnical engineer for professional advice on erosion control measures.")