View Issue Details

IDProjectCategoryView StatusLast Update
0000506ascendpygtk guipublic2013-02-26 13:42
Assigned Tojohn 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionno change required 
PlatformLinuxOSUbuntuOS Version9.04
Product Version0.9.7 
Target Version0.9.9Fixed in Version 
Summary0000506: Divide by Zero error even when the divisor is non-zero
DescriptionWhen ASCEND loads a model in the PyGTK GUI and it is solved, Although the model is solved correctly, But the Errors/Warnings window displays 'Divide by zero in 1/x expr .....' error message if the model involves 1/(a-b) sort of equations. This happens even when (a-b) != 0.
TagsNo tags attached.




2011-04-09 02:18

reporter   ~0000716

This is actually a false warning which is generated by the safe_rec() method of ascend/compiler/safe.c file :

double safe_rec(double x,enum safe_err *safe)
   if( x == 0.0 ) {
      double bogus = BIGNUM;
      if( safe_print_errors ) {
     ERROR_REPORTER_NOLINE(ASC_USER_ERROR,"Divide by zero in 1/x expr: returning %g",bogus);
      *safe = safe_div_by_zero;
      return( bogus );
   return( 1.0/x );


2011-04-09 13:27

administrator   ~0000719

Not sure why you think the above code results in divided-by-zero error messages even when (a-b)!=0.

FWIW the errors arise during the iterative solution process, so values can be tried that are different from the initial values of the variables in many cases.


2011-04-12 09:46

administrator   ~0000733

This is not a bug: the code works as expected. If you can provide a better example, please do so and we will re-open the bug.

Issue History

Date Modified Username Field Change
2011-04-09 01:50 ujjavalverma10 New Issue
2011-04-09 02:18 ujjavalverma10 Note Added: 0000716
2011-04-09 13:27 john Note Added: 0000719
2011-04-12 09:46 john Note Added: 0000733
2011-04-12 09:46 john Status new => resolved
2011-04-12 09:46 john Resolution open => no change required
2011-04-12 09:46 john Assigned To => john
2013-02-26 13:42 john Target Version => 0.9.9