Message Boards Message Boards

1
|
5478 Views
|
3 Replies
|
4 Total Likes
View groups...
Share
Share this post:

[?] Maximize a function created by adding two exponential functions?

Posted 5 years ago

Hello, I had a 3D function which consisted of a sum of two quadratic funtions:

Maximize[x1*(600 - 4*x1) + x2*(340 - 1/3*x2),{x1,x2}]

which nicely yields the maximum of a concave paraboloid. But when I need to maximize a function created by adding two exponential functions, I do not get a solution although the answer is simple.

Maximize[x1*Exp[Log[600] - (4/600)*x1] + x2*Exp[Log[340] - (1/1020)*x2],{x1,x2}]

This is easily solvable on paper, I'm just wondering how to get WM to calculate this.

Thanks

POSTED BY: Anthony Leamer
3 Replies
Posted 5 years ago

Thank you both very much! Very helpful, much appreciated! :)

POSTED BY: Anthony Leamer
Posted 5 years ago

It will also work if you give some contraints:

Maximize[{x1*Exp[Log[600] - (4/600)*x1] + 
   x2*Exp[Log[340] - (1/1020)*x2], {x1, x2} \[Element] 
   Rectangle[{0, 0}, {2000, 2000}]}, {x1, x2}]

gives

{436800/E, {x1 -> 150, x2 -> 1020}}
POSTED BY: David G

One way is using NMaximize:

NMaximize[x1*Exp[Log[600] - (4/600)*x1] + x2*Exp[Log[340] - (1/1020)*x2], {x1, x2}]
(* {160690., {x1 -> 150., x2 -> 1020.}} *)

or:

Maximize[x1*Exp[Log[600.] - (4./600.)*x1] + x2*Exp[Log[340.] - (1/1020.)*x2], {x1, x2}]
(* {160690., {x1 -> 150., x2 -> 1020.}} *)
FindMaximum[x1*Exp[Log[600] - (4/600)*x1] + x2*Exp[Log[340] - (1/1020)*x2], {x1, x2}]
(* {160690., {x1 -> 150., x2 -> 1020.}} *)
POSTED BY: Mariusz Iwaniuk
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