Back to Forum | View unanswered posts | View active topics
Topic review - Problem with ActionIsProper (by jaradat and drueda) |
Author |
Message |
|
|
Post subject: |
Re: Problem with ActionIsProper (by jaradat and drueda) |
|
|
You are right. We called that variable cc (for counter) at first but we thought auxv (auxiliary variable) would be more "mnemonic" so we renamed it but missed one instance. Thank you.
You are right. We called that variable cc (for counter) at first but we thought auxv (auxiliary variable) would be more "mnemonic" so we renamed it but missed one instance. Thank you.
|
|
|
|
Posted: Thu Apr 29, 2010 7:37 pm |
|
|
|
|
|
Post subject: |
Re: Problem with ActionIsProper (by jaradat and drueda) |
|
|
Thanks for the bug report!
I have fixed this by the following code which is a bit different from your suggestion. (Your code mentions a variable 'cc' which should also be 'auxv', I suppose.) This is going to be in the next minor release.
... int auxv;
//computes the exp(@t*m)(var(i)) for all i for(i=1;i<=nvars(basering)-1;i++) { inv=var(i); delta=derivate(@m,inv); j=1; auxv=1; tee=@t; while(delta!=0) { inv=inv+1/j*delta*tee; auxv=auxv+1; j=j*auxv; tee=tee*@t; delta=derivate(@m,delta); } id=id+ideal(inv); } ...
Regards, Frank
Thanks for the bug report!
I have fixed this by the following code which is a bit different from your suggestion. (Your code mentions a variable 'cc' which should also be 'auxv', I suppose.) This is going to be in the next minor release.
... int auxv;
//computes the exp(@t*m)(var(i)) for all i for(i=1;i<=nvars(basering)-1;i++) { inv=var(i); delta=derivate(@m,inv); j=1; auxv=1; tee=@t; while(delta!=0) { inv=inv+1/j*delta*tee; auxv=auxv+1; j=j*auxv; tee=tee*@t; delta=derivate(@m,delta); } id=id+ideal(inv); } ...
Regards, Frank
|
|
|
|
Posted: Thu Apr 29, 2010 1:35 pm |
|
|
|
|
|
Post subject: |
Problem with ActionIsProper (by jaradat and drueda) |
|
|
Using the procedure actionIsProper of the library ainvar.lib of Singular, we (jaradat and drueda) identified a problem: during the computation of the exponential, the formula for the calculation of the denominator works correctly only for the first three terms (iterations). Here it is the code:
/////////////////////////////////////////////////////////////////////////// proc actionIsProper(matrix m) . . . { poly inv,delta,tee,j; ideal id=imap(bsr,id); matrix @m[size(id)+1][1]; @m=imap(bsr,m),0;
//computes the exp(@t*m)(var(i)) for all i for(i=1;i<=nvars(basering)-1;i++) { inv=var(i); delta=derivate(@m,inv); j=1; tee=@t; while(delta!=0) { inv=inv+1/j*delta*tee; j=j*(j+1); ////Problem Line (denominator) tee=tee*@t; delta=derivate(@m,delta); } id=id+ideal(inv); } . . . ///////////////////////////////////////////////////////////////////////////
One way to fix it is by introducing a new variable (auxv) as seen in the following modified version of your code:
/////////////////////////////////////////////////////////////////////////// proc actionIsProper(matrix m) . . . { . . . @m=imap(bsr,m),0; int auxv; ///Added this line (1 of 3) to replace the line j=j+1 //computes the exp(@t*m)(var(i)) for all i for(i=1;i<=nvars(basering)-1;i++) { inv=var(i); delta=derivate(@m,inv); j=1; auxv=0; ///Added this line (2 of 3) to replace j=j+1 tee=@t; while(delta!=0) { cc=cc+1; inv=inv+1/j*delta*tee; j=j*(auxv+1); ///Added this line (3 of 3) to replace j=j+1 below /// j=j+1 ///Commented this line (1/1). tee=tee*@t; delta=derivate(@m,delta); } id=id+ideal(inv); } i=inSubring(@t,id)[1]; setring(bsr); return(i); }
///////////////////////////////////////////////////////////////////////////
We are not sure if this "bug" has already been reported.
Best regards, jaradat, drueda
Using the procedure actionIsProper of the library ainvar.lib of Singular, we (jaradat and drueda) identified a problem: during the computation of the exponential, the formula for the calculation of the denominator works correctly only for the first three terms (iterations). Here it is the code:
/////////////////////////////////////////////////////////////////////////// proc actionIsProper(matrix m) . . . { poly inv,delta,tee,j; ideal id=imap(bsr,id); matrix @m[size(id)+1][1]; @m=imap(bsr,m),0;
//computes the exp(@t*m)(var(i)) for all i for(i=1;i<=nvars(basering)-1;i++) { inv=var(i); delta=derivate(@m,inv); j=1; tee=@t; while(delta!=0) { inv=inv+1/j*delta*tee; j=j*(j+1); [b]////Problem Line (denominator)[/b] tee=tee*@t; delta=derivate(@m,delta); } id=id+ideal(inv); } . . . ///////////////////////////////////////////////////////////////////////////
One way to fix it is by introducing a new variable (auxv) as seen in the following modified version of your code:
/////////////////////////////////////////////////////////////////////////// proc actionIsProper(matrix m) . . . { . . . @m=imap(bsr,m),0; int auxv; [b]///Added this line (1 of 3) to replace the line j=j+1[/b] //computes the exp(@t*m)(var(i)) for all i for(i=1;i<=nvars(basering)-1;i++) { inv=var(i); delta=derivate(@m,inv); j=1; auxv=0; [b]///Added this line (2 of 3) to replace j=j+1[/b] tee=@t; while(delta!=0) { cc=cc+1; inv=inv+1/j*delta*tee; j=j*(auxv+1); [b]///Added this line (3 of 3) to replace j=j+1[/b] below /// j=j+1 ///Commented this line (1/1). tee=tee*@t; delta=derivate(@m,delta); } id=id+ideal(inv); } i=inSubring(@t,id)[1]; setring(bsr); return(i); }
///////////////////////////////////////////////////////////////////////////
We are not sure if this "bug" has already been reported.
Best regards, jaradat, drueda
|
|
|
|
Posted: Wed Apr 28, 2010 6:22 pm |
|
|
|
|
|
It is currently Fri May 13, 2022 11:06 am
|
|