Problem
Elevator traffic validation relied on spreadsheets and manual tests, making it hard to compare scenarios quickly and see what had to change for approval.
technical case study
SaaS • Technical system / Simulator
Technical system for calculating, simulating and validating elevator traffic, with dynamic recommendations for speed, number of cars and capacity.
System overview with calculation history, validation status and quick access to the scenarios analyzed.
Simulation screen with technical parameters and real-time feedback to test different design combinations.
Technical report of a saved calculation: population, interval, 5-minute handling capacity and validation status, with PDF export.
Calculation engine: the formulas for probable stops, travel times, doors and passengers, interval and capacity used in the validation.
Elevator traffic validation relied on spreadsheets and manual tests, making it hard to compare scenarios quickly and see what had to change for approval.
A web system was built to simulate scenarios, apply technical rules and recommend speed, number of elevators and commercial capacity/load.
MotionCalc turned a technical calculation into a faster, more visual and traceable workflow, laying the base for history, reports and recurring validations.
Mature MVP with working calculations, history, dynamic feedback and a base ready for PDF reports.
MotionCalc was created to replace a spreadsheet-based technical process with a clearer web application. It lets different combinations of building type, population, speed, number of elevators and capacity be tested quickly, showing not only whether a scenario passes or fails, but which technical adjustment brings the project closer to approval.
Interface in PHP, custom CSS and JavaScript, with a calculation form, live feedback and a results area designed for quick reading of the technical recommendations.
PHP layer organized into controllers, services and repositories, separating user input, business rules, calculation, persistence and history.
MySQL schema for technical parameters, commercial options, confirmed calculations, history, validation status and forced-save flags.
Calculation inputs are processed before simulation to avoid inconsistent scenarios and keep results technically sound.
Users can test freely before confirming, so incomplete calculations don't pollute the official history.
Scenarios saved by force can be flagged and justified, keeping the technical context for later review.
Gathering the variables and technical criteria used to validate elevator traffic.
Initial flow to receive parameters, calculate indicators and return approval or the need for revision.
Results evolved to show which speed, quantity and capacity adjustments are needed to pass validation.
Separating simulation from confirmation, creating the base for calculation history and PDF generation.
public function calculate(array $input): array
{
$populationTotal = $this->calculatePopulationTotal($input['population_items']);
$probableStops = $this->calculateProbableStops(
(int) $input['stops'],
(int) $input['cabin_capacity']
);
$travelMeters = (float) $input['travel_meters'];
$speedMs = (float) $input['speed_ms'];
$t1 = $speedMs > 0
? (2 * $travelMeters) / $speedMs
: 0;
$t2 = $probableStops * (float) $input['acceleration_time'];
$t3 = $probableStops * (float) $input['door_time'];
$t4 = 2 * (float) $input['cabin_capacity'] * (float) $input['passenger_time'];
$subtotal = $t1 + $t2 + $t3 + $t4;
$additional = ((float) $input['additional_percent'] / 100) * ($t3 + $t4);
$totalTripTime = $subtotal + $additional;
$groupUnits = max((int) $input['group_units'], 1);
$trafficInterval = $totalTripTime / $groupUnits;
$capacity5min = $totalTripTime > 0
? ($groupUnits * (float) $input['cabin_capacity'] * 300) / $totalTripTime
: 0;
$capacityPercent = $populationTotal > 0
? ($capacity5min / $populationTotal) * 100
: 0;
return [
'population_total' => $populationTotal,
'probable_stops' => $probableStops,
't1_total_travel' => $t1,
't2_acceleration' => $t2,
't3_doors' => $t3,
't4_passengers' => $t4,
'subtotal' => $subtotal,
'additional_time' => $additional,
'total_trip_time' => $totalTripTime,
'traffic_interval' => $trafficInterval,
'capacity_5min' => $capacity5min,
'capacity_percent' => $capacityPercent,
];
}
function initLiveCalculation() {
const form = document.querySelector('[data-live-calculation-form]');
if (!form) {
return;
}
form.querySelectorAll('input, select, textarea').forEach((field) => {
field.addEventListener('input', () => scheduleLiveSimulation(form));
field.addEventListener('change', () => scheduleLiveSimulation(form));
});
form.addEventListener('input', () => scheduleLiveSimulation(form));
form.addEventListener('change', () => scheduleLiveSimulation(form));
simulateCalculation(form);
}
function scheduleLiveSimulation(form) {
clearTimeout(liveSimulationTimer);
liveSimulationTimer = setTimeout(() => {
simulateCalculation(form);
}, 250);
}
async function simulateCalculation(form) {
const els = getLiveCalculationElements();
if (!els.status || !els.saveButton) {
return;
}
try {
const formData = new FormData(form);
const response = await fetch('/calculos/simular', {
method: 'POST',
body: formData,
headers: {
'X-Requested-With': 'XMLHttpRequest',
},
});
const data = await response.json();
if (!response.ok || !data.ok) {
throw new Error(data.message || 'Erro ao simular cálculo.');
}
renderLiveCalculation(data, els);
} catch (error) {
console.error('Erro ao simular cálculo:', error);
els.status.textContent = 'Erro';
els.status.className = 'status-badge status-review';
if (els.message) {
els.message.textContent = 'Não foi possível calcular em tempo real. Verifique a rota /calculos/simular ou os dados preenchidos.';
}
els.saveButton.disabled = true;
els.saveButton.textContent = 'Salvar indisponível';
}
}
public function store(): void
{
$payload = $this->buildCalculationPayload($_POST);
$projectData = $payload['project'];
$elevatorData = $payload['elevator'];
$populationItems = $payload['population'];
$calculatorInput = $payload['input'];
if ($projectData['project_name'] === '') {
$_SESSION['flash_error'] = 'Informe o nome do projeto.';
redirect('/calculos/novo');
}
if (empty($populationItems)) {
$_SESSION['flash_error'] = 'Informe pelo menos uma linha de população.';
redirect('/calculos/novo');
}
$forceSave = !empty($_POST['force_save']);
$forcedReason = trim($_POST['forced_reason'] ?? '');
$overrides = [
'ignore_interval_rule' => !empty($_POST['ignore_interval_rule']),
'ignore_capacity_rule' => !empty($_POST['ignore_capacity_rule']),
];
$usageParameterRepo = new UsageParameterRepo();
$usageParams = $usageParameterRepo->findByUsageType($projectData['usage_type']);
$calculator = new ElevatorTrafficCalculator();
$validator = new CalculationValidator();
$result = $calculator->calculate($calculatorInput);
$validation = $validator->validate($result, $usageParams, $overrides);
$finalResult = array_merge($result, $validation);
if ($finalResult['final_status'] !== 'approved' && !$forceSave) {
$_SESSION['flash_error'] = 'Este cálculo ainda não atende aos critérios técnicos. Ajuste os dados ou use o salvamento forçado.';
redirect('/calculos/novo');
}
if ($finalResult['final_status'] !== 'approved' && $forceSave) {
$finalResult['is_forced_save'] = 1;
$finalResult['forced_reason'] = $forcedReason !== ''
? $forcedReason
: 'Salvamento forçado pelo negociador.';
$finalResult['final_status'] = 'forced';
$projectData['final_status'] = 'forced';
} else {
$finalResult['is_forced_save'] = 0;
$finalResult['forced_reason'] = null;
$projectData['final_status'] = 'approved';
}
$projectRepo = new ProjectRepo();
$populationRepo = new PopulationRepo();
$elevatorDataRepo = new ElevatorDataRepo();
$calculationRepo = new CalculationRepo();
$projectId = $projectRepo->create($projectData);
$populationRepo->createMany($projectId, $populationItems);
$elevatorDataRepo->create($projectId, $elevatorData);
$calculationRepo->create($projectId, $finalResult);
$projectRepo->updateStatus($projectId, $finalResult['final_status']);
$_SESSION['flash_success'] = $finalResult['final_status'] === 'forced'
? 'Cálculo salvo no histórico por confirmação forçada.'
: 'Cálculo aprovado e salvo no histórico.';
redirect('/calculos/' . $projectId);
}
MotionCalc reduced the reliance on manual spreadsheet analysis, made scenario testing faster and created a consistent base for technical decisions, history and reports.
The project reinforced the importance of turning complex rules into actionable feedback: a good technical system doesn't just calculate, it points to the next adjustment.