17 Sep 08:34 2014

### Re: Maxima-discuss Digest, Vol 8, Issue 20

On Wed, Sep 17, 2014 at 4:50 AM, wrote:
Contour_plot chooses it's own values for the isolines. I now use this
command below to draw some simple circles:

contour_plot (x^2 + y^2, [x, -4, 4], [y, -4, 4]);

How can I make contour_plot draw a single circle with radius 1, and how
can I give contour_plot a list [1, 2, 3.14159] of circles to draw?

​If you want contours as circles of some radius why not supply them with the equation of circle,
draw2d(proportional_axes=xy,implicit(x^2 + y^2=1,x,-2,2,y,-2,2));​

and may be similarly for others ! Contours are signatures of figures, they are usually not true representation of their parent objects.
Hope I got your question right !

--
Regards,
Pankaj Sejwal
____________________________________________________
"The more I read, the more I acquire, the more certain I am that I know nothing.” -
Voltaire
------------------------------------------------------------------------------
Want excitement?
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Maxima-discuss mailing list
Maxima-discuss <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/maxima-discuss

17 Sep 01:19 2014

### Re: bugs related to infinity

I've been thinking about this some more, and writing a few programs/ minor changes to existing ones.

Assume we have a distinguished class of expressions denoting
infinity (unsigned, maybe complex?),  positive real infinity, negative real infinity,
undefined (illegal? value?  or unknown but maybe infinite?)
indefinite    (= finite but unknown?)
maybe some other stuff.
some problems go away if we have an indexed set of infs,  e.g. inf(1), inf(2).... so
inf(1)-inf(1)  is zero,  but inf(1)-inf(2)  is unknown.  undefined,  in the absence of other info

We probably agree that  a few things can be computed.  1/inf --> 0

Here's a nagging problem.  Referential transparency.

If we have an expression involving x and y,  computed as f(x,y), and later
evaluate with x=1,y=2,    we should get the same result as f(1,2).

This fails in various ways.   Example,   f(x,y):=  x*y.
f(0,y)  returns 0
f(0,inf) returns 0  but if it returns undef [which is more plausible and IEEE754 compatible...]
it suggests that binding y to inf  should be forbidden.
subst(inf, y, f(0,y))    should compute  inf*0 and undef. but no go.
it suggests that substitution (inf ,  ...)  should also be forbidden.

This doesn't quite work with  assignment...

(%i5) limit(1/x,x,0,plus)

binds %o5 to inf..

so maybe we allow (only?) global assignments ???  We would have to
reject    f(limit(...), y)   ??

What about trying to do arithmetic on  inf(1)+inf(2)   to make inf(3),  or
responding to the literal typed-in expression 0*infinity  with undef(3), say?

Or just leaving inf(1)+ inf(2)  alone... after all you might wish to
subtract it from itself and get zero.

... Just trying to get you thinking about consistent solutions.

RJF

On 7/2/2014 6:57 AM, Richard Fateman wrote:
On 7/2/2014 1:50 AM, Dimiter Prodanov wrote:
I think that we'd best let the undeterminate expressions
0*inf, inf/inf, 0/0, inf-inf, inf^0, minf+inf  etc. to be non-simplified.

It would slow down simplification of expressions. Some expressions would take much longer.
On average, who knows?

The simplifier "short cuts" products.  To simplify    a*b*c*d ....   as soon as some
term, say "b"  simplifies to zero, the rest of the terms c,d, ... are ignored and the answer is zero.

Then such expressions will be only evaluated by the limit function.

IMHO this should be quite easy to do.

It does not solve the problem of simplifications on symbolic expressions and then
substitution of und or inf for symbols.    e.g. 0*x   is zero,   but 0*inf is und.

Unless you turn off ALL simplification even those not including inf etc,
or you forbid substitution  or assignment, e.g. x: inf.

What would happen if you were forbidden to do   x:inf   or    subst(inf, ...) ??  how could
you ever introduce inf into a calculation?

If there are no symbols at all,  e.g. as is the case with FORTRAN,  you never simplify 0*x where
x is a symbol.   FORTRAN would call x  a non-initialized variable and 0*x would be an error.
RJF

------------------------------------------------------------------------------
Want excitement?
When you want reliability, choose Perforce.
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Maxima-discuss mailing list
Maxima-discuss <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/maxima-discuss

17 Sep 00:34 2014

### contour plot value list

Dear all,

Contour_plot chooses it's own values for the isolines. I now use this
command below to draw some simple circles:

contour_plot (x^2 + y^2, [x, -4, 4], [y, -4, 4]);

How can I make contour_plot draw a single circle with radius 1, and how
can I give contour_plot a list [1, 2, 3.14159] of circles to draw?

