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.
- Break methodology formulas into discrete calculation steps
- Understand the Model Editor’s node tree architecture
- Use operators (summation, product, quotient, Keisan) to build calculations
- Distinguish intermediate calculations from final outputs
mass × carbon_content × 3.67. Real-world methodologies require multi-step calculations — chains of intermediate values that feed into a final output. This lesson teaches you how to structure those calculations in Mangrove’s Model Editor.
How calculations work in Mangrove
Mangrove’s Model Editor represents calculations as a node tree. Each node is either an input (data from events, static values, or constants) or a calculated node that combines its children using an operator.Node types
There are three categories of nodes in the Model Editor:Input Nodes
- Datapoint references — values from events
- Static inputs — fixed values from the resource library
- Constants — hardcoded values (e.g., 3.67 for CO2-to-carbon ratio)
Calculated Nodes
- Combine child nodes using an operator
- Can be intermediate (feed into other calculations)
- Or final output (produce the batch result)
Output Nodes
- A calculated node with a
data_point_typeassigned - Its value becomes a batch output datapoint
- Must match the slug expected by the batch type
Operators
Operators define how a node combines its children. The most common operators are:| Operator | What it does | Example |
|---|---|---|
summation | Adds all children | total_emissions = transport + process + embodied |
difference | Subtracts child 2 from child 1 | net = gross - deductions |
product | Multiplies all children | carbon = mass × percentage × factor |
quotient | Divides child 1 by child 2 | rate = total / count |
keisan | Custom expression (Ruby-like) | Complex formulas, conditionals |
- Simple operators
- Keisan expressions
summation, difference, product, or quotient. Each operates on the node’s children in order.Example — product operator: A node with operator product and three children (mass, carbon_pct, factor) computes: mass × carbon_pct × factor.Breaking formulas into steps
Real-world methodology formulas are often written as a single equation, but in Mangrove you break them into discrete steps. This makes models easier to test, debug, and audit.Identify the final output
Work backwards to find intermediate values
net_carbon = gross_carbon - total_emissions has two intermediate inputs.Map inputs to the leaves
Execution order and dependencies
The Model Editor evaluates nodes bottom-up — leaf nodes (inputs) are resolved first, then their parents, up to the root (output). You don’t need to specify execution order; the tree structure defines it.Testing your model
After building a model, use the Console in the Model Editor to test it:- Select a time range that includes test events
- Review the calculated values at each node
- Verify intermediate outputs match your expectations
- Confirm the final output produces the correct result
Check your understanding
What is the difference between an intermediate calculation and a final output?
What is the difference between an intermediate calculation and a final output?
data_point_type assigned — its value becomes a batch output datapoint visible in the batch record.When should you use a Keisan expression instead of a simple operator?
When should you use a Keisan expression instead of a simple operator?
Why should you break a single methodology formula into multiple calculation steps?
Why should you break a single methodology formula into multiple calculation steps?
Next, you’ll learn how to expand your data model with additional event types in Lesson 2.2: Expanding Your Data Model.