Group Abstract Group Abstract

Message Boards Message Boards

0
|
6.2K Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Find the max/min of some function given multiple parameters?

Posted 8 years ago

Say I have a simple function and I want to find its minimum for different parameters (an optimization problem), how do I do that? http://puu.sh/Adkbi/04dbda4dd3.png This for instance, I don't care about complex roots I want it to show all reals, how to do that? http://puu.sh/AdkcI/5710a78156.png doing it this way says the constraints are wrong even though they are inequalities? If there is a way to make a Hesse's matrix that would work too. This is how it could look like for instance for some a,b,c,d,f > 0 http://puu.sh/AdkeR/a00f325581.png . Now I don't want to plot it, I just want to see the optimums for say 50=>a>=1 etc.

Thanks in advance.

POSTED BY: Alex C
4 Replies

the solution is a Piecewise function of the parameter

POSTED BY: Frank Kampas

For simple problems Maximize and Minimize can symbolically handle problems with parameters. Here's an example from the documentation

In[1]:= Maximize[a x^2 + b x + c, x]

Out[1]= {\[Piecewise] {
   {c, (b == 0 && a == 0) || (b == 0 && a < 0)},
   {-((b^2 - 4 a c)/(4 a)), (b > 0 && a < 0) || (b < 0 && a < 0)},
   {\[Infinity], \!\(
      TagBox["True",
       "PiecewiseDefault",
       AutoDelete->False,
       DeletionWarning->True]\)}
  }, {x -> \[Piecewise] {
     {0, (b == 0 && a == 0) || (b == 0 && a < 0)},
     {-(b/(2 a)), (b > 0 && a < 0) || (b < 0 && a < 0)},
     {Indeterminate, \!\(
        TagBox["True",
         "PiecewiseDefault",
         AutoDelete->False,
         DeletionWarning->True]\)}
    }}}
POSTED BY: Frank Kampas
Posted 8 years ago
POSTED BY: Alex C
NMinimize[{(5 + x^3.5)/x, x > 0}, x]
(*  Out:   {5.742347492053465`,{x\[Rule]1.2190136481282579`}}  *)

For negative arguments your function becomes complex valued, so this should be excluded from the search. And the respective constrains refer to the argument and not to any parameters.

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