On Aug 31, 1:36 pm, "Shawn J. Goff" <[email protected]> wrote:
> I'm trying to plot I = I0*(exp(q*V/n/k/T)-1) as a function of V for
> several different values of n. I have:
> I = [I0*(exp(q*V/n/k/T)-1) for n in [1, 1.5, 2]]   (thanks, Jason)
>
> If I then say plot(I), it shows one of the lines shooting up to huge
> values, and the other two are very small (laying on the abscissa). I
> can limit the domain such as plot(I, (V, 0, 1)), but this doesn't help
> - it will still accommodate the range for the larger function leaving
> the other two looking minuscule. (see output 
> here:http://shawnjgoff.com/files/sageHelp_largeRange.png)

This is very typical Sage behavior right now, unfortunately (though I
don't know that anyone else does any better).  There is no "easy" way
to determine what the range should be for a given function, basically,
so Sage makes the range be the full range.   You have picked functions
that blow up quickly w.r.t. each other.

One way to do this if you DO have a sense of what range will be
appropriate, though, is to use show (as you have done below, but you
don't need line):
show(plot(I),ymax=75)
or whatever ymax you feel is appropriate.

Incidentally, you will probably eventually have to declare the
variable V explicitly, thus:

show(plot(I),v,ymax=75)

>
> Looking through the documentation, I found a trick:
> show((line(I[0]) + line(I[1]) + line(I[2])), ymin=0, ymax=1, xmin=0,
> xmax=2)
> This is very close, except for some reason the domain is limited from
> 0 to 1 even though I have "xmax=2" in there. (see output 
> here:http://shawnjgoff.com/files/sageHelp_domainLimiting.png)

Interestingly, I can't get line(I[0]) to do anything, so  perhaps you
have an older version of Sage?  In any case, the ymax etc. only limit
the plot you have created (because it's "show"ing things), but the
defaults are -1 to 1 and -1 to 1, I think, so your "line" plot won't
have any information about anything beyond that point.

- kcrisman
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to