-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
232 lines (215 loc) · 9.26 KB
/
index.html
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
220
221
222
223
224
225
226
227
228
229
230
231
232
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LBO Model Simulation</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
line-height: 1.6;
color: #333;
max-width: 1000px;
margin: 0 auto;
padding: 20px;
background-color: #f5f5f5;
}
h1, h2, h3 {
color: #2c3e50;
}
h1 {
text-align: center;
}
.input-group {
background-color: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
margin-bottom: 20px;
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 10px;
}
label {
display: block;
margin-bottom: 5px;
color: #34495e;
}
input {
width: 100%;
padding: 8px;
margin-bottom: 10px;
border: 1px solid #ddd;
border-radius: 4px;
box-sizing: border-box;
}
button {
background-color: #3498db;
color: white;
padding: 10px 15px;
border: none;
border-radius: 4px;
cursor: pointer;
width: 100%;
font-size: 16px;
grid-column: span 2;
}
button:hover {
background-color: #2980b9;
}
#results {
background-color: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.result-item {
margin-bottom: 10px;
}
.result-item strong {
color: #2c3e50;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
font-size: 14px;
}
th, td {
border: 1px solid #ddd;
padding: 8px;
text-align: right;
}
th {
background-color: #f2f2f2;
}
</style>
</head>
<body>
<h1>LBO Model Simulation</h1>
<div class="input-group">
<div>
<label for="initialEBITDA">Initial EBITDA ($m)</label>
<input type="number" id="initialEBITDA" value="100" step="1">
</div>
<div>
<label for="ebitdaGrowth">EBITDA Growth Rate (%)</label>
<input type="number" id="ebitdaGrowth" value="5" step="0.1">
</div>
<div>
<label for="entryMultiple">Entry Multiple (EV/EBITDA)</label>
<input type="number" id="entryMultiple" value="8" step="0.1">
</div>
<div>
<label for="debtMultiple">Entry Debt Multiple (Debt/EBITDA)</label>
<input type="number" id="debtMultiple" value="4" step="0.1">
</div>
<div>
<label for="exitMultiple">Exit Multiple (EV/EBITDA)</label>
<input type="number" id="exitMultiple" value="10" step="0.1">
</div>
<div>
<label for="unleveredFCFConversion">Unlevered FCF Conversion (% of EBITDA)</label>
<input type="number" id="unleveredFCFConversion" value="80" step="1">
</div>
<div>
<label for="costOfDebt">Cost of Debt (%)</label>
<input type="number" id="costOfDebt" value="6" step="0.1">
</div>
<div>
<label for="taxRate">Tax Rate (%)</label>
<input type="number" id="taxRate" value="25" step="1">
</div>
<div>
<label for="years">Investment Period (Years)</label>
<input type="number" id="years" value="5" step="1">
</div>
<button onclick="runSimulation()">Run Simulation</button>
</div>
<div id="results"></div>
<script>
function runSimulation() {
const initialEBITDA = parseFloat(document.getElementById('initialEBITDA').value);
const ebitdaGrowth = parseFloat(document.getElementById('ebitdaGrowth').value) / 100;
const entryMultiple = parseFloat(document.getElementById('entryMultiple').value);
const debtMultiple = parseFloat(document.getElementById('debtMultiple').value);
const exitMultiple = parseFloat(document.getElementById('exitMultiple').value);
const unleveredFCFConversion = parseFloat(document.getElementById('unleveredFCFConversion').value) / 100;
const costOfDebt = parseFloat(document.getElementById('costOfDebt').value) / 100;
const taxRate = parseFloat(document.getElementById('taxRate').value) / 100;
const years = parseInt(document.getElementById('years').value);
const initialEV = initialEBITDA * entryMultiple;
let debt = initialEBITDA * debtMultiple;
const initialEquity = initialEV - debt;
let ebitdaProjections = [];
let unleveredFCFProjections = [];
let interestExpenseProjections = [];
let taxableIncomeProjections = [];
let taxesProjections = [];
let cashFlowForDebtRepaymentProjections = [];
let debtBalances = [debt];
for (let year = 0; year <= years; year++) {
const ebitda = initialEBITDA * Math.pow(1 + ebitdaGrowth, year);
ebitdaProjections.push(ebitda);
if (year > 0) {
const unleveredFCF = ebitda * unleveredFCFConversion;
unleveredFCFProjections.push(unleveredFCF);
const interestExpense = debt * costOfDebt;
interestExpenseProjections.push(interestExpense);
const taxableIncome = ebitda - interestExpense;
taxableIncomeProjections.push(taxableIncome);
const taxes = Math.max(0, taxableIncome * taxRate);
taxesProjections.push(taxes);
const cashFlowForDebtRepayment = unleveredFCF - interestExpense - taxes;
cashFlowForDebtRepaymentProjections.push(cashFlowForDebtRepayment);
debt = Math.max(0, debt - cashFlowForDebtRepayment);
debtBalances.push(debt);
}
}
const exitValue = ebitdaProjections[years] * exitMultiple;
const equityValue = exitValue - debt;
const investorReturn = equityValue / initialEquity;
const irr = Math.pow(equityValue / initialEquity, 1 / years) - 1;
let resultsHtml = `
<h2>Simulation Results</h2>
<div class="result-item"><strong>Initial Enterprise Value:</strong> $${initialEV.toFixed(2)}m</div>
<div class="result-item"><strong>Initial Debt:</strong> $${(initialEBITDA * debtMultiple).toFixed(2)}m</div>
<div class="result-item"><strong>Initial Equity:</strong> $${initialEquity.toFixed(2)}m</div>
<div class="result-item"><strong>Exit Enterprise Value:</strong> $${exitValue.toFixed(2)}m</div>
<div class="result-item"><strong>Exit Debt:</strong> $${debt.toFixed(2)}m</div>
<div class="result-item"><strong>Exit Equity Value:</strong> $${equityValue.toFixed(2)}m</div>
<div class="result-item"><strong>Total Investor Return:</strong> ${investorReturn.toFixed(2)}x</div>
<div class="result-item"><strong>IRR:</strong> ${(irr * 100).toFixed(2)}%</div>
<h3>Yearly Projections</h3>
<table>
<tr>
<th>Year</th>
<th>EBITDA</th>
<th>Unlevered FCF</th>
<th>Interest Expense</th>
<th>Taxable Income</th>
<th>Taxes</th>
<th>Cash Flow for Debt Repayment</th>
<th>Debt Balance</th>
</tr>
`;
for (let year = 0; year <= years; year++) {
resultsHtml += `
<tr>
<td>${year}</td>
<td>$${ebitdaProjections[year].toFixed(2)}m</td>
<td>${year > 0 ? '$' + unleveredFCFProjections[year-1].toFixed(2) + 'm' : 'N/A'}</td>
<td>${year > 0 ? '$' + interestExpenseProjections[year-1].toFixed(2) + 'm' : 'N/A'}</td>
<td>${year > 0 ? '$' + taxableIncomeProjections[year-1].toFixed(2) + 'm' : 'N/A'}</td>
<td>${year > 0 ? '$' + taxesProjections[year-1].toFixed(2) + 'm' : 'N/A'}</td>
<td>${year > 0 ? '$' + cashFlowForDebtRepaymentProjections[year-1].toFixed(2) + 'm' : 'N/A'}</td>
<td>$${debtBalances[year].toFixed(2)}m</td>
</tr>
`;
}
resultsHtml += '</table>';
document.getElementById('results').innerHTML = resultsHtml;
}
</script>
</body>
</html>