Suppose I have two affine functions $f:\mathbb{R}^n\to \mathbb{R}$
$f(\vec{x}) = a_1\cdot x_1 + \dots + a_n \cdot x_n +q$
and
$h(\vec{x}) = b_1 \cdot x_1 + \dots + b_n \cdot x_n + p$
where $x_i$ are bounded varibles (for each $x_i$ there is a Interval with $x_i\in[l_i, u_i]$) . What im trying to find are the bounds of the set $\{ f(x) \,| \,h(x)=0\}$.
First i was trying to isolate one variable (for instance $x_1$) in $h(\vec{x})=0$
$\Leftrightarrow 0 = b_1 \cdot x_1 + \dots + b_n \cdot x_n + p $
and then replace it in $f(\vec{x})$.
I then used interval arithmetic to replace the variables by their bounds to get the bounds of the set I defined above. But the result I get depends on which variable i'm isolating as they are not part of the resulting equation. So this can't be the solution.
Then I thought about interpreting it geometrically and calculate the intersection of two hyperplanes, but then I can't seem to figure out how to calculate the bounds.
I would really appreciate if someone could give me a hint here on how to correctly calculate the bound of the set $\{ f(x) \,| \,h(x)=0\}$.
Thank you for your time and help!
Below is an algorithmic approach. It's exponental in the dimension $n$, so that it's only feasible for small dimensions. What it does is
Iterate over the $2^n$ corners of an $n$-dimensinal cube, and for each corner iterates over adjacent edges. There's a total of $n\cdot2^{n-1}$ edges.
The hyper-cube (resp. its corners) are mapped to the domain of $h$ which is the Cartesian product over all $[\ell_i, u_i]$. Then $h$ is evaluated at the edges (resp. their end-points) and checked whether $h(x) = 0$ on the edge by means of a sign-flip, i.e. one has found $x_1$, $x_2$ such that $h(x_1)h(x_2)\leqslant 0$.
If $h$ flips sign from $x_1$ to $x_2$, then calculate $t\in[0,1]$ such that $h(x=tx_1 + (1-t)x_2) = 0$. This is straight forward as $h$ is linear and edges are lines: $t = h(x_2) \,/\, (h(x_2)-h(x_1))$.
Compute $f(x) = f(tx_1 + (1-t)x_2) = tf(x_1) + (1-t)f(x_2)$ and accumulate it into $f_\min$ and $f_\max$.
The code uses implicitly that the domain $D$ restricted to $h(x)=0$ is a convex polytope, that $h$ is linear and that $f$ is linear. In particular, I made the assumption that if $H=\{x\mid h(x)=0\}$ is non-empty, then $f|_H$ attains its extrema on the corners of $H$.
As input I used the values from your other comment; the output is
f_min, f_max = 3.0 7.5.