# Constraints thread over lists, for NMinimize

I have the following code

fc[x_] := a + b*x^c + d*x^e

listNumber = {1,2,3,4,5}

list = {a,b, c,.. , e}

answF = NMinimize[{Abs[fitFl],
fc[listNumber[[1]] ] <= 1 &&  fc[listNumber[[2]] ]  <= 1 && fc[listNumber[[3]] ] <= 1
&& fc[listNumber[[4]] ] <= 1 && fc[listNumber[[5]] ] <= 1,
list[[1]] > 5, list [[2]] >5} , {a, b, c, d,  e, qB, qT}]


I want to apply a constraint over every element in a list. I've hard coded above , how could I thread across the whole list. Similarly for the function, how could I thread across the whole list (listNumber).

Hard coding works for a small list, but if the size of the list increases, this becomes an issue.

• Why not And @@ Thread[fc[listNumber] <= 1]? – J. M. will be back soon Nov 14 '17 at 11:22
• J.M. I could not get that to work for the function, I suspect I'm missing some code. My "list" array is larger. Do you have any method for a list with no function. thks – SPIL Nov 14 '17 at 15:14

fc[x_] := a + b*x^c + d*x^e;