Robert Dodier | 1 Jan 2009 02:19
Picon

Re: Fitting in Maxima

On 12/31/08, Barton Willis <willisb <at> unk.edu> wrote:

> Maybe because linsolve_by_lu isn't documented :( I must make a new years
>  resolution ... Of course, just documenting linsolve_by_lu doesn't make
>  the function easy find---our documentation needs more cross references
>  (linsolve_by_lu, solve, linsolve, and algsys all reference each other).

Well, the documentation category system is supposed to address
the problem by getting all the items to point to a common location
(the category) where they're listed together.

The major defect in the existing category system is that the existing
in-Maxima documentation system (? and ??) can't follow links in
.info files, so there's no sense in generating the category links;
they're generated only for html output at present. (Although if someone
used the info program to browse, the links could be used there.)
Not sure what to do about that.

The category system might be improved by putting some per-category
exposition, or by putting in a 1-line summary of each item, or by
allowing nested categories.

best

Robert
Richard Hennessy | 1 Jan 2009 02:38
Picon

Re: Fitting in Maxima

I am almost done with pw.mac so I was thinking it might be good still to have a help text search that supports
"and" "or" and "not" 
and parentheses.  I hope that is a improvement over the current help search.  I am not sure it would be enough
though.  If 
everything was searchable maybe you could find this.  I searched "fitting" and found
simple_linear_regression().  I would not have 
found that any other way.  In fact I didn't even know about it until just now after trying a search.

Rich

----- Original Message ----- 
From: "Robert Dodier" <robert.dodier <at> gmail.com>
To: "Barton Willis" <willisb <at> unk.edu>
Cc: <maxima <at> math.utexas.edu>
Sent: Wednesday, December 31, 2008 8:19 PM
Subject: Re: [Maxima] Fitting in Maxima

On 12/31/08, Barton Willis <willisb <at> unk.edu> wrote:

> Maybe because linsolve_by_lu isn't documented :( I must make a new years
>  resolution ... Of course, just documenting linsolve_by_lu doesn't make
>  the function easy find---our documentation needs more cross references
>  (linsolve_by_lu, solve, linsolve, and algsys all reference each other).

Well, the documentation category system is supposed to address
the problem by getting all the items to point to a common location
(the category) where they're listed together.

The major defect in the existing category system is that the existing
in-Maxima documentation system (? and ??) can't follow links in
(Continue reading)

Richard Hennessy | 1 Jan 2009 03:19
Picon

Re: Fitting in Maxima

Robert,

You said you were skeptical about this searchable help system?  Is there anything I should know about?  I like
to clean up messes. 
Programmer a and Programmer b create a mess c and super-coder d (me) comes along and actually gets it to work
according to original 
design specs.  Its what I do, it's lucrative, it's fun.  I not that good with Lisp knowledge.

Sometimes I come up with my own stuff too.

Rich

----- Original Message ----- 
From: "Richard Hennessy" <rvh2007 <at> comcast.net>
To: "Robert Dodier" <robert.dodier <at> gmail.com>; "Barton Willis" <willisb <at> unk.edu>
Cc: <maxima <at> math.utexas.edu>
Sent: Wednesday, December 31, 2008 8:38 PM
Subject: Re: [Maxima] Fitting in Maxima

I am almost done with pw.mac so I was thinking it might be good still to have a help text search that supports
"and" "or" and "not"
and parentheses.  I hope that is a improvement over the current help search.  I am not sure it would be enough
though.  If
everything was searchable maybe you could find this.  I searched "fitting" and found
simple_linear_regression().  I would not have
found that any other way.  In fact I didn't even know about it until just now after trying a search.

Rich

----- Original Message ----- 
(Continue reading)

Richard Hennessy | 1 Jan 2009 05:06
Picon

Re: Fitting in Maxima

I'm going to watch the ball drop.  I've had enough and I am shutting down my email till next year.  (And yes there
are known issues 
with pw 2.4.mac but they will get fixed, I usually test at the end of development, not as much during development)

Bye and Happy New Year,

Rich

