Documentation Index
Fetch the complete documentation index at: https://mintlify.com/David9604/BackMaqagr/llms.txt
Use this file to discover all available pages before exploring further.
All calculations in this module follow ASABE D497.7 standards and academic research from Prof. Chaparro’s agricultural engineering methodology.
Overview
The MaqAgr API implements sophisticated power loss calculations that determine the actual available power of a tractor under real working conditions. The system accounts for six major loss factors:- Altitude Loss: Reduced air density at higher elevations
- Temperature Loss: Engine efficiency decrease in hot climates
- Transmission Loss: Mechanical friction losses (default 13%)
- Rolling Resistance: Soil-dependent friction forces
- Slope Loss: Gravitational resistance on inclined terrain
- Slippage Loss: Power lost to wheel slippage
The Physics Behind Power Loss
Conversion Factor
All calculations use the standard conversion factor:Loss Cascade
Power losses occur in a cascading sequence:1. Altitude Loss
Engine power decreases with altitude due to lower air density (less oxygen). Formula:- At 1500m altitude with 100 HP engine:
- Loss = 100 × (1500/300) × 0.01 = 5 HP
2. Temperature Loss
High ambient temperatures reduce engine efficiency. Formula:- At 35°C with 100 HP engine:
- Loss = 100 × ((35-15)/5) × 0.01 = 4 HP
3. Rolling Resistance
The most complex calculation, based on ASABE D497.7 soil cone index. Formula:Cn= Soil cone index (penetration resistance)W= Total tractor weight (kg)θ= Slope angle (radians)v= Speed (m/s)
| Soil Type | Cn | Condition |
|---|---|---|
| Clay (Arcilla) | 45 | Hard, sticky |
| Loam (Franco) | 35 | Medium (default) |
| Sand (Arena) | 25 | Loose, low traction |
| Firm (Firme) | 50 | Compacted |
| Soft (Suave) | 20 | Very loose |
- Weight: 5000 kg
- Soil: Clay (Cn=45)
- Slope: 0° (flat)
- Speed: 8 km/h = 2.22 m/s
4. Slope Loss
Gravitational component when climbing. Formula:- Weight: 5000 kg
- Slope: 10% → 5.71°
- Speed: 6 km/h = 1.67 m/s
Slope loss is zero for downhill (negative slopes) as the tractor gains gravitational assistance.
5. Slippage Loss
Power wasted when wheels spin without full traction. Formula:- 8-12%: Normal conditions, good traction
- 15-20%: Poor soil conditions
- 25%+: Critical, indicates equipment mismatch
- Available power: 80 HP
- Slippage: 15%
- Loss = 80 × 0.15 = 12 HP
API Endpoints
Calculate Power Loss
Calculates all power losses for a tractor-terrain combination.Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
tractor_id | integer | Yes | ID of the tractor |
terrain_id | integer | Yes | ID of the terrain |
working_speed_kmh | number | Yes | Operating speed (km/h) |
carried_objects_weight_kg | number | No | Additional load weight (default: 0) |
slippage_percent | number | No | Wheel slippage percentage (default: 10) |
Response
The
queryId is stored in the database for historical tracking and can be retrieved later via the history endpoint.Error Responses
400 Bad Request - Missing required fields:Calculate Minimum Power
Calculates the minimum power required for an implement and classifies tractors by compatibility.Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
implement_id | integer | Yes | ID of the implement |
terrain_id | integer | Yes | ID of the terrain |
working_depth_m | number | No | Working depth override (meters) |
Formula
- F_soil: Clay=1.3, Loam=1.0, Sandy=0.8, Rocky=1.5
- F_slope: 1 + (slope_percent / 100) × 0.5
- F_depth: working_depth_m / 0.25
- 1.15: 15% safety margin
Tractor Classification
| Category | Power Range | Color | Description |
|---|---|---|---|
| OPTIMAL | 100-125% | 🟢 Green | Perfect power match |
| OVERPOWERED | >125% | 🟡 Yellow | Excess power, less efficient |
| INSUFFICIENT | <100% | 🔴 Red | Not compatible |
Response
Calculation History
Retrieve the user’s calculation history with pagination and filtering.Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number |
limit | integer | 10 | Records per page (max: 100) |
type | string | all | Filter: power_loss, minimum_power, recommendation |
Response
Real-World Example
Let’s calculate the net power for a John Deere 6130M (130 HP) operating in challenging conditions: Scenario:- Location: Highland farm at 2100m altitude
- Temperature: 28°C
- Terrain: 12% slope, clay soil
- Tractor weight: 6200 kg + 800 kg implement
- Speed: 6.5 km/h
- Slippage: 12%
Result Summary:
| Component | HP Lost | % of Gross |
|---|---|---|
| Altitude | 9.10 | 7.0% |
| Temperature | 3.38 | 2.6% |
| Transmission | 15.28 | 11.8% |
| Rolling | 3.06 | 2.4% |
| Slope | 5.50 | 4.2% |
| Slippage | 11.24 | 8.6% |
| Total Loss | 47.56 | 36.6% |
| Net Power | 82.44 | 63.4% |
This tractor loses over 36% of its rated power under these conditions! Always account for real-world losses when sizing equipment.
Code Reference
The power loss calculation engine is implemented in:- Controller:
src/controllers/calculationController.js:25(calculatePowerLoss) - Service:
src/services/powerLossService.js:294(calculateTotalLoss) - Model:
src/models/PowerLoss.js - Routes:
src/routes/calculation.routes.js:89
src/controllers/calculationController.js:15):
Related Topics
Recommendations
Smart tractor recommendation algorithm
Terrains API
Manage terrain profiles
Tractors API
Tractor catalog operations
ASABE Standards
Official agricultural engineering standards
