Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mangrovesystems.com/llms.txt

Use this file to discover all available pages before exploring further.

What you’ll build in this exercise:
  • Create a comprehensive test dataset representing one month of Mangrove Biochar operations
  • Run the full calculation pipeline and validate every batch output
  • Verify all ledger balances reconcile
  • Document and fix any integration issues discovered during testing
This is the most comprehensive exercise in the course. You’ll load a full month of realistic test data, run the complete pipeline, and systematically validate every output. Think of this as a dress rehearsal for production. Prerequisites: Complete Lesson 5.1, Lesson 5.2, and Lesson 5.3. Your project should have all event types, models, batch partitioning, and LCA calculations from Modules 1-4.

Part 1: Design (30 min)

1. Define test scenarios

Plan your test dataset to cover all three scenario types:

Happy Path

Normal operations:
  • 4 typical deliveries (2-6 t)
  • 5 feedstock receipts
  • 3 lab analyses
  • Standard moisture (10-20%)
  • Typical H:C ratio (0.2-0.5)

Edge Cases

Boundary values:
  • 1 high-moisture receipt (50%)
  • 1 high H:C ratio analysis (0.75)
  • 1 very small delivery (0.5 t)
  • 1 zero-distance transport

Error Cases

Invalid data:
  • Missing a required datapoint
  • Event outside accounting period
  • Duplicate tracking IDs

2. Calculate expected outputs

Before running the pipeline, calculate the expected output for every batch in a spreadsheet. Include:
  • Gross carbon for each delivery
  • Proportional emission allocation (by mass)
  • Direct transport emissions per delivery
  • Net carbon per batch
  • Ledger totals and balances

3. Identify potential failure points

List what might go wrong:
  • Slug mismatches between new event types and model nodes
  • Date range issues with edge case events
  • Allocation denominators including edge case batches
  • Missing aggregation for energy consumption events

Part 2: Build in Mangrove (1.5 hrs)

Step 1: Create the January 2024 test dataset

Create the following events using Add Data or Bulk Import : 5 Feedstock Receipt events:
ReceiptDateWet Mass (t)Moisture %Feedstock Type
FR-001Jan 21215Agricultural waste
FR-002Jan 81012Forestry residue
FR-003Jan 141518Agricultural waste
FR-004Jan 20850Agricultural waste (edge case)
FR-005Jan 271114Forestry residue
3 Lab Analysis events:
AnalysisDateCarbon %H:C RatioAsh %
LA-001Jan 5800.358
LA-002Jan 15780.4210
LA-003Jan 25820.756 (edge case: high H:C)
4 Biochar Delivery events:
DeliveryDateMass (t)Carbon %
DEL-001Jan 7580
DEL-002Jan 14378
DEL-003Jan 21482
DEL-004Jan 280.579 (edge case: very small)
1 Energy Consumption event (January):
  • Electricity: 12,000 kWh
  • Propane: 600 gallons
  • Period: Jan 1 – Jan 31
4 Transportation events:
DeliveryDistance (km)Fuel Type
DEL-001180Diesel
DEL-002150Diesel
DEL-0030n/a (edge case: on-site)
DEL-004200Diesel
Use bulk importfor faster data entry when creating many events. Prepare a CSV with all required columns matching your event type slugs.

Step 2: Run the full pipeline

  1. Go to Production Accounting and generate batches for January 2024.
  2. Resolve any validation messages — these indicate missing or problematic data.
  3. Submit to generate batches.
If you see validation errors, don’t skip them — they’re the first sign of integration issues. Check the pitfalls from Lesson 5.3 to diagnose the root cause.

Step 3: Validate batch outputs

For each of the 4 delivery batches, compare the pipeline output against your expected values:
1

Check gross carbon

Does the gross tCO2e for each batch match your spreadsheet? If not, check the production model nodes (dry mass → carbon → CO2 conversion).
2

Check emission allocation

Are electricity and propane emissions allocated proportionally by mass? Do the allocations across all batches sum to the total period emissions?
3

Check transport emissions

Is DEL-003’s transport emission zero (on-site delivery)? Are other deliveries’ transport emissions correct?
4

Check net carbon

Does net = gross - (allocated electricity + allocated propane + transport) for each batch?
5

Check edge case batches

DEL-004 (0.5 t): Is the net carbon very small or potentially negative? If negative, flag this — the methodology may require a minimum batch size or different handling.

Step 4: Verify ledger reconciliation

Check each ledger’s balance:
LedgerCredits (In)Debits (Out)Balance
Feedstock InventorySum of dry feedstock massesAllocated to productionShould be ≥ 0
Biochar ProductionSum of biochar producedAllocated to deliveryShould be ≥ 0
Carbon DeliveredSum of net tCO2eAllocated to reportsRunning total
If a ledger balance goes negative, it means you’re claiming more output than input at that stage — a mass balance violation that must be resolved before reporting.

Step 5: Document and fix issues

For every issue found:
  1. Describe the symptom — what output was wrong?
  2. Identify the root cause — which pitfall from Lesson 5.3?
  3. Apply the fix — update the configuration
  4. Re-run and verify — confirm the fix resolves the issue

Success criteria

You have completed the Module 5 exercise when:
  • Test dataset created — 17 events across 5 event types covering happy path and edge cases
  • Pipeline executed — Generate Batches runs for January 2024 without unresolved validation errors
  • 4 batches generated — one per delivery, with correct gross and net carbon values
  • Batch outputs match — all values within 1% of your pre-calculated expected outputs
  • Emissions correctly allocated — proportional allocations sum to period totals, direct allocations are batch-specific
  • Ledger balances reconcile — no negative balances, inputs ≥ outputs at each stage
  • Edge cases handled — high moisture, high H:C, small delivery, and zero-distance transport produce correct results
  • Issues documented — any problems found during testing are documented with root cause and fix

What’s next

Your Mangrove Biochar project now passes comprehensive testing. In Module 6: Advanced Patterns & Production you’ll learn best practices for model design, advanced techniques, and how to prepare your project for production deployment.