Message Boards Message Boards

0
|
4533 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Maximize several functions with constraints?

Posted 5 years ago

Hi all! I'm new at Mathematica and I having the following problem. I define several functions to then optimize with constraints (complicated problem) using the function Maximize. The problem is that the output just prints the input, but gives no solutions to the problem. The problem has 16 constraints, 12 variables, and just one symbolic parameter. If anyone can help with this I would really appreciate it. I post the code below. Thanks!

uc[c_, delta_] := Times[delta, Divide[Power[c, -0.5], -0.5]]

vz[z_, w_] := Times[1, Divide[Power[Divide[z, w], 3], 3]]

ut[c1_, c2_, z_, w_, delta_] := uc[c1, 1] + uc[c2, delta] - vz[z, w]

SWF[c11_, c12_, c21_, c22_, c31_, c32_, c41_, c42_, z1_, z2_, z3_,z4_, w1_, w2_, delta_] := 
 ut[c11, c12, z1, w1, 1] + ut[c21, c22, z2, w1, delta] + ut[c31, c32, z3, w2, 1] + ut[c41, c42, z4, w2, delta]

mrs[c1_, c2_, delta_] :=  Times[Divide[1, delta], Power[Divide[c1, c2], -1.5]]

t[c1_, c2_] := Divide[1, mrs[c1, c2, 1]] - 1

R[c1_, c2_, c11_, c12_] := c1 + Times[(1 + t[c11, c12]), c2]

chat2[c1_, c2_, c11_, c12_, delta_] :=  Times[R[c1, c2, c11, c12], Power[Power[Divide[delta, 1 + t[c11, c12]], -Divide[2, 3]] + 1 + t[c11, c12], -1]]

chat1[c1_, c2_, c11_, c12_, delta_] := R[c1, c2, c11, c12] -   Times[(1 + t[c11, c12]), chat2[c1, c2, c11, c12, delta]]

ic[ci1_, ci2_, zi_, wi_, deltai_, cj1_, cj2_, zj_, c11_, c12_] := ut[ci1, ci2, zi, wi, deltai] - ut[chat1[cj1, cj2, c11, c12, deltai], chat2[cj1, cj2, c11, c12, deltai], zj, wi, deltai]

Maximize[{SWF[c11, c12, c21, c22, c31, c32, c41, c42, z1, z2, z3, z4, 
   1, 2, delta2], 
  c11 + c12 + c21 + c22 + c31 + c32 + c41 + c42 == z1 + z2 + z3 + z4 && 
   mrs[c11, c12, 1] == mrs[c21, c22, delta2] && 
   mrs[c11, c12, 1] == mrs[c31, c32, 1] && 
   mrs[c11, c12, 1] == mrs[c41, c42, delta2] && 
   ic[c11, c12, z1, 1, 1, c21, c22, z2, c11, c12] >= 0 && 
   ic[c11, c12, z1, 1, 1, c31, c32, z3, c11, c12] >= 0 && 
   ic[c11, c12, z1, 1, 1, c41, c42, z4, c11, c12] >= 0 && 
   ic[c21, c22, z2, 1, delta2, c11, c12, z1, c11, c12] >= 0 && 
   ic[c21, c22, z2, 1, delta2, c31, c32, z3, c11, c12] >= 0 && 
   ic[c21, c22, z2, 1, delta2, c41, c42, z4, c11, c12] >= 0 && 
   ic[c31, c32, z3, 2, 1, c11, c12, z1, c11, c12] >= 0 && 
   ic[c31, c32, z3, 2, 1, c21, c22, z2, c11, c12] >= 0 && 
   ic[c31, c32, z3, 2, 1, c41, c42, z4, c11, c12] >= 0 && 
   ic[c41, c42, z4, 2, delta2, c11, c12, z1, c11, c12] >= 0 && 
   ic[c41, c42, z4, 2, delta2, c21, c22, z2, c11, c12] >= 0 && 
   ic[c41, c42, z4, 2, delta2, c31, c32, z3, c11, c12] >= 0}, {c11, 
  c12, c21, c22, c31, c32, c41, c42, z1, z2, z3, z4}]
POSTED BY: Damian Vergara

Maximize can't handle problems with 12 variables and no parameters in any reasonable amount of time. However, the fact that it return the problem unevaluated probably means it wasn't entered properly.

POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract