-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBusinessModelSimulator.py
More file actions
219 lines (179 loc) Β· 7.69 KB
/
Copy pathBusinessModelSimulator.py
File metadata and controls
219 lines (179 loc) Β· 7.69 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
import streamlit as st
import plotly.graph_objects as go
import pandas as pd
# Page configuration
st.set_page_config(
page_title="Solar Panel Cleaning Business Model",
layout="wide",
initial_sidebar_state="expanded"
)
def calculate_base_metrics(capacity_mw=100):
"""Calculate base business metrics"""
# Plant Metrics
panels_per_mw = 3000
total_panels = capacity_mw * panels_per_mw
# Current Manual Cleaning Costs
cost_per_panel_clean = 3.5 # INR
cleanings_per_month = 2
monthly_cleaning_cost = total_panels * cleanings_per_month * cost_per_panel_clean
annual_cleaning_cost = monthly_cleaning_cost * 12
# Generation Impact
capacity_factor = 0.20
annual_hours = 8760
current_generation = capacity_mw * annual_hours * capacity_factor # MWh
power_price = 4 # INR/kWh
current_revenue = current_generation * power_price * 1000 # Convert to kWh
efficiency_improvement = 0.25 # 25% improvement
improved_generation = current_generation * (1 + efficiency_improvement)
improved_revenue = improved_generation * power_price * 1000
# Convert to USD (approximate conversion)
usd_conversion = 82
annual_cleaning_usd = annual_cleaning_cost / usd_conversion
revenue_improvement_usd = (improved_revenue - current_revenue) / usd_conversion
return {
'total_panels': total_panels,
'annual_cleaning_usd': annual_cleaning_usd,
'current_generation': current_generation,
'improved_generation': improved_generation,
'additional_generation': improved_generation - current_generation,
'revenue_improvement_usd': revenue_improvement_usd
}
def create_efficiency_waterfall(current_gen, improved_gen, power_price_usd=0.048):
"""Create waterfall chart showing efficiency impact"""
current_value = current_gen * power_price_usd * 1000
improved_value = improved_gen * power_price_usd * 1000
fig = go.Figure(go.Waterfall(
name="20MW Plant Example",
orientation="v",
measure=["relative", "relative", "total"],
x=["Current Revenue", "Efficiency Gain", "Improved Revenue"],
y=[current_value/1e6, (improved_value-current_value)/1e6, 0],
text=[f"${current_value/1e6:,.1f}M", f"+${(improved_value-current_value)/1e6:,.1f}M",
f"${improved_value/1e6:,.1f}M"],
textposition="outside",
decreasing={"marker":{"color":"#FF6B6B"}},
increasing={"marker":{"color":"#4ECDC4"}},
totals={"marker":{"color":"#45B7D1"}}
))
fig.update_layout(
title={"text": "Annual Revenue Impact", "x": 0.5},
showlegend=False,
height=400,
yaxis_title="Revenue (Millions USD)",
plot_bgcolor='white'
)
return fig
def create_model_comparison(annual_cleaning_cost, total_investment, annual_opex, service_revenue):
"""Create bar chart comparing business models"""
models = ['Current Manual', 'Product Model', 'Service Model']
costs = [annual_cleaning_cost, annual_opex, annual_opex]
savings = [0,
annual_cleaning_cost - annual_opex,
service_revenue - annual_opex]
fig = go.Figure(data=[
go.Bar(name='Cost', x=models, y=costs, marker_color='#FF6B6B'),
go.Bar(name='Net Benefit', x=models, y=savings, marker_color='#4ECDC4')
])
fig.update_layout(
barmode='relative',
title={"text": "Annual Cost & Benefit Comparison", "x": 0.5},
height=400,
yaxis_title="USD",
plot_bgcolor='white'
)
return fig
def create_roi_chart(investment, monthly_benefit, service_monthly_profit):
"""Create ROI comparison chart"""
months = list(range(24))
product_roi = [-investment + (monthly_benefit * m) for m in months]
service_roi = [service_monthly_profit * m for m in months]
fig = go.Figure()
fig.add_trace(go.Scatter(
x=months,
y=product_roi,
name="Product Model",
line=dict(color='#4ECDC4', width=3)
))
fig.add_trace(go.Scatter(
x=months,
y=service_roi,
name="Service Model",
line=dict(color='#45B7D1', width=3, dash='dot')
))
fig.add_hline(y=0, line_dash="dash", line_color="gray")
fig.update_layout(
title={"text": "24-Month Return on Investment", "x": 0.5},
xaxis_title="Months",
yaxis_title="Cumulative Return (USD)",
height=400,
plot_bgcolor='white'
)
return fig
def main():
st.title("Solar Panel Cleaning Business Model Story π")
# Calculate base metrics
metrics = calculate_base_metrics()
# Basic Plant Information
st.header("1. Understanding the Scale π")
col1, col2 = st.columns(2)
with col1:
st.metric("Total Solar Panels", f"{metrics['total_panels']:,.0f}")
st.markdown("These panels need cleaning twice a month")
with col2:
st.metric("Current Annual Cleaning Cost", f"${metrics['annual_cleaning_usd']:,.0f}")
st.markdown("Current spending on manual cleaning")
# Efficiency Impact
st.header("2. Value Creation Potential π°")
efficiency_chart = create_efficiency_waterfall(
metrics['current_generation'],
metrics['improved_generation']
)
st.plotly_chart(efficiency_chart, use_container_width=True)
# Business Model Comparison
st.header("3. Business Model Comparison π")
# Calculate model metrics
machines_needed = 7
cost_per_machine = 15000
infrastructure_cost = 20000
total_investment = (machines_needed * cost_per_machine) + infrastructure_cost
annual_opex = total_investment * 0.0075 + (machines_needed * 3000) # Maintenance + Operators
# Service model calculations
service_revenue = metrics['revenue_improvement_usd'] * 0.6 # 60% of value created
comparison_chart = create_model_comparison(
metrics['annual_cleaning_usd'],
total_investment,
annual_opex,
service_revenue
)
st.plotly_chart(comparison_chart, use_container_width=True)
# ROI Timeline
st.header("4. Return on Investment Timeline π")
monthly_benefit = metrics['annual_cleaning_usd'] / 12
service_monthly_profit = (service_revenue - annual_opex) / 12
roi_chart = create_roi_chart(
total_investment,
monthly_benefit,
service_monthly_profit
)
st.plotly_chart(roi_chart, use_container_width=True)
# Key Metrics
st.header("5. Key Investment Metrics π―")
col1, col2, col3 = st.columns(3)
with col1:
payback_months = total_investment / monthly_benefit
st.metric("Product Model Payback", f"{payback_months:.1f} months")
with col2:
service_roi = (service_monthly_profit * 12 / total_investment) * 100
st.metric("Service Model ROI", f"{service_roi:.1f}%")
with col3:
st.metric("Annual Value Created", f"${metrics['revenue_improvement_usd']:,.0f}")
# Key Insights
st.header("6. Key Insights π‘")
st.write("""
1. **Significant Value Creation**: Our solution generates substantial additional revenue through improved efficiency
2. **Quick Payback**: Product model investment recovered in less than a year
3. **Attractive Service Model**: Generate consistent profits while removing client investment barrier
4. **Sustainable Solution**: Reduces water usage and manual labor while improving solar farm efficiency
""")
if __name__ == "__main__":
main()