| Author |
Comment/Response |
Phil Lederer
|
03/24/08 3:41pm
I am trying to do something basic--but I cannot figure it out
I have some function in two variables
f[x_,y_]= some arbitrary polynomial
Now I want to minimize the function with respect to y over some
compact interval with fixed x
NMinimize[{f[x,y],y≥5,y≤9},y]
I want to plot the y's versus the x's.
I have tried many things like defining
s[x_]=Part[NMinimize[{f[x,y],y≥5,y≤9},y],2]
Plot[s[x],{x,-14, 46}]
or variations
Plot[tt/.s[x],{x,-14, 46}].
Many error messages or nothing at all results.........
I am sure this is easy, and someone can suggest how to do this.
However, one more thing would be greatly helpful (give a man a decent
and readable Mathematica manual and he can feed himself...)
I am baffled by what Mathematica wants when it comes to using a single
part of a list and changing it to a scalar. Suppose as above q is a
vector with a rule assigning a value to some variable x that is x-
some number, and this assignment is in the third position of the list
What is going on with q/.d[[3]] for example: Is q now a scalar? If
not why not?
Thanks for you help,
Phil Lederer
URL: , |
|