Nick Strauss | 3 Aug 16:31 2015

display comments

I'd like to add comments to my batch (or demo) file that are displayed
by the maxima parser. So, if I write
    /* Example of adding two numbers */
    1+1;
The comment is displayed. What's the best way of doing this?

--

-- 
All postal correspondence to:
The Positive Internet Company, 24 Ganton Street, London. W1F 7QY

*Follow us on Twitter*  <at> posipeople

The Positive Internet Company Limited is registered in England and Wales.
Registered company number: 3673639. VAT no: 726 7072 28.
Registered office: Northside House, Mount Pleasant, Barnet, Herts, EN4 9EE.

------------------------------------------------------------------------------
David Scherfgen | 4 Aug 10:29 2015

wxMaxima doesn't show output until call terminates, bad for debugging

Hi all, but especially Gunter,

I use wxMaxima a lot during the development of a quite complex program. Sometimes the program gets stuck somewhere, and for that purpose, I'm outputting a lot of debug information.

Unfortunately, wxMaxima doesn't show the output until the call has terminated, so my debug output never goes to the screen.

Is there anything I can do about it (like changing a buffer size?), is this even a problem with wxMaxima or is it due to the way Maxima communicates with it?

Best regards,
David
------------------------------------------------------------------------------
_______________________________________________
Maxima-discuss mailing list
Maxima-discuss <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/maxima-discuss
David Scherfgen | 4 Aug 09:59 2015

trigsimp can't handle this very simple expression

Hi,

I'm wondering why trigsimp fails to simplify the following expression to -1:

sin(x)^2 / (cos(x)^2 - 1)

The manual says it tries to apply the pythagorean identities, but shouldn't it be successful then?

Best regards,
David
------------------------------------------------------------------------------
_______________________________________________
Maxima-discuss mailing list
Maxima-discuss <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/maxima-discuss
Robert Dodier | 4 Aug 00:48 2015
Picon

announcing Maxima-Fishbowl, an IPython kernel for Maxima

To whom it may concern, I've constructed an IPython kernel (back end)
for Maxima, based on the Fishbowl project of Frederic Peschanski. Many
thanks to Frederic!

IPython is a user interface for interactive sessions, which separates
the display from the language-dependent kernel. Originally devised as an
improved UI for Python sessions, kernels have been created for many
other languages, including Common Lisp (Fishbowl) and now Maxima
(Maxima-Fishbowl).

The interesting part of the UI, to me, is the notebook interface. The
IPython notebook can combine text, formulas, and graphics. An example of
a notebook containing Maxima stuff:
http://nbviewer.ipython.org/github/robert-dodier/maxima-fishbowl/blob/master/MaximaFishbowlExample.ipynb

A motivation here is to use IPython to compose documents or articles
which make use of Maxima. I'll keep you posted if I make any progress
with that.

The code, such as it is, and some other stuff can be found at:
https://github.com/robert-dodier/maxima-fishbowl

Bear in mind that there are a lot of dependencies, and, while the code
isn't all that complicated, it might take some dedication to wade
through resolving all the dependencies, both Python and Lisp.

As an aside, Maxima-Fishbowl is built by starting with an existing
Maxima executable image, loading Fishbowl into it, and saving the
resulting image. It seems like that would be a general way to create
an IPython kernel for other CL applications.

I'd be happy to hear any comments you might have.

best,

Robert Dodier

------------------------------------------------------------------------------
Marcus Menzel | 3 Aug 16:11 2015
Picon
Picon

Not Working Example From Manual

Hello,
 
I tried the following example from the manual (using WXmaxima, Maxima 5.35.1.2; Lisp: SBCL 1.2.7 under Windows 7):
 
Graphic object: vector  
    vector ([x,y], [dx,dy])  
    vector ([x,y,z], [dx,dy,dz])
Draws vectors in 2D and 3D.
.....8<.............
.............>8.......
3D
vector([x,y,z], [dx,dy,dz]) plots vector [dx,dy,dz] with origin in [x,y,z].
Example:
(%i1) load(draw)$
(%i2) draw3d(color = cyan,
             vector([0,0,0],[1,1,1]/sqrt(3)),
             vector([0,0,0],[1,-1,0]/sqrt(2)),
             vector([0,0,0],[1,1,-2]/sqrt(6)) )$
 
