cheater cheater wrote:
> Hi again, I have noticed that a lot of people post this info when
> talking about issues in maxima:
>
> (%i1) build_info();
>
> Maxima version: 5.25.1
> Maxima build date: 14:1 8/29/2011
> Host type: x86_64-unknown-linux-gnu
> Lisp implementation type: SBCL
> Lisp implementation version: 1.0.29.11.debian
>
> Cheers
>
> On Thu, Nov 10, 2011 at 15:18, cheater cheater <cheater00 at gmail.com> wrote:
>> Hi guys! I have just subscribed to the mailing list. Recently I've
>> been using Maxima a lot for analyzing the performance of computer
>> algorithms. I'm surprised at how easy it is to master. There are,
>> however, some things that are non-obvious.
>>
>> I have run into a problem which I cannot get past, though. You see, I
>> am using Maxima to do some curve fitting, and then count an integral.
>> However, sometimes the curve fits have parameters which turn out to be
>> "arbitrary". This isn't really so, but I guess the newton-raphson gets
>> confused around 0. For example it'll return things such as:
>>
>> 3^2 + 0.22e-40*%r21 ? ? ?where obviously any small changes to r21 will
>> not change the complete value at all (the changes to %r21 get
>> truncated).
>>
>> The objective of the maxima code I am executing is to calculate those
>> integrals and put them out to stdout and have the Python script (which
>> does a lot of other work) take these numbers and continue analysis. Of
>> course, Python cannot interpret %r21 and throws exceptions. Therefore
>> I thought I would just plug something into those arbitrary values. I
>> did something like this:
Why not filtering the answer in the python script and replacing occurences
of %r<n> by 1 here? The advantage is that it is very easy ...
>>> re.sub(r'%r[0-9]+','1','3^2 + 0.22e-40*%r21')
'3^2 + 0.22e-40*1'
--
Michel Talon