take size of investment into consideration

This commit is contained in:
Tobias Brunner 2025-07-16 16:41:02 +02:00
parent bcbfeaf53c
commit 6f39f73522
Signed by: tobru
SSH key fingerprint: SHA256:kOXg1R6c11XW3/Pt9dbLdQvOJGFAy+B2K6v6PtRWBGQ

View file

@ -353,7 +353,14 @@
<h4><i class="bi bi-cash-coin"></i> Investment Settings</h4>
<div class="input-group-custom">
<label for="investment-amount">Investment Amount</label>
<label for="investment-amount">
Investment Amount
<i class="bi bi-question-circle-fill text-muted ms-1"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="Higher investments enable better growth through increased marketing, infrastructure, and customer success capabilities."
style="cursor: help; font-size: 0.8rem;"></i>
</label>
<div class="input-group">
<span class="input-group-text currency-symbol">CHF</span>
<input type="text" class="form-control" id="investment-amount"
@ -367,6 +374,30 @@
onchange="updateInvestmentAmount(this.value)">
</div>
<small class="text-muted">CHF 100,000 - CHF 2,000,000</small>
<!-- Investment Impact Details -->
<div class="collapsible-section mt-2">
<div class="collapsible-header" onclick="toggleCollapsible('investment-impact')" style="padding: 0.5rem; font-size: 0.9rem;">
<h6 class="mb-0">
<i class="bi bi-info-circle"></i> Investment Impact
<i class="bi bi-chevron-down float-end"></i>
</h6>
</div>
<div class="collapsible-content" id="investment-impact" style="padding: 0.75rem; font-size: 0.85rem;">
<p class="mb-2"><strong>How Investment Amount Affects Growth</strong></p>
<p class="mb-2">Higher investments enable better growth through increased marketing, infrastructure, and customer success capabilities. This affects instance acquisition rates and reduces churn.</p>
<p class="mb-2"><strong>Mathematical Impact</strong></p>
<ul class="mb-2" style="font-size: 0.8rem;">
<li><strong>Instance Scaling Factor</strong> = √(Investment Amount / CHF 500,000)</li>
<li><strong>Churn Reduction Factor</strong> = max(0.7, 1 - (Investment - CHF 500,000) / CHF 2,000,000 × 0.3)</li>
<li><strong>New Instances per Month</strong> = Base Rate × Scaling Factor</li>
<li><strong>Adjusted Churn Rate</strong> = Base Churn × Reduction Factor</li>
</ul>
<p class="mb-0 text-info" style="font-size: 0.8rem;"><strong>Example:</strong> CHF 1M investment = 1.41× more instances + 25% lower churn than CHF 500K base.</p>
</div>
</div>
</div>
<div class="input-group-custom">
@ -879,6 +910,19 @@ class ROICalculator {
const scenario = this.scenarios[scenarioKey];
if (!scenario.enabled) return null;
// Calculate investment scaling factor
// Base investment of CHF 500,000 = 1.0x multiplier
// Higher investments get multiplicative benefits for instance acquisition
const baseInvestment = 500000;
const investmentScaleFactor = Math.sqrt(inputs.investmentAmount / baseInvestment);
// Calculate churn reduction factor based on investment
// Higher investment = better customer success = lower churn
const churnReductionFactor = Math.max(0.7, 1 - (inputs.investmentAmount - baseInvestment) / 2000000 * 0.3);
// Calculate adjusted churn rate with investment-based reduction
const adjustedChurnRate = scenario.churnRate * churnReductionFactor;
const totalMonths = inputs.timeframe * 12;
const monthlyData = [];
let currentInstances = 0;
@ -902,11 +946,12 @@ class ROICalculator {
monthsInCurrentPhase = 0;
}
// Calculate new instances for this month
const newInstances = scenario.phases[currentPhase].newInstancesPerMonth;
// Calculate new instances for this month with investment scaling
const baseNewInstances = scenario.phases[currentPhase].newInstancesPerMonth;
const newInstances = Math.floor(baseNewInstances * investmentScaleFactor);
// Calculate churn
const churnedInstances = Math.floor(currentInstances * scenario.churnRate);
// Calculate churn using the pre-calculated adjusted churn rate
const churnedInstances = Math.floor(currentInstances * adjustedChurnRate);
// Update total instances
currentInstances = currentInstances + newInstances - churnedInstances;
@ -954,7 +999,9 @@ class ROICalculator {
cumulativeCSPRevenue,
cumulativeServalaRevenue,
discountedCashFlow,
totalDiscountedCashFlow: totalDiscountedCashFlow + inputs.investmentAmount
totalDiscountedCashFlow: totalDiscountedCashFlow + inputs.investmentAmount,
investmentScaleFactor: investmentScaleFactor,
adjustedChurnRate: adjustedChurnRate
});
monthsInCurrentPhase++;
@ -975,7 +1022,9 @@ class ROICalculator {
npv,
breakEvenMonth,
npvBreakEvenMonth,
monthlyData
monthlyData,
investmentScaleFactor: investmentScaleFactor,
adjustedChurnRate: adjustedChurnRate * 100
};
}