[Date Index]
[Thread Index]
[Author Index]
Re: FindMinimum constraints
*To*: mathgroup at smc.vnet.net
*Subject*: [mg92986] Re: FindMinimum constraints
*From*: dantimatter <google at dantimatter.com>
*Date*: Wed, 22 Oct 2008 05:37:33 -0400 (EDT)
*References*: <gdja4r$idt$1@smc.vnet.net> <gdjq6u$mtu$1@smc.vnet.net>
Thanks for the quick response. Join[] did indeed do the trick.
But adding this constraint introduced another problem. By fixing
a[100] == 0.5*(a[0] + a[25], I (inadvertently) allowed FindMinimum to
choose solutions that seem to have discontinuous derivatives (i.e.,
there are really sharp points at a[100], a[0], and a[25]). I guess I
should also somehow force the solution to be sufficiently 'smooth'.
Is there an easy way to do that?
Thanks again for all the help!
Dan
On Oct 21, 1:43 am, Jean-Marc Gulliet <jeanmarc.gull... at gmail.com>
wrote:
> 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 10=
1
> > 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 i=
s
> > 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, 10=
0}]]
>
> Regards,
> -- Jean-Marc
Prev by Date:
**Controlling the order of evaluations**
Next by Date:
**Re: Speeding up a list construction**
Previous by thread:
**Re: FindMinimum constraints**
Next by thread:
**Re: Speeding up a list construction**
| |