About plotting two independent Y-axis on the one plot



Hi Kris:

Thanks for the reply. wxplot2d() works quite well and faster than the
gnuplot's gnuplot2d (it actually pauses me a long time to my next statement
after you execute all) and the feature that I am able to embed on the same
worksheet multiple plots is something I wanted so I use that instead. You
can imagine that I write my class slides like a "live spreadsheet" putting
the text as comments, writing the root equations in the top, deriving the
expressions below and testing them numerically towards the bottom killing
variables in between when needed.

Well I know that its there alright (the plot for current) and actually I
decided to "scale it" somewhat a bit so now I have this instead:

wxplot2d([v(t),i(t)*10e3],[t,0,0.5]);

and you can see the red line intersecting with the blue one - if I would
have control over it I would like to see Y1 on the left and Y2 on the right
with two different ticks and in two different dimensions if this is all
possible of course.

MAXIMA is a great program and tool for teachers I think and I honor the man
who designed and created it!

Regards,
Berns B.
Dept.of Physics - University of San Carlos




On Wed, May 1, 2013 at 4:28 AM, Kris Katterjohn <katterjohn at gmail.com>wrote:

> Hi,
>
> On 04/30/2013 02:59 PM, Berns Buenaobra wrote:
> > Hello all:
> >
> > One of the classic problem in RC charge and discharge circuit in the
> usual
> > freshman physics course is being able to plot the voltage rise with a
> current
> > discharge on a single plot so that their intersection in time is
> determined.
> >
> > Now how does one do it with a wxplot2d() with two independent Y-axis on
> one
> > and the same plot?
> >
> > Well this looks easy for a simple case of just one plot:
> > R:10e3 $ C:10e-6 $ %tau:R*C; V[max]:10 $
> > v(t)=V[max]*(1-(exp(-t/(R*C))));
> > wxplot2d(v(t),[t,0,0.5]);
> >
> > and
> > i(t):=(V[max]/R)*(exp(-t/(R*C)));
> > wxplot2d(i(t),[t,0,0.5]);
> >
> > but I got into trouble with the temptation with just writing out:
> > wxplot2d([v(t),i(t)],[t,0,0.5]);
> >
> > which only shows the voltage rise. Easily done in MS Excel but I need the
> > symbols for purposes of instruction.
> >
> > Any tip?
> >
>
> Well, it looks like v(0)=0 and v(t)->10 as t->infinity, while i(0)=1/1000
> and
> i(t)->0 as t->infinity.  My guess is that the plot of i(t) is there, but
> it is
> too small to see when v(t) is plotted along with it.
>
> I don't know about wxplot2d, but with plot2d you should be able to do
>
> plot2d([v(t),i(t)],[t,0,0.5],[y,0,0.001]);
>
> and see that the plot of i(t) is there.  If that's the case, I guess you
> can
> switch to units of milliamps (or whatever is appropriate) when plotting.
>
> > Regards,
> > Berns B.
> > Dept. of Physics - University of San Carlos
> >
> >
>
> Cheers,
> Kris Katterjohn
>
>