Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #15064 > unrolled thread
| Started by | aless.bolli@gmail.com |
|---|---|
| First post | 2013-07-01 09:42 +0000 |
| Last post | 2013-07-02 04:34 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
Constraint definition is not valid: WHY? aless.bolli@gmail.com - 2013-07-01 09:42 +0000
Re: Constraint definition is not valid: WHY? Alessandro Bolli <aless.bolli@gmail.com> - 2013-07-02 04:34 +0000
| From | aless.bolli@gmail.com |
|---|---|
| Date | 2013-07-01 09:42 +0000 |
| Subject | Constraint definition is not valid: WHY? |
| Message-ID | <kqrite$4a6$1@smc.vnet.net> |
I am tring to use Nmaximize in Mathematica This is How I proceeded:
1) define a list of parameters: Par = {a->1, b->3, etc};
2) define two functions: f1: v1=express./Par f2: v2=express./Par
After this the expression are numerical except for the variables:
V1=f(e1,x) and V2=f(e2,x)
The objective function to be maximized is V1/(e1+e2) I defined the constraint as constr=V1-V2;
then I used the Nmaximize:
NMaximize[{objopt > 0, constr == 0}, {e1, e2, x}, Method -> NelderMead]
I obtained the following error:
NMaximize::bcons: "The following constraints are not valid: "expression". Constraints should be equalities, inequalities, or domain specifications involving the variables"
I checked that only those variables are present in the constraint and objective function (other are numerical parameters) I do not understand why this error appears can someone help me?
Thank you
Alex
[toc] | [next] | [standalone]
| From | Alessandro Bolli <aless.bolli@gmail.com> |
|---|---|
| Date | 2013-07-02 04:34 +0000 |
| Message-ID | <kqtl81$ate$1@smc.vnet.net> |
| In reply to | #15064 |
Il giorno luned=EC 1 luglio 2013 11:42:06 UTC+2, Alessandro Bolli ha scritto:
> I am tring to use Nmaximize in Mathematica This is How I proceeded:
>
>
>
> 1) define a list of parameters: Par = {a->1, b->3, etc};
>
>
>
> 2) define two functions: f1: v1=express./Par f2: v2=express./Par
>
>
>
> After this the expression are numerical except for the variables:
>
>
>
> V1=f(e1,x) and V2=f(e2,x)
>
> The objective function to be maximized is V1/(e1+e2) I defined the constraint as constr=V1-V2;
>
>
>
> then I used the Nmaximize:
>
>
>
> NMaximize[{objopt > 0, constr == 0}, {e1, e2, x}, Method -> NelderMead]
>
> I obtained the following error:
>
>
>
> NMaximize::bcons: "The following constraints are not valid: "expression". Constraints should be equalities, inequalities, or domain specifications involving the variables"
>
>
>
> I checked that only those variables are present in the constraint and objective function (other are numerical parameters) I do not understand why this error appears can someone help me?
>
>
>
> Thank you
>
>
>
> Alex
I solved the many errors I made. I am a real noob with mathematica. Thank you
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web