I'm solving a (constrained) nonlinear minimization problem with three variables (w,V,m). Given w the minimization problem is (constrained) linear for (V,m). The linear minimization problem is defined for w in [w\_0, w\_1].

The way I've set up the problem is that given w, I'm solving a constrained linear program and then I'm minimizing it over w with `bounds = ((w_0, w_1),)` the range of w as bounds. I'm running into problems when the minimization over w searches outside it's bounds i.e. to a region where the linear program is not defined.

Is there a way to restrict the search to not go outside the provided bounds?
If not are there alternatives? Pass tighter bounds? Make the objective function return a large value if it is passed a value outside the bounds?

I'm sorry for not being able to provide a minimal working example.

Here is some pseudo-code:

```
from scipy.optimize import linprog,minimize

def objective(w):
A_ub,b_ub = constraints(w)
results = linprog(c,A_ub = A_ub,b_ub=b_ub)
return results.fun

bounds = ((w_0,w_1),)
x0 = (w_0+w_1)/2
minimize(objective,x0,bounds)

```