Skip to main content
added 391 characters in body
Source Link
Ulrich Neumann
  • 56.8k
  • 2
  • 26
  • 60

First consider the valid region of the parameters eh,ef

cond[a_?NumericQ, b_?NumericQ, c_?NumericQ, w_?NumericQ,F_?NumericQ ] := (ef == eh && ef > c/a) ||ef >= c/(a - 2 Sqrt[b] Sqrt[F]) 
RegionPlot[ cond[10, 1, 1, 5, 10] , {ef, .2, .3} , {eh, 0.23, .28},PlotPoints -> {100, {eh == ef}}, FrameLabel -> Automatic,Prolog -> {Red, Point[{.24, .24}]}]

enter image description here

The plot shows that the point ef==eh==.24 you expect the maximum isn't allowed!

NMaximize evaluates the maximum

Maximize[g[10, 1, 1, 5, 10, 0.24, ef], ef ]  (*{0.698102, {ef -> 0.272076}}*)

addendum

Obviously Mathematica didn't find the complete valid region. But Maximize is able to solve the problem if you add the constraints ef > 0, eh > 0 and maximize in two dimensions {ef,eh}:

Maximize[{g [10, 1, 1, 5, 10, eh, ef], ef > 0, eh > 0}, {ef, eh}] // N
(*{0.753847, {ef -> 0.242362, eh -> 0.242362}}*)

final addendum

If you are looking for a maximum for given parameters a, b, c, w, F, eh define a region depending on these parameters

reg[a_, b_, c_, w_, F_, eh_] =ImplicitRegion[(ef == eh && ef > c/a) ||ef >= c/(a - 2 Sqrt[b] Sqrt[F]), ef ]

and maximize

NMaximize[ g [10, 1, 1, 5, 10, .24, ef]  , Element[{ef}, reg [10, 1, 1, 5, 10, .24]]] 
(*{0.753472, {ef -> 0.24}}*)

First consider the valid region of the parameters eh,ef

cond[a_?NumericQ, b_?NumericQ, c_?NumericQ, w_?NumericQ,F_?NumericQ ] := (ef == eh && ef > c/a) ||ef >= c/(a - 2 Sqrt[b] Sqrt[F]) 
RegionPlot[ cond[10, 1, 1, 5, 10] , {ef, .2, .3} , {eh, 0.23, .28},PlotPoints -> {100, {eh == ef}}, FrameLabel -> Automatic,Prolog -> {Red, Point[{.24, .24}]}]

enter image description here

The plot shows that the point ef==eh==.24 you expect the maximum isn't allowed!

NMaximize evaluates the maximum

Maximize[g[10, 1, 1, 5, 10, 0.24, ef], ef ]  (*{0.698102, {ef -> 0.272076}}*)

addendum

Obviously Mathematica didn't find the complete valid region. But Maximize is able to solve the problem if you add the constraints ef > 0, eh > 0 and maximize in two dimensions {ef,eh}:

Maximize[{g [10, 1, 1, 5, 10, eh, ef], ef > 0, eh > 0}, {ef, eh}] // N
(*{0.753847, {ef -> 0.242362, eh -> 0.242362}}*)

First consider the valid region of the parameters eh,ef

cond[a_?NumericQ, b_?NumericQ, c_?NumericQ, w_?NumericQ,F_?NumericQ ] := (ef == eh && ef > c/a) ||ef >= c/(a - 2 Sqrt[b] Sqrt[F]) 
RegionPlot[ cond[10, 1, 1, 5, 10] , {ef, .2, .3} , {eh, 0.23, .28},PlotPoints -> {100, {eh == ef}}, FrameLabel -> Automatic,Prolog -> {Red, Point[{.24, .24}]}]

enter image description here

The plot shows that the point ef==eh==.24 you expect the maximum isn't allowed!

NMaximize evaluates the maximum

Maximize[g[10, 1, 1, 5, 10, 0.24, ef], ef ]  (*{0.698102, {ef -> 0.272076}}*)

addendum

Obviously Mathematica didn't find the complete valid region. But Maximize is able to solve the problem if you add the constraints ef > 0, eh > 0 and maximize in two dimensions {ef,eh}:

Maximize[{g [10, 1, 1, 5, 10, eh, ef], ef > 0, eh > 0}, {ef, eh}] // N
(*{0.753847, {ef -> 0.242362, eh -> 0.242362}}*)

final addendum

If you are looking for a maximum for given parameters a, b, c, w, F, eh define a region depending on these parameters

reg[a_, b_, c_, w_, F_, eh_] =ImplicitRegion[(ef == eh && ef > c/a) ||ef >= c/(a - 2 Sqrt[b] Sqrt[F]), ef ]

