6
$\begingroup$

Assume these parameter definitions first:

P0 = 325000000000000000000000000000000/1289899878039;
th = 22 10^-7;
alpha = 15*^6;
p0value = 0.0000697013247924021100000;
Lh = 5 10^-9;
d = 80 10^-9;
A = -2.8490639736294850547486980507937310695688037435690471`40.25650391588118*^\
14;
B = 1.1760120752241583305643404927085980980404601631188207268`37.\
974790074939705*^26;

Define two functions

tmp[x_] := A E^(x/Lh) + B E^(-x/Lh) + p0value ;
tmp2[x_] := -(alpha P0 th)/(1 - alpha^2 Lh^2) E^(-alpha x);

Subtracting them at x=d yields the small number p0value

tmp[d] - tmp2[d]

0.000069701324792402

I want the plot of tmp[x] - tmp2[x] to have a value of p0value (0.0000697013247924021100000) at x = d and not to stop at $10^{20}$.

LogPlot[{tmp[x] - tmp2[x]}, {x, 0, d}, PlotRange -> {{0, d}, {10^-5, 10^25}}]

Mathematica graphics

I tried MeshFunctions but without success. Can anyone give me a hint?

$\endgroup$
6
$\begingroup$
ListLogPlot[{#, tmp[#] - tmp2[#]} & /@ 
   Table[Exp[x], {x, Log[d] - 2, Log[d], 1/128}] , 
   PlotRange -> {{0, d}, {10^-5, 10^25}}, Joined -> True]

Mathematica graphics

$\endgroup$
  • $\begingroup$ Thanks Sjoerd! I just changed the list to exact range (0,d) in order to have all points close to 0 as well : Table[x, {x, 0, d, d/128}]. $\endgroup$ – Cendo Feb 26 '13 at 10:25
2
$\begingroup$

Does this do what you need?

LogPlot[{tmp[x] - tmp2[x]}, {x, 0, d}, PlotRange -> Automatic]

Mathematica graphics

Simply removing the argument to PlotRange (or in this case explicitly setting it to Automatic might solve the problem?

$\endgroup$
  • 2
    $\begingroup$ As far as I can tell, the asker wants the point $(d, 0.0000697)$ to be visible on the plot, so this does not answer the question. $\endgroup$ – Rahul Feb 24 '13 at 23:21
  • $\begingroup$ Exactly, I want the point (d,0.0000697) to be on the plot. $\endgroup$ – Cendo Feb 25 '13 at 6:59
2
$\begingroup$

May I suggest a plot of $\log(x)$ vs $\log\left(\text{tmp}(d-x)-\text{tmp2}(d-x)\right)$ if it's the "tail" part what you concern:

plotdata = Table[{10^k, tmp[d - 10^k] - tmp2[d - 10^k]}, {k, -40, Log[10, d], 1/10}];
ListLogLogPlot[plotdata, Joined -> True, PlotRange -> {All, {10^-5, 10^25}}]

Mathematica graphics

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.