Understanding Parameters in openLCA

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.

PrecedenceOperatorDescriptionExample
7- (unary)Negation-1 → -1
6^Exponentiation2^3 → 8
5*Multiplication2*2 → 4
5/Division2/2 → 1
5divInteger division7 div 2 → 3
5modModulus7 mod 2 → 1
4+Addition1+1 → 2
4-Subtraction1-1 → 0
3= / ==Equal to1 = 1 → true
3<> / !=Not equal to1 <> 2 → true
3<Less than2 < 2 → false
3<=Less than or equal to2 <= 2 → true
3>Greater than3 > 2 → true
3>=Greater than or equal to3 >= 4 → false
2& / &&Logical ANDtrue() & false() → false
1| / ||Logical ORtrue() | true() → true

Built-in constants

ConstantValue
pi3.141592654
e2.718281828

Functions

FunctionDescriptionExample
abs(x)Absolute valueabs(-1) → 1
acos(x)Inverse cosineacos(-1) → 3.14159
and(x1;x2;...xn)Logical ANDand(1<2;2>1) → true
asin(x)Inverse sineasin(-1) → -1.57080
atan(x)Inverse tangentatan(-1) → -0.78540
avg(x1;...;xN)Arithmetic meanavg(1;2;3) → 2
ceil(x)Smallest integer >= xceil(2.2) → 3
cos(x)Cosinecos(0) → 1
cosh(x)Hyperbolic cosinecosh(0) → 1
cotan(x)Cotangentcotan(pi/2) → 0
exp(x)e^xexp(2) → 7.38906
floor(x)Largest integer <= xfloor(2.7) → 2
frac(x)Fractional partfrac(2.7) → 0.7
if(b;x;y)Conditionalif(1>2;1;2) → 2
ipower(x;y)x^y (integer y)ipower(4;2) → 16
ln(x)Natural logarithmln(7.389) → 2
lg(x)Base 10 logarithmlg(1000) → 3
max(x1;...;xN)Maximummax(1;2;3) → 3
min(x1;...;xN)Minimummin(1;2;3) → 1
not(b)Logical complementnot(false) → true
or(x1;x2;...;xn)Logical ORor(1<2;2<1) → true
power(x;y)x^y (any y)power(4;2.2) → 21.112
random()Random 0 to 1random() → …
round(x)Round to nearest integerround(2.5) → 3
sin(x)Sinesin(2*pi) → 0
sinh(x)Hyperbolic sinesinh(0) → 0
sqr(x)Squaresqr(2) → 4
sqrt(x)Square rootsqrt(4) → 2
tan(x)Tangenttan(pi/4) → 1
tanh(x)Hyperbolic tangenttanh(0.5) → 0.46
trunc(x)Integer parttrunc(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 = 500
  • distance_km = 120
  • return_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.