Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers 3

up vote 6 down vote accepted
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

share|improve this answer
    
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}]. –  Cendo Feb 26 '13 at 10:25
add comment

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

share|improve this answer
add comment

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?

share|improve this answer
2  
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. –  Rahul Narain Feb 24 '13 at 23:21
    
Exactly, I want the point (d,0.0000697) to be on the plot. –  Cendo Feb 25 '13 at 6:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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