----- Original Message ----- 
From: "Richard Hennessy" <rvh2007 <at> comcast.net>
To: "Robert Dodier" <robert.dodier <at> gmail.com>; "Barton Willis" <willisb <at> unk.edu>
Cc: <maxima <at> math.utexas.edu>
Sent: Wednesday, December 31, 2008 9:19 PM
Subject: Re: [Maxima] Fitting in Maxima

Robert,

You said you were skeptical about this searchable help system?  Is there anything I should know about?  I like
to clean up messes.
Programmer a and Programmer b create a mess c and super-coder d (me) comes along and actually gets it to work
according to original
design specs.  Its what I do, it's lucrative, it's fun.  I not that good with Lisp knowledge.

Sometimes I come up with my own stuff too.

Rich

----- Original Message ----- 
From: "Richard Hennessy" <rvh2007 <at> comcast.net>
To: "Robert Dodier" <robert.dodier <at> gmail.com>; "Barton Willis" <willisb <at> unk.edu>
(Continue reading)

Mario Rodriguez | 1 Jan 2009 16:45
Favicon

Re: Draw an animated gif with black background


> Thanks, that worked but now I can't see any of the titles or labels.  Is there a way to change the default
foreground color to white
> or some hex code?

set_draw_defaults(
   xrange        = [-1,1],
   yrange        = [-1,1],
   color         = yellow,
   user_preamble =
     ["set title 'My title' tc rgb 'white'",
      "set label 'My 1st label' at 0, 0.5 tc rgb 'white'",
      "set label 'My 2nd label' at 0, -0.5 tc rgb 'cyan'"],
   line_width    = 2 )$

draw(
   delay     = 100,
   file_name = "zzz",
   terminal  = 'animated_gif,
   file_bgcolor = "#000000",
   gr2d(explicit(x^2,x,-1,1)),
   gr2d(explicit(x^3,x,-1,1)),
   gr2d(explicit(x^4,x,-1,1)));

-------------

I have dedicated some time in the past trying to declare font types,
sizes and colors, in a standard mode for all terminals, but couldn't
find any (not all terminals support the same types and sizes), so that
this is a chance for option user_preamble to be used instead.
(Continue reading)

Mario Rodriguez | 1 Jan 2009 16:52
Favicon

Re: Draw an animated gif with black background


> How can you send animated gif output to a file, I might as well learn how gnuplot works.  I have been putting it
off.  If gnuplot 
> can do animated gifs then that would be more powerful probably.

Draw's animated gifs are made by gnuplot. This is a new terminal
introduced in gnuplot 4.2.

In the first versions of draw, we had to generate all scenes separately
and then make the animation with a third tool (imagemagick, for
example).

Mario
Dieter Kaiser | 1 Jan 2009 20:34
Picon

Half-angle-simplification of trig functions

We have the open bug SF[505443] Halfangle limitation.

I had a look at this topic. We have to adjust the factors for the cases
sin(z/2), cos(z/2), sinh(z/2) and cosh(z/2). The most general formula
for half-angle-simplification would be e. g. for the Sin function (see
e.g. functions.wolfram.com):

sin(z/2) = c(z) * sqrt((1-cos(z))/2) with a factor

c(z) = (-1)^floor(realpart(z)/(2*%%pi))
       * (1- (1+ (-1)^(floor(realpart(z)/(2*%pi))
                       + floor(-realpart(z)/(2*%pi))))
                       * unit_step(-imagpart(z)))

For a real argument this simplifies to:

c(x) = (-1)^floor(realpart(z)/(2*%%pi))

For a pure imaginary argument we get:

c(y) = (1-2*unit_step(-y))

This simplifies further to -1 for y negative and 1 for y positive. For
general complex expressions the term (-1)^(floor(expr)+floor(-expr)) is
1 for realpart(z) a multiple of 2*%pi and otherwise -1.

For the functions cos, sinh and cosh we get similiar expressions. I have
done an implementation of these general factors.

The examples at the end of this text show that the expressions simplify
(Continue reading)

Raymond Toy | 2 Jan 2009 15:31
Picon

Re: Fitting in Maxima