draw: 3D graphic object not recognized, list
 -- an error. To debug this try: debugmode(true);
 
I tried to restart thing to make sure it is no hiccup, but that is reproducible.
Are there some preparations or definitions necesscary to make the example work or is it a bug?
 
 
Regards,
Marcus
 
 
P.S. I'll try out the last version later, if there is a difference I'll post it.
------------------------------------------------------------------------------
_______________________________________________
Maxima-discuss mailing list
Maxima-discuss <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/maxima-discuss
Van Dam, Hubertus J | 2 Aug 07:57 2015

How to write a Maxima function that does something special for the at-function?

I want to differentiate an expression and generate Fortran for the result. The expression is similar to at(diff(x^2*f(x,y)+y^2*g(x,y),y),y=x). The result contains terms such as at(diff(f(x,y),y),y=x) and at(diff(g(x,y),y),y=x).

 

Before I generate Fortran I want to remove the at-functions (I have another script to convert the diff(f(x,y),y) and diff(g(x,y),y) entities to subroutine calls). Hence I am trying to write a function that goes through the expression tree and does something special when the at-function is found. However, if I compare piece='at, this always evaluates to false whereas if I compare piece='sin, the sin function is detected correctly. I am completely at a loss as to why the at-function is not detected.

 

The code I have so far is

 

    eliminateAt(expression) :=

       block( [ops,args,result],

              if atom(expression)

              then expression

              else

                 ( ops:  op(expression),

                   args: args(expression),

                   print("piece=",piece),

                   if piece='at

                   then processAt(first(args))

                   else

                      (

                        result: [],

                        for arg in args do (

                            result: endcons(eliminateAt(arg),result)

                        ),

                        apply(ops,result)

                      )

                 )

            );

    processAt(expression) :=

       block( [ops,args,result],

              print("expression=",expression),

              expression

            );

 

 

If I run this as

 

    eliminateAt(at(diff(f(x,y),y),y=x));

 

 

I get

 

    (%i4) eliminateAt(at(diff(f(x,y),y),x=y));

    piece= at

    piece= derivative

    piece= f

    piece= =

                                              !

                                  d           !

    (%o4)                         -- (f(x, y))!

                                  dy          !

                                              !x = y

  

 

So even though piece is printed to be "at" the function processAt is never called. If I change the line "if piece='at" to "if piece='sin" and then evaluate

 

    eliminateAt(sin(diff(f(x,y),y)));

 

I get

 

    (%i6) eliminateAt(sin(diff(f(x,y),y)));

    piece= sin

                d

    expression= -- (f(x, y))

                dy

                                     d

    (%o6)                            -- (f(x, y))

                                     dy

 

 

which clearly demonstrates that the sin-function is detected no problem. So what is special about the at-function and how can I detect when I have reached it in an expression?

 

__________________________________________________
Huub van Dam
Scientist
EMSL: Environmental Molecular Science Laboratory

Pacific Northwest National Laboratory
902 Battelle Boulevard
P.O. Box 999, MSIN K8-91
Richland, WA  99352 USA
Tel:  509-372-6441
Fax: 509-371-6445
Hubertus.vanDam <at> pnnl.gov
www.emsl.pnl.gov

www.linkedin.com/in/HuubVanDam

orcid.org/0000-0002-0876-3294

 

------------------------------------------------------------------------------
_______________________________________________
Maxima-discuss mailing list
Maxima-discuss <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/maxima-discuss
Raymond Toy | 3 Aug 02:09 2015
Picon

beta_incomplete_regularized and ACM TOMS license


In https://sourceforge.net/p/maxima/bugs/2999/ is a bug report about
beta_incomplete_regularized getting a divide by zero for
beta_regularized_incomplete(4830, 171, 0.833333333333333333);

This is a bug in the algorithm which computes
beta_incomplete(4830,171,.8333) and then divides by beta(4830,171).
When computed as a double-float beta(4830,171) underflows to zero.

After some googling, ACM TOMS algorithm 708 implements
beta_incomplete_regularized that doesn't have this problem.  (More
testing is needed because I also converted the code to produce double
precision results instead of single that was used for the original.)
I translated the Fortran code to lisp via f2cl (like the slatec
algorithms we use).

