Re: Basic plotting of an evaluated function
- To: mathgroup at smc.vnet.net
- Subject: [mg86912] Re: Basic plotting of an evaluated function
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Wed, 26 Mar 2008 04:52:11 -0500 (EST)
- Organization: Arcor
- References: <fsa5cd$ab2$1@smc.vnet.net>
Hi,
it would be helpful
a) if you would consider to read the manual
b) use correct Mathematica syntax because
NMinimize[{f[x,y],y=995,y=989},y]
is remarkable nonsense
anyway
f[x_?NumericQ, y_?NumericQ] := x*(990 - y^2)
s[x_?NumericQ] := y /. Last[NMinimize[{f[x, y], y < 995, y > 989}, y]]
Plot[s[x], {x, -14, 46}]
Regards
Jens
lederer at ssb.rochester.edu wrote:
> I am trying to do something basic--but I cannot figure it out
>
>
> I have some function in two varaibles
>
> 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=995,y=989},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=995,y=989},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
>