Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #1944

Re: plot of nmaximized result

From DrMajorBob <btreat1@austin.rr.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: plot of nmaximized result
Date 2011-04-28 10:33 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <ipbfq8$abe$1@smc.vnet.net> (permalink)

Show all headers | View raw


(1) The value of Print is always Null, so list1 and list2 are not List  
objects.

(2) Hence, ListPlot[{list1, list2}] is just ListPlot[{Null, Null}]. Not a  
very interesting plot.

(3) The function f is unbounded for every j, so NMaximize cannot give you  
a maximum.

I'll ignore problem (3), except to suppress error messages (with Quiet):

d = 2635/33859;
r = 0.6;
a1 = 0.7;
a2 = 0.13;
g = 33859;
b = 0.6631;
j = 5;
points = Table[
    x = (b*j*(j + 1))/g;
    f = (1/(a1 + a1*z + a2*z^2))*(b/g)*j*(j + 1) + (1 - Exp[-z])^2 +
      d*Exp[-r*z];
    {max, val} = Quiet@NMaximize[f, z];
    {x, max},
    {j, 0, 5}
    ];
ListPlot@points

Bobby

On Wed, 27 Apr 2011 04:39:37 -0500, tarun dutta <tarunduttaz@gmail.com>  
wrote:

> this is the following program.here I want to plot between x VS max.but
> I can not get the result.
>
> Do[d = 2635/33859;
>  r = 0.6;
>  a1 = 0.7;
>  a2 = 0.13;
>  g = 33859;
>  b = 0.6631;
>  x = (b*j*(j + 1))/g;
>  f = (1/(a1 + a1*z + a2*z^2))*(b/g)*j*(j + 1) + (1 - Exp[-z])^2 +
>    d*Exp[-r*z];
>  {max, val} = NMaximize[f, z];
>  list1 = Print[(*"x= ",*)x];
>  list2 = Print[(*" max= ",*)max], {j, 0, 5}]
> ListPlot[{list1, list2}]
>
> any help will be appreciated.
> regards,
> tarun
>


-- 
DrMajorBob@yahoo.com

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: plot of nmaximized result DrMajorBob <btreat1@austin.rr.com> - 2011-04-28 10:33 +0000

csiph-web