Re: Plot resolution
- To: mathgroup at smc.vnet.net
- Subject: [mg65098] Re: Plot resolution
- From: "ben" <benjamin.friedrich at gmail.com>
- Date: Tue, 14 Mar 2006 06:00:26 -0500 (EST)
- References: <dv31e3$r6d$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi Laurentiu,
Your problem is about precision:
Subtracting huge numbers yielding tiny differences is always subtle.
A quick'n'dirty work-around is
ListPlot[Table[N[pressure, 20], {r, ro, 10^4, 10^2}],PlotJoined ->
True]
Here N[ ,20] simply uses more digits in the calculation.
Bye
Ben
Laurentiu Caramete schrieb:
> Hi,
>
> I got a problem with a plot of a function. The function 'pressure' should
> decrease monotonically with r. The Plot function is giving a non-monotonic
> plot at big r, this is a problem with the resolution of the plot or with the
> function? How can I check that?
>
> \!\(Clear[r]\[IndentingNewLine]
> \(ro = 10\^3;\)\[IndentingNewLine]
> \(pressure =
> p[r] /. \(DSolve[{D[p[r], r] ==
> 1\/\(\(r\^2\) \((1 + r)\)\^3\) -
> Log[1 + r]\/\(\(r\^3\) \((1 + r)\)\^2\),
> p[ro] == 10\^\(-7\)}, p[r],
> r]\)[\([1]\)];\)\[IndentingNewLine]\[IndentingNewLine]
> Plot[pressure, {r, ro, 10\^4}, PlotRange -> All]\)
>
>
> Thanks