Overview
Calculates the power losses of a tractor operating on specific terrain conditions. The calculation considers multiple loss factors including slope, altitude, rolling resistance, and wheel slippage. The result is persisted in the database with audit logging for historical tracking and analysis.Loss Factors Calculated
The endpoint computes four primary loss factors:- Slope Loss: Power loss due to terrain inclination
- Altitude Loss: Power loss due to altitude above sea level (air density reduction)
- Rolling Resistance: Loss according to soil type (based on ASABE D497.7 Cone Index)
- Slippage Loss: Power loss due to wheel slip
Authentication
This endpoint requires authentication via Bearer token in the Authorization header.Request Body
ID of the tractor to evaluate. Must be a positive integer greater than 0.
ID of the terrain where the tractor will operate. Must be a positive integer greater than 0.
Working speed in kilometers per hour. Must be greater than 0 and less than 40 km/h.Validation: 0 < working_speed_kmh < 40
Weight of carried objects/implements in kilograms. Must be non-negative.Default: 0Validation: carried_objects_weight_kg >= 0
Wheel slippage percentage. Typical values range from 5% to 20%.Default: 10
Response
Indicates whether the calculation was successful.
Human-readable message describing the result.
Container for calculation results.
Request Example
Response Example
Error Responses
Returned when required fields are missing or validation fails.Or for validation errors:
Returned when the authentication token is missing or invalid.
Returned when the specified tractor or terrain is not found.Or:
Returned when an unexpected error occurs during processing.
Validation Rules
| Parameter | Type | Required | Validation |
|---|---|---|---|
tractor_id | integer | Yes | Must be > 0 |
terrain_id | integer | Yes | Must be > 0 |
working_speed_kmh | number | Yes | 0 < value < 40 |
carried_objects_weight_kg | number | Yes | Must be >= 0 |
slippage_percent | number | No | Defaults to 10 |
Soil Type Cone Index (Cn) Mapping
The rolling resistance calculation uses the ASABE D497.7 Cone Index standard:| Soil Type | Cone Index (Cn) |
|---|---|
| Clay / Arcilla | 45 |
| Loam / Franco | 35 (default) |
| Sand / Arena | 25 |
| Firm / Firme | 50 |
| Soft / Suave | 20 |
Notes
- All calculations are persisted to the database with audit logging
- The
queryIdcan be used to retrieve calculation history via the/api/calculations/historyendpoint - Default temperature of 15°C is used if not specified in terrain data
- Results are logged for analytics and performance tracking (src/controllers/calculationController.js:144-152)
