two questions: A) list length of solve result, B) 0^0
Subject: two questions: A) list length of solve result, B) 0^0
From: andre maute
Date: Sat, 7 Jun 2008 22:33:52 +0200
I have the following stripped down test case,
--------------------------------------------------------------
$ maxima -b solve-result.max
Maxima 5.15.0 http://maxima.sourceforge.net
Using Lisp SBCL 1.0.11.debian
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) batch(solve-result.max)
batching /home/user/solve-result.max
(%i2) solve([c11 = 0], [c11])
(%o2) [c11 = 0]
(%i3) solve([c12 = 0, c22 = 0], [c12, c22])
(%o3) [[c12 = 0, c22 = 0]]
---------------------------------------------------------------
in my application a function generates a set of equation and variables
which are fed to solve. I don't know the variables a priori.
Question 1:
Both have obviously length 1, how can I differentiate both cases?
Is it possible to remove the other brackets in the second case?
and here the next one,
-------------------------------------------------------------
$ maxima -b bernstein.max
Maxima 5.15.0 http://maxima.sourceforge.net
Using Lisp SBCL 1.0.11.debian
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) batch(bernstein.max)
batching /home/user/bernstein.max
(%i2) display2d : false
(%o2) false
(%i3) my_bernstein(n,k,x):=binomial(n,k)*(x+1)^k*(1-x)^(n-k)
(%o3) my_bernstein(n,k,x):=binomial(n,k)*(x+1)^k*(1-x)^(n-k)
(%i4) my_bernstein(0,0,1)
0^0 has been generated
#0: my_bernstein(n=0,k=0,x=1)(bernstein.max line 0)
-- an error. To debug this try debugmode(true);
--------------------------------------------------------------
Question 2:
Experimenting with Bernstein polynomials,
0^0 is triggered but here, 0^0 = 1, can safely be assumed.
Is it possible to suppress this error?
Andre