Žiga Lenarčič wrote:
>
> 4) Will there be possibility to call compiled numerical libraries  
> (ATLAS ..) from lisp in the future? I know gcl is kinda the limiting  
> factor right now..  I think f2cl conversions of numerical libraries  
> should not be a part of maxima. Especially if the user has to call  
> them with their fortran names. It's better to implement an  
> unoptimised original algorithm in lisp by hand (and tailored to  
> maxima's needs), since f2cl translations do not inherit the speed of  
> original fortran porgrams, neither are they consistent with other  
> maxima code or gain anything. So it's like using fortran without  
> speed, why would you do that? Ideally we should use ATLAS for  
> numerical linear algebra, so speed-wise maxima would be on par with  
> MATLAB and mathematica. Any chance of this becoming reality?
>   
The names are the LAPACK names because no one has come up with good
names.  Feel free to suggest new names and implement the appropriate
interface.  I haven't heard many comments about LAPACK support, so it
seems no one is really using it at all.

The best part of the f2cl translations is that no one else had to spend
their time writing Lisp equivalents for them.  Doing something like
LAPACK from scratch by hand in Lisp seems like a huge waste of time.  
That the translations aren't as fast as the original Fortran is not a
fault of the translation but of the Lisp used to compile it.  Rewriting
it in Lisp won't solve the speed problem if your Lisp can't do a good
job of compiling the f2cl-converted code.

If you feel like rewriting LAPACK in Lisp and can do as good a job as
the original authors, please do so. 
(Continue reading)

Luigi Marino | 2 Jan 2009 09:22
Picon

Equations

Andrew wrote:
 
I noticed that solve does not check roots for tolerance range.
A simple example of this is solve([1/x + 1/y =0 , x*y =0],[x,y]);
Maxima gives the solution x=0,
y=0. How to make Maxima check the roots? Maybe some global flags?
 
Hi .
A possible solution:
declare x and y not equal zero
and Maxima finds  indeterminate system:
x=%*r  and y=-%*r
infact  (x+y)/(xy)=x+y  (eliminate denominator).
2. Try  k=x^2  and solve two equations.
 
Luigi Marino.
 
_______________________________________________
Maxima mailing list
Maxima <at> math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima
Raymond Toy | 2 Jan 2009 17:56
Picon

"Simpler" bigfloat and complex bigfloat arithmetic

I think a long time ago, I talked with Barton about this, and have now
finally gotten a round to implementing it.

I've written a set of CLOS classes to make working with bigfloat and
complex bigfloat numbers easier.  It's a new package "NUMERIC" where the
standard Lisp operations have been shadowed to work with a new bigfloat
and complex-bigfloat numbers.

The source is available at http://common-lisp.net/~rtoy/numeric.lisp. 
If you want to try it you'll need to modify maxima-package.lisp and
maxima.system a bit.  Instructions included in numeric.lisp.

Here's a quick example what you can do:

:lisp (numeric:sqrt (numeric:bigfloat -8))
 0.0b0 + %i* 2.82842712474619b0

(numeric:bigfloat converts a float or integer to a bigfloat object)

Here is the ascending-transform from ellipt.lisp, for double-floats:

(defun ascending-transform (u m)
  (let* ((root-m (cl:sqrt m))
     (mu (/ (* 4 root-m)
        (cl:expt (1+ root-m) 2)))
     (root-mu1 (/ (- 1 root-m) (+ 1 root-m)))
     (v (/ u (1+ root-mu1))))
    (values v mu root-mu1)))

The equivalent that would for double-floats, bigfloats, or
complex-bigfloats is:

(defun ascending-transform (u m)
  (let* ((root-m (numeric:sqrt m))
     (mu (numeric:/ (numeric:* 4 root-m)
        (numeric:expt (numeric:1+ root-m) 2)))
     (root-mu1 (numeric:/ (numeric:- 1 root-m) (numeric:+ 1 root-m)))
     (v (numeric:/ u (numeric:1+ root-mu1))))
    (values v mu root-mu1)))

Of course, if you really needed max speed with just double-float, you
need to write a special version for that, but at least this package
makes it easy to write one version that will handle double-float,
bigfloat or complex bigfloats.

If people find this useful, perhaps it can be added to maxima.

The routines still need some work, and not all corresponding Lisp
arithmetic functions have been implemented yet.  One side benefit is
that the bigfloat operations have been abstracted out, so we can easily
replace Maxima's current bigfloat implementation with a different
implementation like GMP or MPFR.

Ray

Gmane