Best,
Nijso

------------------------------------------------------------------------------
Want excitement?
When you want reliability, choose Perforce.
Perforce version control. Predictably reliable.

16 Sep 22:02 2014

### compiling maxima under cygwin?

Hi all,

I just have a quick question.
How do i compile Maxima under cygwin to use it?

I tried:

./configure --prefix=/cygdrive/c/maxima
make
make install

this seems not to work all that well over here.
i seem not to get any exe files.

maybe someone has a better idea?
i also have a linux box so if cross compiling is a btter idea?

greetings,
simon

--

--
Simon Eigeldinger
E-Mail: simon.eigeldinger <at> vol.at
MSN: simon_eigeldinger <at> hotmail.com
ICQ: 121823966
Jabber: domasofan <at> andrelouis.com

---
Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz ist aktiv.
http://www.avast.com

------------------------------------------------------------------------------
Want excitement?
When you want reliability, choose Perforce.
Perforce version control. Predictably reliable.

16 Sep 20:12 2014

### Small bug in Draw


Hi,

I assume that my request caused this so I feel rather guilty about
this one:
In the last maxima version if a formula I wanted to plot did contain a
variable that isn't defined maxima would grab a full CPU, several
minutes of time and all RAM it could get hold of before it found out
that it can't succeed.
Now everything works like magic except in one fringe case - where I
see the logic behind the failure, but anyway...
...a minimal test case is:

f(x):=if x>0 then rhs(y=x^2) else rhs(y=x);
draw2d(
explicit(f(x),x,-1,1)
);

Without the if the rhs is evaluated.
Without the rhs there aren't any undefined variables. But with an if
preventing the rhs from being evluated the y is still in the formula
causing the plot to abort.

Will use a function for y instead. But -
wanted to send this problem to the list completely surprised that all
the other places I found to be odd when I first encountered maxima
have been evened out in the last 1 1/2 years.

Thanks a lot for that and

Kind regards,

Gunter.

16 Sep 17:07 2014

### eigenvalues in Maxima -- is there a better way?

Once every other year (including this year), I teach a course where the class does a *lot* of work with square, non-negative matrices. One of the things they focus on is deriving eigenvalues.

Take the following simply example:

a:matrix([0,20,50],[0.05,0,0],[0,0.1,0]);

Now, the eigenvalues for this matrix are:

1.107159871688766, - 0.83756543528332, - 0.26959443640544

But, if I have the students fire up wxMaxima, and get them to run something 'obvious'  like

float(eigenvalues(a));

wxMaxima  returns what my students now refer to as 'BUO' (boo-oh -- 'big ugly output'). In this case,

rat: replaced 0.25 by 1/4 = 0.25
rat: replaced 1.0 by 1/1 = 1.0
(%o2) [[(0.33333333333333*(0.86602540378444*%i-0.5))/(0.14632852434518*%i+0.125)^(1/3)+(-0.86602540378444*%i-0.5)*
(0.14632852434518*%i+0.125)^(1/3),(0.14632852434518*%i+0.125)^(1/3)*(0.86602540378444*%i-0.5)+
(0.33333333333333*(-0.86602540378444*%i-0.5))/(0.14632852434518*%i+0.125)^(1/3),(0.14632852434518*%i+0.125)^(1/3)+
0.33333333333333/(0.14632852434518*%i+0.125)^(1/3)],[1.0,1.0,1.0]]

Now, somewhere embedded in the preceding  BUO are the eigenvalues, but no way students (or me, for that matter) want  to manually parse through this kind of output.

When I asked about this sort of thing a couple of years back, one suggestion was to use lapack and dgeev. Fair enough, except that

only seems to work for XMaxima, or CLI Maxima, but not at all for wxMaxima (basically, when I try load(lapack) in wxMaxima, GUI just hangs). Further, if I load(lapack) in (say) XMaxima, and *then* try to load(lapack) in wxMaxima, still doesn't work (at least, not in an obvious, straightforward way).

But, on the bright side, if they use XMaxima, then load(lapack) followed by dgeev(a) works fine. Returns eigenvalues that are neither big, nor ugly.

dgeev(a);
(%o3) [[1.107159871688766, - 0.83756543528332, - 0.26959443640544], false,
false]

Of course, the other approach is to simply generate a characteristic polynomial for the matrix, and then use allroots to find the eigenvalues (this works perfectly), but I'd rather not have to do that every time.

So,

1\ is there a particular reason (policy choice?) that eigenvalues in Maxima generate BUO?

2\ other than forcing students to use XMaxima, and then the load(lapack)  -> dgeev approach, are there any other 'loadable' options, or 'function tricks' that we can employ?

