Decision variables that the optimizer will determine.
TipVector Variables
For creating arrays of variables (e.g., x[0], x[1]), use VectorVariable instead of creating individual Variable objects in a loop.
from optyx import Variablex = Variable(name, lb=None, ub=None, domain="continuous")
1.1 Parameters
Parameter
Type
Description
Default
name
str
Unique identifier for the variable
Required
lb
float | None
Lower bound
None (unbounded)
ub
float | None
Upper bound
None (unbounded)
domain
str
One of "continuous", "integer", "binary"
"continuous"
WarningInteger/Binary Domains Relaxed
The "integer" and "binary" domains are accepted but relaxed to continuous values when using the SciPy solver backend. A runtime warning is emitted when this occurs. For true mixed-integer programming, consider using PuLP or Pyomo.
from optyx import Constant, Variable# Explicit constantc = Constant(3.14)print(f"Value: {c.evaluate({})}")# Constants are created automatically from numbersx = Variable("x")expr =2* x +5# 2 and 5 become Constant nodes
Value: 3.14
3 Mathematical Functions
Transcendental and special functions for building expressions.