Parameters are important in any openLCA model, or any LCA model in general. They enable you to run scenarios, sensitivity, and control the model from a product system level. However, within IPC, they become far more powerful, as they let you run thousands of scenarios, or do complex uncertainty analysis, or anything else you want to do.
What a parameter does
Instead of typing a number directly into an exchange amount, you give the exchange a parameter name. The parameter holds the value. openLCA substitutes it at calculation time.
A process that consumes electricity might have an exchange amount set to the parameter electricity_kWh. The parameter holds a value of 170. The result is the same as typing 170 directly, but now you can update that value from a script or CSV and every exchange referencing it picks up the change.
Independent vs dependent parameters
Independent parameters are inputs. They have a fixed value that you set directly: a transport distance, an electricity consumption figure, a material mass. These are the parameters you control from your scenario CSV.
Dependent parameters are calculated from other parameters using formulas. If your model has total_transport_tkm defined as mass_kg * distance_km, then total_transport_tkm is dependent. You set mass_kg and distance_km; openLCA calculates the rest.
For IPC scripting, this means you only need to set the independent parameters. openLCA’s formula engine evaluates all the dependent ones automatically.
Where parameters live
Global parameters are defined once and available across the entire database. If several processes use the same grid carbon intensity, a global parameter keeps that value in one place.
Process (local) parameters belong to a single process. A resin consumption figure that only applies to one manufacturing step is better as a process parameter than a global one.
When you create a product system, openLCA collects every parameter that affects it, both global and process-level. These are the parameters you can redefine via IPC. Each one carries a ‘context’ that tells openLCA where it belongs. The example scripts in this series handle this matching by calling client.get_parameters() and building a lookup.
The formula engine
openLCA’s parameter formulas support a full set of mathematical operations. Your model can contain complex dependent calculations that resolve automatically when you feed in new independent values through IPC.
Operators
Operators follow standard mathematical precedence. Exponentiation evaluates before multiplication, which evaluates before addition.
| Precedence | Operator | Description | Example |
|---|---|---|---|
| 7 | - (unary) | Negation | -1 → -1 |
| 6 | ^ | Exponentiation | 2^3 → 8 |
| 5 | * | Multiplication | 2*2 → 4 |
| 5 | / | Division | 2/2 → 1 |
| 5 | div | Integer division | 7 div 2 → 3 |
| 5 | mod | Modulus | 7 mod 2 → 1 |
| 4 | + | Addition | 1+1 → 2 |
| 4 | - | Subtraction | 1-1 → 0 |
| 3 | = / == | Equal to | 1 = 1 → true |
| 3 | <> / != | Not equal to | 1 <> 2 → true |
| 3 | < | Less than | 2 < 2 → false |
| 3 | <= | Less than or equal to | 2 <= 2 → true |
| 3 | > | Greater than | 3 > 2 → true |
| 3 | >= | Greater than or equal to | 3 >= 4 → false |
| 2 | & / && | Logical AND | true() & false() → false |
| 1 | | / || | Logical OR | true() | true() → true |
Built-in constants
| Constant | Value |
|---|---|
pi | 3.141592654 |
e | 2.718281828 |
Functions
| Function | Description | Example |
|---|---|---|
abs(x) | Absolute value | abs(-1) → 1 |
acos(x) | Inverse cosine | acos(-1) → 3.14159 |
and(x1;x2;...xn) | Logical AND | and(1<2;2>1) → true |
asin(x) | Inverse sine | asin(-1) → -1.57080 |
atan(x) | Inverse tangent | atan(-1) → -0.78540 |
avg(x1;...;xN) | Arithmetic mean | avg(1;2;3) → 2 |
ceil(x) | Smallest integer >= x | ceil(2.2) → 3 |
cos(x) | Cosine | cos(0) → 1 |
cosh(x) | Hyperbolic cosine | cosh(0) → 1 |
cotan(x) | Cotangent | cotan(pi/2) → 0 |
exp(x) | e^x | exp(2) → 7.38906 |
floor(x) | Largest integer <= x | floor(2.7) → 2 |
frac(x) | Fractional part | frac(2.7) → 0.7 |
if(b;x;y) | Conditional | if(1>2;1;2) → 2 |
ipower(x;y) | x^y (integer y) | ipower(4;2) → 16 |
ln(x) | Natural logarithm | ln(7.389) → 2 |
lg(x) | Base 10 logarithm | lg(1000) → 3 |
max(x1;...;xN) | Maximum | max(1;2;3) → 3 |
min(x1;...;xN) | Minimum | min(1;2;3) → 1 |
not(b) | Logical complement | not(false) → true |
or(x1;x2;...;xn) | Logical OR | or(1<2;2<1) → true |
power(x;y) | x^y (any y) | power(4;2.2) → 21.112 |
random() | Random 0 to 1 | random() → … |
round(x) | Round to nearest integer | round(2.5) → 3 |
sin(x) | Sine | sin(2*pi) → 0 |
sinh(x) | Hyperbolic sine | sinh(0) → 0 |
sqr(x) | Square | sqr(2) → 4 |
sqrt(x) | Square root | sqrt(4) → 2 |
tan(x) | Tangent | tan(pi/4) → 1 |
tanh(x) | Hyperbolic tangent | tanh(0.5) → 0.46 |
trunc(x) | Integer part | trunc(2.7) → 2 |
Note that functions use semicolons as argument separators. avg(1;2;3) is correct; avg(1,2,3) won’t parse.
A practical example
Consider a transport calculation with three independent parameters:
mass_kg= 500distance_km= 120return_trip_factor= 1 (one-way) or 2 (return)
And one dependent parameter with a formula:
transport_tkm=mass_kg * distance_km * return_trip_factor / 1000
In a scenario CSV, you’d set mass_kg, distance_km, and return_trip_factor. There’s no need to set transport_tkm because openLCA evaluates the formula with whatever values you provided and uses the result in the exchange.
This is why your CSV only needs independent parameters. The model already knows how to calculate everything else.
Finding your parameter names
Before building a scenario CSV, you need the exact parameter names from your model.
In the GUI: open your product system, go to the Parameters tab. The ‘Name’ column shows what goes in your CSV. Parameter names are case-sensitive, so copying them directly avoids errors.
Via IPC:
python
from olca_ipc import Client
import olca_schema as o
client = Client(8080)
systems = client.get_descriptors(o.ProductSystem)
system = systems[0] # or find yours by name
params = client.get_parameters(o.ProductSystem, system.id)
for p in params:
scope = "global" if p.context is None else "process"
print(f" {p.name} = {p.value} ({scope})")
This gives you every parameter the product system uses, with its current value and whether it’s global or process-scoped.
