[Maxima] two questions: A) list length of solve result, B) 0^0

Stavros Macrakis macrakis at alum.mit.edu
Sat Jun 7 16:54:17 CDT 2008


I suggest you call algsys directly rather than via solve for uniform
result format.

If youb want to force 0^0 to simplify to 1, I believe you can do this
using tellsimp, though at some cost in efficiency.

      -s



On 6/7/08, andre maute <andre.maute at gmx.de> wrote:
> On Saturday 07 June 2008, andre maute wrote:
>> 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?
>
> O.K. a trivial workaround the variable list must be available,
> 	so one can easily check (in my application) for its length.
>
> But is it possible to set some global parameter,
> to avoid such workarounds?
>
>>
>> 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
>> _______________________________________________
>> Maxima mailing list
>> Maxima at math.utexas.edu
>> http://www.math.utexas.edu/mailman/listinfo/maxima
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>

-- 
Sent from Gmail for mobile | mobile.google.com


More information about the Maxima mailing list