Students rather like Maxima...except for things that generate BUO -- which for most of what we're doing means deriving 'eigenvalues'. Simply looking for options that will render the output correct (of course), and 'simple to read'.

------------------------------------------------------------------------------
Want excitement?
When you want reliability, choose Perforce.
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Maxima-discuss mailing list
Maxima-discuss <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/maxima-discuss

16 Sep 16:52 2014

### Update on Mathematica style pattern matching

​This mail is an update on Mathematica style pattern matching.
Earlier feature was finished upto applying _,__,___ pattern matchers on a sublist free lists. For example,
disect([_a,__b,__c],[a,b,c,d,e,f,[g,h]]);

This mail is regarding update on  applying these on lists containing sublists. For example,
dissect([_a,[__a1]],[1,[2,3,[[5]]]]); => [[a,[1]],[a1,[2,3,[[5]]]]]

Now that list elements have been separated as per patterns all one needs to do rearrange them as needed, for example,
rearrange(dissect([_a,[__a1],_c],[1,[2,3,[[5],7]],4]),[a,a1,c]); => [1,2,3,[[5],7],4]

If some pattern doesn't match then it returns the original input list unmanipulated.

For operations like,
rearrange(dissect([_a,[__a1],_c],[1,[2,3,[[5],7]],4]),[a,a1*c,c^3]);
=> [1,8,64]
This is not what one had expected, but not to worry as Mathematica will also give unpredictable results on sequences.
One can expect predictable results only on atoms/lists obtained as pattern matching output.
rearrange(dissect([_a,[__a1],_c],[1,[[[5],7]],4]),[a,a1*c,c^3]);
=> [1,[[20],28],64]

Also one can do checks like that in Mathematica,taking a more nested list,
eer:dissect([_a,[_a1,_a2,__b,[_e,__f],[_g,_h]],_c],[1,[2,3,4,[[5,6],7,8],[7,8,8,9]],4]);
map(lambda([y],if(first(last(y))>=4)then y),sublist(eer,lambda([x],first(x)=c))); => [c,[4]]

To be able to do it, APIs related to 'Position' of element in list have been used and can be obtained from another
file named 'positions' in GIT.
I would request everyone to use it and if one finds bugs, please share it with me.
Updated code is at the same old location:
https://github.com/pankajsejwal/pattern-matching

If someone tries and faces any problem, I would be glad to interact with them and sort it out.
------------------------------------------------------------------------------
Want excitement?
When you want reliability, choose Perforce.
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Maxima-discuss mailing list
Maxima-discuss <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/maxima-discuss

16 Sep 11:29 2014

### diff and chain rule

I found that when differentiating functions of functions, maxima does
not expand the derivative. Specifically, in

eq: q(theta(w))*(y-w) = c;
diff(eq, w);

how can I get a q'(theta(w)) * theta'(w) term instead of d/dw q(theta(w))?

The above is a minimal example, I need this functionality because I am
solving for 'diff(theta(w), w) terms in a more complicated expression.

Best,

Tamas

------------------------------------------------------------------------------
Want excitement?
When you want reliability, choose Perforce.
Perforce version control. Predictably reliable.

16 Sep 09:42 2014

### Command history in (r/i/wx)maxima

One thing has always seemed to me to be missing from maxima and that's a history mechanism in which, when you enter a few characters, you can search (using the arrows keys, say) through previous commands starting with those characters.

This is handy if you want to enter an old command (say a "diff" command) with some new values, rather than going through the last 70 commands until you get the one you want, you just enter "di" and a few up arrows.

I'm not sure what the name of this sort of history mechanism is, and according to the manual something similar is supposed to work in maxima using ALT-p and ALT-n.  However, I don't know of such a mechanism in wxmaxima, imaxima, or rmaxima (for maxima compiled with SBCL).   And this history mechanism works by searching for strings within a command.  Can this mechanism be made to work with just the first few letters of a command?  And made to work in imaxima, rmaxima, wxmaxima?

Thanks,
Alasdair
------------------------------------------------------------------------------
Want excitement?
When you want reliability, choose Perforce.
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Maxima-discuss mailing list
Maxima-discuss <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/maxima-discuss

15 Sep 22:29 2014

### about bringing on new developers in general

I'd like to remark that, while I have been carrying out many
administrative functions, there are several people with
admin privilege for the Maxima Sourceforge project, who can
also carry out any task such as granting permissions to new
developers. I encourage the other administrators (Andrej Vodopivec,
Alexey Beshenov, Leo Butler, Jaime Villate, and Viktor Toth) to
go ahead and exercise their authority as they see fit.

best

Robert Dodier

------------------------------------------------------------------------------
Want excitement?
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.

13 Sep 18:59 2014

