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"
TipInteger/Binary Domains Supported
The "integer" and "binary" domains are fully supported for linear problems via scipy.optimize.milp() (HiGHS backend). Problems with integer/binary variables and a linear objective are automatically routed to the MILP solver. For nonlinear objectives with discrete variables (MIQP/MINLP), a clear error is raised. See the Integer Programming tutorial.
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.