Re: FindMinimum constraints
- To: mathgroup at smc.vnet.net
- Subject: [mg92963] Re: FindMinimum constraints
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Tue, 21 Oct 2008 01:44:03 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <gdja4r$idt$1@smc.vnet.net>
dantimatter wrote: > I have a large and complicated model for which I'm using the > FindMinimum function to find a solution. The solution consists of 101 > numbers a[i] (i goes from 0 to 100), all greater than zero, and the > search for each a[i] begins at 0.001: > > sol = FindMinimum[{model, Table[a[i] > 0,{i, 0, 100}]}, Table[{a[i], > 0.001},{i, 0, 100}]]; > > The line of code that I'm showing here works great. My problem now is > that I'd like to add an additional constraint: that a[100] == > 0.5*(a[0]+a[25]). I can't for the life of me figure out how to > include this added constraint in the line of code that already works. > I get errors when I use Append[] to the Table. I would appreciate any > thoughts on this. Using *Join* should do the trick. For instance, sol = FindMinimum[{model, Join[{a[100] == 0.5*(a[0] + a[25])}, Table[a[i] > 0, {i, 0, 100}]]}, Table[{a[i], 0.001}, {i, 0, 100}]] Regards, -- Jean-Marc