Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #14782 > unrolled thread
| Started by | Dana DeLouis <dana01@icloud.com> |
|---|---|
| First post | 2013-06-09 08:26 +0000 |
| Last post | 2013-06-19 05:19 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
Re: Unable to generate any initial points with NMaximize (or NMinimize) Dana DeLouis <dana01@icloud.com> - 2013-06-09 08:26 +0000
Re: Unable to generate any initial points with NMaximize (or NMinimize) Meike <meike@blub.net> - 2013-06-19 05:19 +0000
| From | Dana DeLouis <dana01@icloud.com> |
|---|---|
| Date | 2013-06-09 08:26 +0000 |
| Subject | Re: Unable to generate any initial points with NMaximize (or NMinimize) |
| Message-ID | <kp1e7d$80f$1@smc.vnet.net> |
Hello. It appears you don't have a response, so I'll give it a try.
> a > $MachineEpsilon
When you have a constraint such as this, you are saying that a solution of 4.440892*10^-16
is not really zero, and a valid solution.
2*$MachineEpsilon//N
4.440892*10^-16
For optimization problems, using ">" is usually a problem because of limits. I believe one should use ">=" for constraints.
If 'a was found to be around 0.000001, the program has to retry with a number smaller than this, yet greater than MachineEpsilon. The next try might be at 0.0000001, etc. There's not really a number smaller than MachineEpsilon (at machine precision of course) so what is the software to do?
Try using ">="
equ=1/(0.` +(0.012710615354858255` ... etc //FullSimplify;
const={a>=0,b>=0,fm>=0,c>=0,p>=0,
fm<=5,0.00009600189408524172` (5-fm)-40.451710009005595` b fm>=0};
{val,sol}=NMaximize[{equ,const},{a,b,fm,c,p},MaxIterations->1000]
However, I don't believe this problem has a solution as given. :>~
= = = = = = = = = =
HTH :>)
Dana DeLouis
Mac & Mathematica 9
= = = = = = = = = =
On Thursday, May 23, 2013 3:16:08 AM UTC-4, Meike wrote:
> I often get the error:
>
> NMaximize::incst: NMaximize was unable to generate any initial points satisfying the inequality constraints
> while there are clearly points satisfying the inequality constraints. For example:
> NMaximize[{1/(0.` + (0.012710615354858255` (0.07879657698200958` +
> a) (0.000046296899009293725` +
> 0.003958158898356454` b) (233.02777267494722` +
> 102.02996575509754` fm))/(a (4.892449413727213`*^-6 -
> 9.784898827454427`*^-7 fm - 0.4123000838756304` b fm)) + (
> 0.10155110608580004` (0.0367973376747971` +
> c) (0.5030193912642286` + 16.257272679476753` b +
> 0.0309411917473244` p))/b + (
> 219.22680202984347` (0.03970570642848887` +
> 0.013422101464134875` fm) (0.07972967880969935` +
> 0.14421246041749264` p))/(fm p)), a > $MachineEpsilon,
> b > $MachineEpsilon, fm > $MachineEpsilon, c > $MachineEpsilon,
> p > $MachineEpsilon,
>
> 0.00009600189408524172` (5 - fm) -
>
> 40.451710009005595` b fm > $MachineEpsilon, fm < 5.`}, {a, b, fm,
>
> c, p}, MaxIterations -> 1000]
>
>
>
> NMaximize::incst: NMaximize was unable to generate any initial points satisfying the inequality constraints {-0.000480009+0.0000960019 fm+40.4517 b fm<0}. The initial region specified may not contain any feasible points. Changing the initial region or specifying explicit initial points may provide a better solution. >>
>
>
>
> Clearly there are initial points, for example:
>
>
>
> 0.00009600189408524172` (5 - fm) -
>
> 40.451710009005595` b fm > $MachineEpsilon /. {b -> 0.0007,
>
> fm -> 0.00003}
>
>
>
> True
>
>
>
> Also, if I make a more simple example with the same constraint I do not get the same error. I know I could give initial values myself, but since I'm automatically generating many of the optimizations, I would prefer not to. And I would like to understand why I keep getting this error and if there is any way to solve it.
[toc] | [next] | [standalone]
| From | Meike <meike@blub.net> |
|---|---|
| Date | 2013-06-19 05:19 +0000 |
| Message-ID | <kprf1m$15d$1@smc.vnet.net> |
| In reply to | #14782 |
Thanks for your response. I think mathematica automatically converts > to >= in constraints. But even if I do that and use something like 0.00001 instead of $MachineEpsilon I get the same errors... I guess it's too hard for Mathematica to find the initial values and I have to specify them, but I shouldn't be that hard.
On Sunday, June 9, 2013 10:26:21 AM UTC+2, Dana DeLouis wrote:
> Hello. It appears you don't have a response, so I'll give it a try.
>
>
>
> > a > $MachineEpsilon
>
>
>
> When you have a constraint such as this, you are saying that a solution of 4.440892*10^-16
>
> is not really zero, and a valid solution.
>
>
>
> 2*$MachineEpsilon//N
>
> 4.440892*10^-16
>
>
>
>
>
> For optimization problems, using ">" is usually a problem because of limits. I believe one should use ">=" for constraints.
>
>
>
> If 'a was found to be around 0.000001, the program has to retry with a number smaller than this, yet greater than MachineEpsilon. The next try might be at 0.0000001, etc. There's not really a number smaller than MachineEpsilon (at machine precision of course) so what is the software to do?
>
>
>
> Try using ">="
>
>
>
> equ=1/(0.` +(0.012710615354858255` ... etc //FullSimplify;
>
>
>
> const={a>=0,b>=0,fm>=0,c>=0,p>=0,
>
> fm<=5,0.00009600189408524172` (5-fm)-40.451710009005595` b fm>=0};
>
>
>
>
>
> {val,sol}=NMaximize[{equ,const},{a,b,fm,c,p},MaxIterations->1000]
>
>
>
>
>
> However, I don't believe this problem has a solution as given. :>~
>
>
>
>
>
>
>
> = = = = = = = = = =
>
>
>
> HTH :>)
>
>
>
> Dana DeLouis
>
>
>
> Mac & Mathematica 9
>
>
>
> = = = = = = = = = =
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Thursday, May 23, 2013 3:16:08 AM UTC-4, Meike wrote:
>
>
>
> > I often get the error:
>
>
>
> >
>
>
>
> > NMaximize::incst: NMaximize was unable to generate any initial points satisfying the inequality constraints
>
>
>
> > while there are clearly points satisfying the inequality constraints. For example:
>
>
>
> > NMaximize[{1/(0.` + (0.012710615354858255` (0.07879657698200958` +
>
>
>
> > a) (0.000046296899009293725` +
>
>
>
> > 0.003958158898356454` b) (233.02777267494722` +
>
>
>
> > 102.02996575509754` fm))/(a (4.892449413727213`*^-6 -
>
>
>
> > 9.784898827454427`*^-7 fm - 0.4123000838756304` b fm)) + (
>
>
>
> > 0.10155110608580004` (0.0367973376747971` +
>
>
>
> > c) (0.5030193912642286` + 16.257272679476753` b +
>
>
>
> > 0.0309411917473244` p))/b + (
>
>
>
> > 219.22680202984347` (0.03970570642848887` +
>
>
>
> > 0.013422101464134875` fm) (0.07972967880969935` +
>
>
>
> > 0.14421246041749264` p))/(fm p)), a > $MachineEpsilon,
>
>
>
> > b > $MachineEpsilon, fm > $MachineEpsilon, c > $MachineEpsilon,
>
>
>
> > p > $MachineEpsilon,
>
>
>
> >
>
>
>
> > 0.00009600189408524172` (5 - fm) -
>
>
>
> >
>
>
>
> > 40.451710009005595` b fm > $MachineEpsilon, fm < 5.`}, {a, b, fm,
>
>
>
> >
>
>
>
> > c, p}, MaxIterations -> 1000]
>
>
>
> >
>
>
>
> >
>
>
>
> >
>
>
>
> > NMaximize::incst: NMaximize was unable to generate any initial points satisfying the inequality constraints {-0.000480009+0.0000960019 fm+40.4517 b fm<0}. The initial region specified may not contain any feasible points. Changing the initial region or specifying explicit initial points may provide a better solution. >>
>
>
>
> >
>
>
>
> >
>
>
>
> >
>
>
>
> > Clearly there are initial points, for example:
>
>
>
> >
>
>
>
> >
>
>
>
> >
>
>
>
> > 0.00009600189408524172` (5 - fm) -
>
>
>
> >
>
>
>
> > 40.451710009005595` b fm > $MachineEpsilon /. {b -> 0.0007,
>
>
>
> >
>
>
>
> > fm -> 0.00003}
>
>
>
> >
>
>
>
> >
>
>
>
> >
>
>
>
> > True
>
>
>
> >
>
>
>
> >
>
>
>
> >
>
>
>
> > Also, if I make a more simple example with the same constraint I do not get the same error. I know I could give initial values myself, but since I'm automatically generating many of the optimizations, I would prefer not to. And I would like to understand why I keep getting this error and if there is any way to solve it.
On Sunday, June 9, 2013 10:26:21 AM UTC+2, Dana DeLouis wrote:
> Hello. It appears you don't have a response, so I'll give it a try.
>
>
>
> > a > $MachineEpsilon
>
>
>
> When you have a constraint such as this, you are saying that a solution of 4.440892*10^-16
>
> is not really zero, and a valid solution.
>
>
>
> 2*$MachineEpsilon//N
>
> 4.440892*10^-16
>
>
>
>
>
> For optimization problems, using ">" is usually a problem because of limits. I believe one should use ">=" for constraints.
>
>
>
> If 'a was found to be around 0.000001, the program has to retry with a number smaller than this, yet greater than MachineEpsilon. The next try might be at 0.0000001, etc. There's not really a number smaller than MachineEpsilon (at machine precision of course) so what is the software to do?
>
>
>
> Try using ">="
>
>
>
> equ=1/(0.` +(0.012710615354858255` ... etc //FullSimplify;
>
>
>
> const={a>=0,b>=0,fm>=0,c>=0,p>=0,
>
> fm<=5,0.00009600189408524172` (5-fm)-40.451710009005595` b fm>=0};
>
>
>
>
>
> {val,sol}=NMaximize[{equ,const},{a,b,fm,c,p},MaxIterations->1000]
>
>
>
>
>
> However, I don't believe this problem has a solution as given. :>~
>
>
>
>
>
>
>
> = = = = = = = = = =
>
>
>
> HTH :>)
>
>
>
> Dana DeLouis
>
>
>
> Mac & Mathematica 9
>
>
>
> = = = = = = = = = =
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Thursday, May 23, 2013 3:16:08 AM UTC-4, Meike wrote:
>
>
>
> > I often get the error:
>
>
>
> >
>
>
>
> > NMaximize::incst: NMaximize was unable to generate any initial points satisfying the inequality constraints
>
>
>
> > while there are clearly points satisfying the inequality constraints. For example:
>
>
>
> > NMaximize[{1/(0.` + (0.012710615354858255` (0.07879657698200958` +
>
>
>
> > a) (0.000046296899009293725` +
>
>
>
> > 0.003958158898356454` b) (233.02777267494722` +
>
>
>
> > 102.02996575509754` fm))/(a (4.892449413727213`*^-6 -
>
>
>
> > 9.784898827454427`*^-7 fm - 0.4123000838756304` b fm)) + (
>
>
>
> > 0.10155110608580004` (0.0367973376747971` +
>
>
>
> > c) (0.5030193912642286` + 16.257272679476753` b +
>
>
>
> > 0.0309411917473244` p))/b + (
>
>
>
> > 219.22680202984347` (0.03970570642848887` +
>
>
>
> > 0.013422101464134875` fm) (0.07972967880969935` +
>
>
>
> > 0.14421246041749264` p))/(fm p)), a > $MachineEpsilon,
>
>
>
> > b > $MachineEpsilon, fm > $MachineEpsilon, c > $MachineEpsilon,
>
>
>
> > p > $MachineEpsilon,
>
>
>
> >
>
>
>
> > 0.00009600189408524172` (5 - fm) -
>
>
>
> >
>
>
>
> > 40.451710009005595` b fm > $MachineEpsilon, fm < 5.`}, {a, b, fm,
>
>
>
> >
>
>
>
> > c, p}, MaxIterations -> 1000]
>
>
>
> >
>
>
>
> >
>
>
>
> >
>
>
>
> > NMaximize::incst: NMaximize was unable to generate any initial points satisfying the inequality constraints {-0.000480009+0.0000960019 fm+40.4517 b fm<0}. The initial region specified may not contain any feasible points. Changing the initial region or specifying explicit initial points may provide a better solution. >>
>
>
>
> >
>
>
>
> >
>
>
>
> >
>
>
>
> > Clearly there are initial points, for example:
>
>
>
> >
>
>
>
> >
>
>
>
> >
>
>
>
> > 0.00009600189408524172` (5 - fm) -
>
>
>
> >
>
>
>
> > 40.451710009005595` b fm > $MachineEpsilon /. {b -> 0.0007,
>
>
>
> >
>
>
>
> > fm -> 0.00003}
>
>
>
> >
>
>
>
> >
>
>
>
> >
>
>
>
> > True
>
>
>
> >
>
>
>
> >
>
>
>
> >
>
>
>
> > Also, if I make a more simple example with the same constraint I do not get the same error. I know I could give initial values myself, but since I'm automatically generating many of the optimizations, I would prefer not to. And I would like to understand why I keep getting this error and if there is any way to solve it.
On Sunday, June 9, 2013 10:26:21 AM UTC+2, Dana DeLouis wrote:
> Hello. It appears you don't have a response, so I'll give it a try.
>
>
>
> > a > $MachineEpsilon
>
>
>
> When you have a constraint such as this, you are saying that a solution of 4.440892*10^-16
>
> is not really zero, and a valid solution.
>
>
>
> 2*$MachineEpsilon//N
>
> 4.440892*10^-16
>
>
>
>
>
> For optimization problems, using ">" is usually a problem because of limits. I believe one should use ">=" for constraints.
>
>
>
> If 'a was found to be around 0.000001, the program has to retry with a number smaller than this, yet greater than MachineEpsilon. The next try might be at 0.0000001, etc. There's not really a number smaller than MachineEpsilon (at machine precision of course) so what is the software to do?
>
>
>
> Try using ">="
>
>
>
> equ=1/(0.` +(0.012710615354858255` ... etc //FullSimplify;
>
>
>
> const={a>=0,b>=0,fm>=0,c>=0,p>=0,
>
> fm<=5,0.00009600189408524172` (5-fm)-40.451710009005595` b fm>=0};
>
>
>
>
>
> {val,sol}=NMaximize[{equ,const},{a,b,fm,c,p},MaxIterations->1000]
>
>
>
>
>
> However, I don't believe this problem has a solution as given. :>~
>
>
>
>
>
>
>
> = = = = = = = = = =
>
>
>
> HTH :>)
>
>
>
> Dana DeLouis
>
>
>
> Mac & Mathematica 9
>
>
>
> = = = = = = = = = =
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Thursday, May 23, 2013 3:16:08 AM UTC-4, Meike wrote:
>
>
>
> > I often get the error:
>
>
>
> >
>
>
>
> > NMaximize::incst: NMaximize was unable to generate any initial points satisfying the inequality constraints
>
>
>
> > while there are clearly points satisfying the inequality constraints. For example:
>
>
>
> > NMaximize[{1/(0.` + (0.012710615354858255` (0.07879657698200958` +
>
>
>
> > a) (0.000046296899009293725` +
>
>
>
> > 0.003958158898356454` b) (233.02777267494722` +
>
>
>
> > 102.02996575509754` fm))/(a (4.892449413727213`*^-6 -
>
>
>
> > 9.784898827454427`*^-7 fm - 0.4123000838756304` b fm)) + (
>
>
>
> > 0.10155110608580004` (0.0367973376747971` +
>
>
>
> > c) (0.5030193912642286` + 16.257272679476753` b +
>
>
>
> > 0.0309411917473244` p))/b + (
>
>
>
> > 219.22680202984347` (0.03970570642848887` +
>
>
>
> > 0.013422101464134875` fm) (0.07972967880969935` +
>
>
>
> > 0.14421246041749264` p))/(fm p)), a > $MachineEpsilon,
>
>
>
> > b > $MachineEpsilon, fm > $MachineEpsilon, c > $MachineEpsilon,
>
>
>
> > p > $MachineEpsilon,
>
>
>
> >
>
>
>
> > 0.00009600189408524172` (5 - fm) -
>
>
>
> >
>
>
>
> > 40.451710009005595` b fm > $MachineEpsilon, fm < 5.`}, {a, b, fm,
>
>
>
> >
>
>
>
> > c, p}, MaxIterations -> 1000]
>
>
>
> >
>
>
>
> >
>
>
>
> >
>
>
>
> > NMaximize::incst: NMaximize was unable to generate any initial points satisfying the inequality constraints {-0.000480009+0.0000960019 fm+40.4517 b fm<0}. The initial region specified may not contain any feasible points. Changing the initial region or specifying explicit initial points may provide a better solution. >>
>
>
>
> >
>
>
>
> >
>
>
>
> >
>
>
>
> > Clearly there are initial points, for example:
>
>
>
> >
>
>
>
> >
>
>
>
> >
>
>
>
> > 0.00009600189408524172` (5 - fm) -
>
>
>
> >
>
>
>
> > 40.451710009005595` b fm > $MachineEpsilon /. {b -> 0.0007,
>
>
>
> >
>
>
>
> > fm -> 0.00003}
>
>
>
> >
>
>
>
> >
>
>
>
> >
>
>
>
> > True
>
>
>
> >
>
>
>
> >
>
>
>
> >
>
>
>
> > Also, if I make a more simple example with the same constraint I do not get the same error. I know I could give initial values myself, but since I'm automatically generating many of the optimizations, I would prefer not to. And I would like to understand why I keep getting this error and if there is any way to solve it.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web