and maximize

NMaximize[ g [10, 1, 1, 5, 10, .24, ef]  , Element[{ef}, reg [10, 1, 1, 5, 10, .24]]] 
(*{0.753472, {ef -> 0.24}}*)
added 302 characters in body
Source Link
Ulrich Neumann
  • 56.8k
  • 2
  • 26
  • 60

First consider the valid region of the parameters eh,ef

cond[a_?NumericQ, b_?NumericQ, c_?NumericQ, w_?NumericQ,F_?NumericQ ] := (ef == eh && ef > c/a) ||ef >= c/(a - 2 Sqrt[b] Sqrt[F]) 
RegionPlot[ cond[10, 1, 1, 5, 10] , {ef, .2, .3} , {eh, 0.23, .28},PlotPoints -> {100, {eh == ef}}, FrameLabel -> Automatic,Prolog -> {Red, Point[{.24, .24}]}]

enter image description here

The plot shows that the point ef==eh==.24 you expect the maximum isn't allowed!

NMaximize evaluates the maximum

Maximize[g[10, 1, 1, 5, 10, 0.24, ef], ef ]  (*{0.698102, {ef -> 0.272076}}*)

addendum

Obviously Mathematica didn't find the complete valid region. But Maximize is able to solve the problem if you add the constraints ef > 0, eh > 0 and maximize in two dimensions {ef,eh}:

Maximize[{g [10, 1, 1, 5, 10, eh, ef], ef > 0, eh > 0}, {ef, eh}] // N
(*{0.753847, {ef -> 0.242362, eh -> 0.242362}}*)

First consider the valid region of the parameters eh,ef

cond[a_?NumericQ, b_?NumericQ, c_?NumericQ, w_?NumericQ,F_?NumericQ ] := (ef == eh && ef > c/a) ||ef >= c/(a - 2 Sqrt[b] Sqrt[F]) 
RegionPlot[ cond[10, 1, 1, 5, 10] , {ef, .2, .3} , {eh, 0.23, .28},PlotPoints -> {100, {eh == ef}}, FrameLabel -> Automatic,Prolog -> {Red, Point[{.24, .24}]}]

enter image description here

The plot shows that the point ef==eh==.24 you expect the maximum isn't allowed!

NMaximize evaluates the maximum

Maximize[g[10, 1, 1, 5, 10, 0.24, ef], ef ]  (*{0.698102, {ef -> 0.272076}}*)

First consider the valid region of the parameters eh,ef

cond[a_?NumericQ, b_?NumericQ, c_?NumericQ, w_?NumericQ,F_?NumericQ ] := (ef == eh && ef > c/a) ||ef >= c/(a - 2 Sqrt[b] Sqrt[F]) 
RegionPlot[ cond[10, 1, 1, 5, 10] , {ef, .2, .3} , {eh, 0.23, .28},PlotPoints -> {100, {eh == ef}}, FrameLabel -> Automatic,Prolog -> {Red, Point[{.24, .24}]}]

enter image description here

The plot shows that the point ef==eh==.24 you expect the maximum isn't allowed!

NMaximize evaluates the maximum

Maximize[g[10, 1, 1, 5, 10, 0.24, ef], ef ]  (*{0.698102, {ef -> 0.272076}}*)

addendum

Obviously Mathematica didn't find the complete valid region. But Maximize is able to solve the problem if you add the constraints ef > 0, eh > 0 and maximize in two dimensions {ef,eh}:

Maximize[{g [10, 1, 1, 5, 10, eh, ef], ef > 0, eh > 0}, {ef, eh}] // N
(*{0.753847, {ef -> 0.242362, eh -> 0.242362}}*)
Source Link
Ulrich Neumann
  • 56.8k
  • 2
  • 26
  • 60

First consider the valid region of the parameters eh,ef

cond[a_?NumericQ, b_?NumericQ, c_?NumericQ, w_?NumericQ,F_?NumericQ ] := (ef == eh && ef > c/a) ||ef >= c/(a - 2 Sqrt[b] Sqrt[F]) 
RegionPlot[ cond[10, 1, 1, 5, 10] , {ef, .2, .3} , {eh, 0.23, .28},PlotPoints -> {100, {eh == ef}}, FrameLabel -> Automatic,Prolog -> {Red, Point[{.24, .24}]}]

enter image description here

The plot shows that the point ef==eh==.24 you expect the maximum isn't allowed!

NMaximize evaluates the maximum

Maximize[g[10, 1, 1, 5, 10, 0.24, ef], ef ]  (*{0.698102, {ef -> 0.272076}}*)