Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #11887
| From | Ray Koopman <koopman@sfu.ca> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: maximization with array of constraints |
| Date | 2012-09-28 03:02 +0000 |
| Message-ID | <k4340n$nc1$1@smc.vnet.net> (permalink) |
| References | <k40u9c$j5l$1@smc.vnet.net> |
| Organization | Time-Warner Telecom |
On Sep 27, 12:14 am, Felipe <felipe.bengu...@gmail.com> wrote:
> Hi,
>
> I am trying to maximize a function using NMaximize and I have a large list of constraints that I would like to write with a loop or as an array.
>
> It looks like the following:
>
> NMaximize[{myfunction[x,y] , x*mydata[[1,row,1]] + y*mydata[[1,row,2]] >0 }]
>
> and I want the restriction to be valid for the numbers in each row of the "mydata" array. That is, if mydata is an array with two columns and 100 rows, I would have 100 constraints, which are too many to enter manually.
> Can I write a loop for the constraints inside NMaximize ? Do you have some suggestion on how to write this? I was not able to find it in earlier posts.
>
> Thank you very much for your help
> Felipe
NMaximize[{myfunction[x,y], And@@Positive[mydata[[1]].{x,y}]}, {x,y}]
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
maximization with array of constraints Felipe <felipe.benguria@gmail.com> - 2012-09-27 07:12 +0000 Re: maximization with array of constraints Ray Koopman <koopman@sfu.ca> - 2012-09-28 03:02 +0000 Re: maximization with array of constraints Frank K <fkampas@gmail.com> - 2012-09-28 03:05 +0000
csiph-web