Re: Maximize Command - Problem
- To: mathgroup at smc.vnet.net
- Subject: [mg85910] Re: Maximize Command - Problem
- From: m.r at inbox.ru
- Date: Wed, 27 Feb 2008 04:30:51 -0500 (EST)
- References: <fpucl2$m1l$1@smc.vnet.net>
On Feb 25, 6:34=A0am, Crazy Man <geller_gam... at hotmail.com> wrote: > Well, Syd sent me an email and told me to try this:(well, I forgot to ment= ion that we have to define a=1;b=1;c=1;d=1;) > > >fun[x_, y_, z_] =4*(a^2 + (b^2 + c^2 +d^2) (Cos[x])^2*(Cos[y])^2*(Cos[z= ])^2 + (b*Cos[x]*Cos[y]*Cos[z] +Cos[x]*Sin[y] + d*Sin[x])^2); > > And then: > > >Maximize[{fun, -Pi/2 < x < Pi/2 && -Pi/2 < y < Pi/2 && 0 < z < 2*Pi}, {x,= y,z}] > > It displayed an error. So I modified to > > >Maximize[{fun[x, y, z], -Pi/2 < x < Pi/2 && -Pi/ > > =A0 =A0 2 < y < Pi/2 && 0 < z < 2*Pi}, {x, y, z}] > > And the command runs for a while and then it displays my input. > Omg, this is frustrating, I dont know what=B4s the problem. > > Thank you anyway Syd. There's probably an easy way to prove that the maximum will be attained for Cos[z] == 1, but there's also the brute force way: In[1]:= fun[x_, y_, z_] = 4 (a^2 + (b^2 + c^2 +d^2) (Cos[x])^2 (Cos[y])^2 (Cos[z])^2 + (b Cos[x] Cos[y] Cos[z] + Cos[x] Sin[y] + d Sin[x])^2) /. a|b|c|d -> 1; Maximize[fun[x, y, z] /. s:x|y|z -> 2 ArcTan[s] // TrigExpand, {x, y, z}] Out[2]= {16 + 4 Sqrt[3], {x -> Root[1 - 44 #1^2 + 294 #1^4 - 44 #1^6 + #1^8 &, 1], y -> Root[1 - 4 #1 - 10 #1^2 + 4 #1^3 + #1^4 &, 3], z -> 0}} Then it can be verified that {x -> ArcSin[1/2 Sqrt[1 - 1/Sqrt[3]]], y - > ArcSin[Sqrt[1/13 (5 - 2 Sqrt[3])]], z -> 0} gives the same value and satisfies the constraints for x and y, with z being on the boundary. Maxim Rytin m.r at inbox.ru