Spaces:
Sleeping
Sleeping
Add ReneWind app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import pandas as pd
|
| 3 |
+
|
| 4 |
+
# Load dummy CSV data
|
| 5 |
+
df = pd.read_csv("wind_data.csv")
|
| 6 |
+
|
| 7 |
+
# Page title
|
| 8 |
+
st.title("ReneWind – Wind Turbine Energy Predictor")
|
| 9 |
+
|
| 10 |
+
st.write("### 📊 Sample Turbine Data")
|
| 11 |
+
st.dataframe(df)
|
| 12 |
+
|
| 13 |
+
st.write("### 🔢 Predict Energy Output for New Input")
|
| 14 |
+
|
| 15 |
+
# User inputs
|
| 16 |
+
wind_speed = st.number_input("Wind Speed (m/s)", min_value=0.0, max_value=50.0, value=12.0)
|
| 17 |
+
temperature = st.number_input("Temperature (°C)", min_value=-20.0, max_value=50.0, value=25.0)
|
| 18 |
+
turbine_age = st.number_input("Turbine Age (Years)", min_value=0, max_value=30, value=5)
|
| 19 |
+
last_maintenance_days = st.number_input("Days Since Last Maintenance", min_value=0, max_value=365, value=90)
|
| 20 |
+
|
| 21 |
+
# Dummy prediction logic
|
| 22 |
+
def predict_energy_output(wind_speed, temperature, turbine_age, last_maintenance_days):
|
| 23 |
+
prediction = (wind_speed * 1.2) - (temperature * 0.5) - (turbine_age * 0.3) - (last_maintenance_days * 0.1)
|
| 24 |
+
return max(0, prediction)
|
| 25 |
+
|
| 26 |
+
if st.button("Predict Energy Output (kW)"):
|
| 27 |
+
output = predict_energy_output(wind_speed, temperature, turbine_age, last_maintenance_days)
|
| 28 |
+
st.success(f"Estimated Energy Output: {output:.2f} kW")
|