mirror of
https://github.com/powdr-labs/powdr.git
synced 2026-01-09 14:48:16 -05:00
Removes the special introduction and removal of bus variables because the solver can now handle this on its own through the `LinearizedSolver` component. It also has the benefit that we do not need to run the optimizer twice any more (once with bus interaction variables and once without). Previously we would introduce a new variable type outside of the solver and replace all bus interactions `bus_interaction(1, x + y * z)` by `bus_interaction(1, bus_var_1)` and the algebraic constraint `bus_var_1 = x + y * z`. Now the `LinearizedSolver` is a component inside the solver that replaces all bus interaction fields (that are not already constants or simple variables) and also replaces all non-linear components: `bus_interaction(1, x + y * z)` becomes ``` bus_interaction(1, v1) v1 = x + v2 v2 = y * z ``` The reason behind also replacing non-linear parts is because range constraints are only stored for variables, not for all sub-expressions. Also if we find the same non-linear sub-expression multiple times, we can now replace it directly by the same variable. --------- Co-authored-by: Georg Wiese <georgwiese@gmail.com>