I'd like to integrate this with maxima, but unlike slatec, the ACM
TOMS licensing is different: For algorithms afte 2013, the auther owns
the code. For previous code,
http://www.acm.org/publications/policies/softwarecrnotice
applies. Non-commercial use is allowed.

IANAL, but it seems fine for maxima to use these the code.

--
Ray

------------------------------------------------------------------------------
Daniel Volinski | 2 Aug 18:52 2015
Picon
Picon

How to plot a discrete parametric curve in 3D?

Hi All,

Using wxMaxima 5.36.1 sbcl on Windows 8.1 x64

As a consequence of a numeric calculation by rkf45, I have a result that consists of a list of lists, each sub list contains the value of the parameter (s) and then the coordinates (r, theta, phi), so it represent a discrete parametric curve in 3D. How do I plot this?

Moreover, since the values are [r, theta, phi], I would like the plot to represent the points in spherical coordinates.

Please help, thanks!

Daniel Volinski

------------------------------------------------------------------------------
_______________________________________________
Maxima-discuss mailing list
Maxima-discuss <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/maxima-discuss
Thomas LaBone | 2 Aug 12:01 2015
Picon

Another Question About Maxima's Questions


I tell Maxima that tx + ty - 1 is negative and then it comes back and 
asks me if tx + ty - 1 is positive, negative, or zero. Am I specifying 
this condition properly? If I am, is this a bug?

(%i1) f(x,y) := exp(tx*x) * exp(ty*y) * exp(-y);
(%o1) f(x,y):=exp(tx*x)*exp(ty*y)*exp(-y)

(%i2) assume(ty < 1);
(%o2) [ty<1]

(%i3) assume(ty + tx -1 < 0);
(%o3) [-ty-tx+1>0]

(%i4) assume(notequal(tx,0));
(%o4) [notequal(tx,0)]

(%i5) integrate(integrate(f(x,y),y,x,inf),x,0,inf);
"Is "ty+tx-1" positive, negative or zero?"negative;
(%o5) 1/((ty-1)*(ty+tx-1))

------------------------------------------------------------------------------
Roland Salz | 1 Aug 21:18 2015
Picon

Eliminate variables from a system of equations

Hallo and guten Abend from Bochum, Germany,
 
after having tried for a long time, I am wondering whether Maxima can help me to solve the following problem:
 
Given a system of four not so difficult equations:
    2*a  = a1  + a2
    a1^2= y^2 + (e+x)^2
    a2^2= y^2 + (e-x)^2
    a^2  = b^2 + e^2
 
I would like to eliminate the variables a1, a2 and e in order to obtain a single equation relating the remaining variables, that is a, b, x and y. (The result should be the equation of an ellipse in cartesian coordinates, center in the pole.)
 
Although I have the feeling that Maxima should be able to deal with this, I can’t find out how. Particularly, I don’t know how to apply the function solve in this case.
 
Questions:
1. Can the function solve be used here?
2. Is there another function that should be used instead?
3. Can Maxima be at all of any help in solving this kind of problem? How? Can anyome give me a hint?
 
So far I have managed to solve all my mathematical problems with Maxima, but here I got stuck.
 
Thank you!     Roland Salz
 
------------------------------------------------------------------------------
_______________________________________________
Maxima-discuss mailing list
Maxima-discuss <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/maxima-discuss
John Shackell | 31 Jul 10:09 2015
Picon

Further remarks on the handling of log

My thanks to Stavros and Barton for their helpful replies. To recap,  the code I gave is:-

(%i6) log(a^2)-2*log(a);
(%o6)                                  0
(%i7) log((-1)^2)-2*log(-1);
(%o7)                            - 2 log(- 1)
(%i8) float(2*log(-1));
(%o8)                        6.283185307179586 %i

Of course a is real, although its logarithm isn't.

In the program I am trying to write, log may get applied to an arbitrary elementary function over the reals. It is known to be formally undecidable whether such takes negative values (Richardson - J. Symbolic Logic, 33 (1968), 514-520). Hence I can't really use assume or declare.

plog would be good if I were working interactively, but setting logexpand to false looks like the best way forward for me.

So thanks again.

John Shackell


------------------------------------------------------------------------------
_______________________________________________
Maxima-discuss mailing list
Maxima-discuss <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/maxima-discuss

Gmane