Student Support Forum: 'Bcons during Maximization' topicStudent Support Forum > General > "Bcons during Maximization"

 < Previous Comment | Next Comment > Help | Reply To Comment | Reply To Topic
 Author Comment/Response Peter Pein 10/11/12 12:46pm Hi Vadim, the condition for t is redundant and might complicate things for Mathematica: ForAll[{c1, c2}, 0 <= c1 <= 1 >= c2 >= 0, -1 <= c1 Sqrt[1 - c2^2] - c2 Sqrt[1 - c1^2] <= 1 ] // Resolve -->True When using Maximize (in contrast to NMaximize) I strongly recommend to use exact input (no floating points): result = Maximize[ {n - (1 - n) - q (n .5 c1^2 - (1 - n) .7 c2^2 + (n (1 - .5) - (1 - n) (1 - .7))/2) * (n .5 c1^2 + (1 - n) .7 c2^2 + (n (1 - .5) + (1 - n) (1 - .7))/2) // Rationalize, 0 <= c1 <= 1 && 0 <= c2 <= 1 && 0 <= n <= 1 && 0 <= q <= 1}, {c1, c2}]; takes a few seconds and with PiecewiseExpand and FullSimplify the result becomes clearly represented: Assuming[And @@ Thread[0 <= {c1, c2, q, n} <= 1], FullSimplify[result // PiecewiseExpand] ] gives: Piecewise[ {{{-1 + 2*n, {c1 -> 1/2, c2 -> 1/2}}, q == 0}, {{1 - q/16, {c1 -> 0, c2 -> 1/2}}, q > 0 && n == 1}, {{-1 + (289*q)/400, {c1 -> 1/2, c2 -> 1}}, q > 0 && n == 0}}, {-1 + 2*n + (1/400)*(-17 + 12*n)*(-17 + 22*n)*q, {c1 -> 0, c2 -> 1}} ] Peter URL: ,

 Subject (listing for 'Bcons during Maximization') Author Date Posted Bcons during Maximization Vadim 10/10/12 3:35pm Re: Bcons during Maximization Bill Simpson 10/11/12 12:26pm Re: Bcons during Maximization Peter Pein 10/11/12 12:46pm Re: Bcons during Maximization Vadim 10/12/12 08:33am Re: Re: Bcons during Maximization Bill Simpson 10/12/12 1:55pm Re: Bcons during Maximization Vadim 10/16/12 4:03pm Re: Re: Bcons during Maximization Bill Simpson 10/17/12 11:18am
 < Previous Comment | Next Comment > Help | Reply To Comment | Reply To Topic