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


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

Re: plot of nmaximized result

Started byDrMajorBob <btreat1@austin.rr.com>
First post2011-04-28 10:33 +0000
Last post2011-04-28 10:33 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

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

#1944 — Re: plot of nmaximized result

FromDrMajorBob <btreat1@austin.rr.com>
Date2011-04-28 10:33 +0000
SubjectRe: plot of nmaximized result
Message-ID<ipbfq8$abe$1@smc.vnet.net>
(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

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web