[Scilab-users] modifying a variable changes the value of another variable!!!

Rafael Guerra jrafaelbguerra at hotmail.com
Tue Jan 29 01:50:51 CET 2013


>From the code excerpt provided it is difficult to see from where errors of
magnitude~=1e-15 might come from.

Could they be due to some round-off errors in the function:
calc_D_superp_dobcel? Please check the function details.

Have you run the code with a "clear" at the beginning of the program to
clean all variables?

// Could you please define before your 3rd control system:
   superp0= superp;
// and after your 3rd control system:
   superp1= superp;
   printf("%i...delta(superp) = %e", control, max(abs(superp1-superp0)) )
// and tell us what values do you get? Do the errors of 1e-15 magnitude
occur and at which "control" iterations?


// Non related to your problem, herebelow are some suggestions, if you will,
to make your code more easy to read:

   //define additional variables to simplify the code:
   m = int(control/max_mov*20);
   N = length(sup_2);
   s = sum(superp);

   // write:
   while max(superp)>tol & control<=max_mov // moving "control=control+1" to
the end of the while loop


PS: "sumsupant"  // this variable is not defined in the code excerpt, looks
like =sum(superp)


Regards,
Rafael G.



--
View this message in context: http://mailinglists.scilab.org/modifying-a-variable-changes-the-value-of-another-variable-tp4025762p4025819.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the users mailing list