### Re: Replace symbolic function by real function in jacobian


Many functions in maxima have modificators that enable potentially
powerful operations that on the other hand might result in the
complexity of equations to explode.
This time you are right and things get much easier if the
differentiation is executed.

Try

ev(%,diff);

Kind regards,

Gunter.

On 13.09.2014 15:26, karl wrote:
> HI Gunter,
>
> thanks, but  in both the approaches you propose I get as result:
>
> $$\pmatrix{{{d}\over{d\,x}}\,\left(2\,y^2+x^2\right)&{{d}\over{d\,y}} > > \,\left(2\,y^2+x^2\right)\cr }$$
>
> Sothe function is there, but  the differentiation is not made.
>
> How to get this done too?
>
> Ciao
>
> Karl
>
> Be careful: gradh is using the function h while rsquared contains a
> definition for the variable h.
>
> What I assume you need is something like:
>
>
> or alternatively:
>
>
> Kind regards,
>
> Gunter.
>
>
> On 13.09.2014 14:56, karl wrote:
>>>> Am 13.09.2014 um 13:05 schrieb Gunter Königsmann:
>>>>> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
>>>>>
>>>>> The question isn't stupid: It touches one of the secrets
>>>>> why maxima is extremely powerful and power is never easy to
>>>>> handle when trying to do so for the first time. Anyway... I
>>>>> assume the problem lies in choosing the right assignment
>>>>> operator:
>>>>>
>>>>> h(x,y):= x^2 + y^2
>>>>>
>>>>> defines a function named h with two parameters. This
>>>>> function can be used like follows:
>>>>>
>>>>> h(2,4)
>>>>>
>>>>> It can coexist with a variable of the same name which
>>>>> maxima identifies by its lack of parameters. The second
>>>>> assignment operator maxima supports is the equal sign:
>>>>>
>>>>> h = x^2 + y^2
>>>>>
>>>>> is just an equation. This equation now can be manipulated
>>>>> using solve(), diff(), integrate() and if you want to
>>>>> re-use it you can use the label maxima assigns to it
>>>>> dynamically (for example o33) or give it a more speaking
>>>>> name:
>>>>>
>>>>> rsquared: h = x^2 + y^2;
>>>>>
>>>>>
>>>>> The third assignment operator maxima supports is the ":"
>>>>> sign which assigns a value to a variable:
>>>>>
>>>>> h:x^2 + y^2;
>>>>>
>>>>> This will cause maxima to know the value of h and to
>>>>> automatically replace any h it will find by x^2+y^2.
>>>>>
>>>>> Sometimes you might want to have the ability to switch
>>>>> between using h as a symbol and its value. In this case you
>>>>> can either quote the h to prevent maxima from the variable
>>>>> where you don't want it to do so:
>>>>>
>>>>> 'h
>>>>>
>>>>> will stay a h until you apply the ev() function to it. The
>>>>> second way (the one I normally use) is to save the
>>>>> definition of h in a variable and explicitly tell maxima
>>>>> when you want this definition to be applied:
>>>>>
>>>>> rsquared: h = x^2 + y^2;
>>>>>
>>>>>
>>>>> Since making lists in maxima is a rather easy task
>>>>> sometimes it is convenient to bundle more knowledge into
>>>>> one variable:
>>>>>
>>>>> rsquared:[ h = x^2 + y^2 r = sqrt(x^2 + y^2) ];
>>>>>
>>>>>
>>>>>
>>>> Hi Gunter,
>>>>
>>>> thanks very much  for the answer, but for me it doesn't
>>>> work:
>>>>
>>>> This gives the symbolic form:
>>>>
>>>> \begin{verbatim}
>>>> \end{verbatim}
>>>>
>>>> Then I define:
>>>>
>>>>> rsquared: h = x^2 + 2*y^2;
>>>> Then I write:
>>>> I get again a symbolic gradient:
>>>>
>>>> $$\pmatrix{\left.{{d}\over{d\,x}}\,h\left(x , >>>> y\right)\right|_{h=y^2+ x^2}&\left.{{d}\over{d\,y}}\,h\left(x >>>> , y\right)\right|_{h=y^2+x^2} \cr }$$
>>>>
>>>> So I would like to have the gradient of h as defined in
>>>> rsquared.
>>>>
>>>> Ciao
>>>>
>>>> Karl
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>>
>>>>
>>>>
>
>>>>
Want excitement?
>>>> reliability, choose Perforce Perforce version control.
>>>> Predictably reliable.
>>>>
>>>>
>>>>
>
>>>>
_______________________________________________
>>>> Maxima-discuss mailing list
>>>> Maxima-discuss <at> lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/maxima-discuss
>>>>
>


Gmane