Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #1944
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!feeder.news-service.com!multikabel.net!newsfeed10.multikabel.net!feeder.xsnews.nl!feed.xsnews.nl!border-1.ams.xsnews.nl!206.55.64.80.MISMATCH!newspump.sol.net!posts.news.twtelecom.net!nnrp2.twtelecom.net!not-for-mail |
|---|---|
| From | DrMajorBob <btreat1@austin.rr.com> |
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: plot of nmaximized result |
| Date | Thu, 28 Apr 2011 10:33:44 +0000 (UTC) |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Sender | steve@smc.vnet.net |
| Approved | Steven M. Christensen <steve@smc.vnet.net>, Moderator |
| Message-ID | <ipbfq8$abe$1@smc.vnet.net> (permalink) |
| Lines | 59 |
| NNTP-Posting-Date | 28 Apr 2011 09:34:29 GMT |
| NNTP-Posting-Host | b65042e2.news.twtelecom.net |
| X-Trace | DXC=LbfBN^Bd>kJP9kKlSEa7aEC_A=>8kQj6M;[h;PUXBgbDAbB79SZHZ=LEFiONJ7[GoFWAm=@LhiNEI |
| X-Complaints-To | abuse@twtelecom.net |
| Xref | x330-a1.tempe.blueboxinc.net comp.soft-sys.math.mathematica:1944 |
Show key headers only | 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
Re: plot of nmaximized result DrMajorBob <btreat1@austin.rr.com> - 2011-04-28 10:33 +0000
csiph-web