[scilab-Users] recursion using fsolve

Charles Basenga Kiyanda cbk at lanl.gov
Wed Jun 23 16:45:15 CEST 2010


Hi,

Thanks for the reply. I actually stumbled upon the same bug report late 
yesterday, but you beat me in replying to the list. You are correct, 
it's a known limitation (not to say bug). The bug report does describe 
the fsolve routine as non reentrable. One solution that's proposed is to 
rewrite the code in C, although one would lose connection to the 
original fortran code. Maybe it's time for me to finally jump in and 
start contributing properly to an open source project. I could see about 
fixing this problem.

Funny enough, in the course of trying to solve this problem, I tried 
octave and the same behaviour is exhibited. Now, I'm wondering if matlab 
will exhibit the same behaviour as well, but I don't have a working copy 
on hand to test.

Charles


Michaël Baudin wrote:
> Dear Sir,
> 
> I think that I understand the problem.
> The bug is similar to the bug 1657:
> http://bugzilla.scilab.org/show_bug.cgi?id=1657
> where the ode function shows its limits.
> The call tree is :
> 
> test > fsolve > f3 > fsolve > f2
> 
> This has a clear meaning and is correct.
> But fsolve has the same limitation as ode: even if the computation
> makes perfect sense, it cannot be done because of a limitation
> of Scilab's interpreter and, may be, a limitation of the fsolve routine 
> itself.
> In the body of f3, we cannot call fsolve because it is
> already in the call stack. This error is generated at the interpreter
> level. The reason behind the generation of this error is not clear:
> it might be a limitation of the interpreter, or a limitation of the fsolve
> routine itself, which may use static variables.
> You should create a bug report so that we can check that
> the bug is fixed in Scilab v6.
> 
> Best regards,
> 
> Michaël Baudin
>  
> Charles Basenga Kiyanda a écrit :
>> I need to use the fsolve command within itself (obviously with a 
>> different residual function) and scilab keeps returning error 22, 
>> recursion problems. There actually is no recursion problem as I can 
>> use the second call of fsolve on its won and the correct solution is 
>> returned. I'm thinking the algorithm which detects recursion problems 
>> is returning a false positive. I'm using scilab version 5.1.1 on 
>> linux. Is this a problem which was addressed in the 5.2 line?
>>
>> I'm including a sample script which reproduces the problem.
>>
>> Thanks,
>>
>> Charles
> 
> 



More information about the users mailing list