Raymond Toy | 1 Dec 2011 05:19
Picon

Re: exact decimal type, was: 12.3*70.95 a little bit weird

On 11/30/11 9:21 AM, Stavros Macrakis wrote:
> How about rat(12.345678)?  Of course, ratepsilon should be 2e-15 or so
> (which we agreed on in February 2005, but it's still 1e-8!) and you
> probably want to turn off ratprint.

Just remembered there's one problem with using rat.  The number is
converted to a floating-point number before rat gets it.  So you get FP
roundoff.  With r notation, it truly is exact and you can have way more
than 15 significant digits.  Using bfloats is a workaround, which only
works if fpprec is bigger than the number of digits you've entered.

Ray
Hermann Klocker | 1 Dec 2011 06:07
Picon

Re: Maxima 5.25.1 on Mac gnuplot problem - no window


Am 30.11.2011 um 09:35 schrieb Javier Arantegui:

> Hi,
> 
> Same problem here. My system is:
> 
> Maxima version: 5.25.1
> Maxima build date: 9:14 9/5/2011
> Host type: i686-apple-darwin10.8.0
> Lisp implementation type: SBCL
> Lisp implementation version: 1.0.47
> 
> Mac OS X: 10.7.2
> 
> Gnuplot: Version 4.2 patchlevel 6
> 
> AquaTerm: 1.0.1
> 
> Javier
> 
> On Wed, Nov 30, 2011 at 6:27 AM, Hermann Klocker
> <hermann.klocker <at> gmail.com> wrote:
>> Trying a simple command which should invoke gnuplot (and does on a windows machine) like:
>> 
>> load("draw");
>> draw3d(surface_hide=true,color=red,implicit(5*x+y+z=3,x,-1,1,y,-1,1,z,-1,1));
>> 
>> gives just
>> 
(Continue reading)

Mario Rodriguez | 1 Dec 2011 10:22
Favicon

Re: Maxima 5.25.1 on Mac gnuplot problem - no window

El mié, 30-11-2011 a las 14:13 +0000, Jaime Villate escribió:
> On 11/30/2011 12:53 PM, Alexander Hansen wrote:
> > the draw3d(...) command above works,_BUT_  it overrides my gnuplot
> > environment setting and plots in an X11 window.  If Javier and Hermann
> > don't have X11 support in their gnuplot, that might explain what's
> > going on.
> >
> > The plot3d(...) command plots in an AquaTerm window, as per my
> > environment settings.
> Hi,
> in plot2d and plot3d, if the user does not change the default gnuplot 
> terminal,
> the gnuplot preamble will start with the command "set term pop", which
> is supposed to reset the terminal to the default used for the system.
> That's how we manage to use AquaTerm in the Mac, X11 or wxt in Linux,
> and whatever Windows or other systems like.
> If Mario is reading this thread, he might be interested in using the
> same method in draw and draw3d.
> 
> Regards,
> Jaime

Hello, and excuse me for my late response.

I have looked into this question in the past, but I couldn't find a
solution without breaking the 'dimensions' option; with it, it is
possible to control the canvas size, which must be declared just when
the terminal is set. I think it is not possible to set the canvas
dimensions afterwards. (If I am mistaken, and someone knows how to do
that, please let me know.) Therefore, 'draw' needs to set the terminal
(Continue reading)

Mario Rodriguez | 1 Dec 2011 10:34
Favicon

Re: Maxima 5.25.1 on Mac gnuplot problem - no window

El jue, 01-12-2011 a las 06:07 +0100, Hermann Klocker escribió:
> Just for the sake of completeness - I tried your suggestions:
> 
> 1. draw3d(implicit(5*x+y+z=3,x,-1,1,y,-1,1,z,-1,1),terminal=aquaterm);
> 
> which indeed shows a window with my plot BUT this window lacks the fundamental ability to rotate the graph
using the mouse which is essential for my application.
> 
> 2. plot3d (3-5*x-y, [x,-1,1], [y,-1,1], [z,-1,1]); 
> 
> the same: yes, a window, but not responding to mouse.
> 
> Hermann

I know nothing on Mac. How does Maxima connect to Gnuplot? Via pipes?

The behaviour described by Hermann is the same I get when Gnuplot is
called from command line in Linux.

--
Mario

_______________________________________________
Maxima mailing list
Maxima <at> math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima
José Antonio Vallejo | 1 Dec 2011 10:31
Picon

Even and odd functions

Hi to all:
Suppose that I have a piecewise-defined function on [-l,l] (in this 
example, l=%pi):

(%i1) h(x):=if (x>=-%pi and x<0) then x+%pi elseif (x>=0 and x<%pi) then 
%pi-x$

Suppose also that I want to know if it is even. I can do the following 
to extract the right extremum l (I think this should be always valid for 
any function defined piecewise "from left to right"):

(%i2) l:part(h(x),length(h(x))-3,2,2);
(%o2) %pi

then:

(%i3) assume(0<z and z<l);
(%o3) [z>0,z<%pi]

and finally

(%i4) is(equal(h(-z),h(z)));
(%o4) true

which tells me that it is an even function. If I try to store these 
steps in a function like this:

(%i5) paridad(f):=
  block(
         l:part(f,length(f)-3,2,2),
(Continue reading)

José Antonio Vallejo | 1 Dec 2011 10:47
Picon

Re: Citing Maxima

Hello!
Take a look at

http://galia.fc.uaslp.mx/~jvallejo/GeogebraMaxima.pdf (published in La 
Gaceta de la Real Sociedad Matemática Española, Vol. 14 (2011), Núm. 1, 
Págs. 111–132).

and

http://www.tandfonline.com/doi/abs/10.1080/0020739X.2011.633626 (a 
preprint version is available at: 
http://galia.fc.uaslp.mx/~jvallejo/Morante-Vallejo-web.pdf).

Best regards,

J. A.
Jaime Villate | 1 Dec 2011 11:41
Picon
Favicon
Gravatar

Re: Maxima 5.25.1 on Mac gnuplot problem - no window

On 12/01/2011 05:07 AM, Hermann Klocker wrote:
> plot3d (3-5*x-y, [x,-1,1], [y,-1,1], [z,-1,1]);
>
> the same: yes, a window, but not responding to mouse.

Hi Hermann,
could you please try the following two commands and tell whether the 
mouse fails in both?

    plot3d (3-5*x-y, [x,-1,1], [y,-1,1], [z,-1,1], [plot_format,gnuplot]);

    plot3d (3-5*x-y, [x,-1,1], [y,-1,1], [z,-1,1], 
[plot_format,gnuplot_pipes]);

I'm also curious to know how the same plot made by Xmaxima will look in 
Aquaterm:

    plot3d (3-5*x-y, [x,-1,1], [y,-1,1], [z,-1,1], [plot_format,xmaxima]);

The mouse should work in that case but you will not get numbers or 
scales on the axes.

Regards,
Jaime
Barton Willis | 1 Dec 2011 12:56
Favicon

Re: Even and odd functions

The function paridad expects a function, but paridad(h(x)) provides
paridad with the formula for a function. Instead, try paridad(h). 
This will work as you expect it once, but not twice. The reason for
the failure on the second attempt is that the assumption assume(0<z and z<l) 
is made globally, not locally to paridad. After paridad is executed once, 
h(z) simplifies to %pi-z.

The Maxima logical operators are not commutative (I think), so your part
statement works. But it's risky to rely on a user expressing the predicate
as (x>=0 and x<%pi) instead of the logically equivalent (x<%pi and x >=0).

--Barton

-----maxima-bounces <at> math.utexas.edu wrote: -----

Hi to all:
Suppose that I have a piecewise-defined function on [-l,l] (in this 
example, l=%pi):

(%i1) h(x):=if (x>=-%pi and x<0) then x+%pi elseif (x>=0 and x<%pi) then 
%pi-x$

Suppose also that I want to know if it is even. I can do the following 
to extract the right extremum l (I think this should be always valid for 
any function defined piecewise "from left to right"):

(%i2) l:part(h(x),length(h(x))-3,2,2);
(%o2) %pi

then:
(Continue reading)

Stavros Macrakis | 1 Dec 2011 13:53
Picon
Favicon
Gravatar

Re: exact decimal type, was: 12.3*70.95 a little bit weird

True, but are 15+ digit exact decimals really a frequent requirement?


On the other hand, my suggested 'rat' solution is incorrect.  rat(.33333...) is (correctly) 1/3, not 33333/10^5.  But a round-to-decimal function isn't hard to write.

On the other hand, your bfloat comment makes me thing the following: when reading bfloats, why shouldn't Maxima use all digits, even if there are more than fpprec? This would slow down arithmetic on these non-fpprec bfloats slightly because the bfloat package first rounds to the current fpprec before doing arithmetic.

Fateman, you probably have a thought-through opinion on this....

            -s

On Wed, Nov 30, 2011 at 23:19, Raymond Toy <toy.raymond <at> gmail.com> wrote:
On 11/30/11 9:21 AM, Stavros Macrakis wrote:
> How about rat(12.345678)?  Of course, ratepsilon should be 2e-15 or so
> (which we agreed on in February 2005, but it's still 1e-8!) and you
> probably want to turn off ratprint.

Just remembered there's one problem with using rat.  The number is
converted to a floating-point number before rat gets it.  So you get FP
roundoff.  With r notation, it truly is exact and you can have way more
than 15 significant digits.  Using bfloats is a workaround, which only
works if fpprec is bigger than the number of digits you've entered.

Ray

_______________________________________________
Maxima mailing list
Maxima <at> math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima
Leo Butler | 1 Dec 2011 14:55
Picon
Gravatar

Re: Citing Maxima

José Antonio Vallejo <jose.a.vallejo <at> prodigy.net.mx> writes:

> Hello!
> Take a look at
>
> http://galia.fc.uaslp.mx/~jvallejo/GeogebraMaxima.pdf (published in La 
> Gaceta de la Real Sociedad Matemática Española, Vol. 14 (2011), Núm. 1, 
> Págs. 111–132).
>
> and
>
> http://www.tandfonline.com/doi/abs/10.1080/0020739X.2011.633626 (a 
> preprint version is available at: 
> http://galia.fc.uaslp.mx/~jvallejo/Morante-Vallejo-web.pdf).

See the Maxima FAQ at sourceforge:
http://sourceforge.net/apps/mediawiki/maxima/index.php?title=Maxima_FAQ#What_is_the_appropriate_way_to_cite_maxima_in_an_academic_context.3F
and
http://www.math.utexas.edu/pipermail/maxima/2009/016703.html

This is the format I used to cite Maxima in a recent paper.

--

-- 
Leo Butler                      leo.butler <at> member.ams.org
SDF Public Access UNIX System -   http://sdf.lonestar.org
_______________________________________________
Maxima mailing list
Maxima <at> math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima

Gmane