Changeset 1118

Show
Ignore:
Timestamp:
07/12/08 05:17:19 (5 months ago)
Author:
dmitrey.kroshko
Message:

minor update in example docstring

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openopt/scikits/openopt/examples/checkDerivatives.py

    r1116 r1118  
    4949p.checkdh(x=myX, maxViolation=1e-4) 
    5050 
    51 Note: 
    52 RD is log10 of "relative difference" and is defined as int(ceil(log10( |info_user-info_numerical| / (|info_user|+|info_numerical+1e-15)))) 
    53  
    5451################################################################################# 
    5552Typical output (unfortunately, in terminal or other IDEs the blank space used in strings separation can have other lengths): 
     53Note that RD (relative difference) is defined as 
     54int(ceil(log10(abs(Diff) / maxViolation + 1e-150))) 
     55where 
     56Diff = 1 - (info_user+1e-150)/(info_numerical + 1e-150) 
    5657 
    5758OpenOpt checks user-supplied gradient df (shape: (30,) ) 
    58 according to: 
    59 prob.diffInt = [9.9999999999999995e-08] 
    60 lines with |info_user-info_numerical| / (|info_user|+|info_numerical+1e-15) greater than maxViolation = 0.01 will be shown 
     59according to prob.diffInt = [9.9999999999999995e-08] 
     60lines with 1 - info_user/info_numerical greater than maxViolation = 0.01 will be shown 
    6161df num         user-supplied     numerical               RD 
    62     0             +7.000e+00     -8.000e+00              2 
     62    0             +7.000e+00     -8.000e+00              3 
    6363    8             -2.291e+00     -1.029e+01              2 
    6464max(abs(df_user - df_numerical)) = 14.9999995251 
     
    6666======================== 
    6767OpenOpt checks user-supplied gradient dc (shape: (2, 30) ) 
    68 according to: 
    69 prob.diffInt = [9.9999999999999995e-08] 
    70 lines with |info_user-info_numerical| / (|info_user|+|info_numerical+1e-15) greater than maxViolation = 0.01 will be shown 
     68according to prob.diffInt = [9.9999999999999995e-08] 
     69lines with 1 - info_user/info_numerical greater than maxViolation = 0.01 will be shown 
    7170dc num   i,j:dc[i]/dx[j]   user-supplied     numerical               RD 
    72     32             1 / 2         +1.417e+01     -8.323e-01              2 
     71    32             1 / 2         +1.417e+01     -8.323e-01              4 
    7372max(abs(dc_user - dc_numerical)) = 14.9999999032 
    7473(is registered in dc number 32) 
    7574======================== 
    7675OpenOpt checks user-supplied gradient dh (shape: (2, 30) ) 
    77 according to: 
    78 prob.diffInt = [9.9999999999999995e-08] 
    79 lines with |info_user-info_numerical| / (|info_user|+|info_numerical+1e-15) greater than maxViolation = 0.01 will be shown 
     76according to prob.diffInt = [9.9999999999999995e-08] 
     77lines with 1 - info_user/info_numerical greater than maxViolation = 0.01 will be shown 
    8078dh num   i,j:dh[i]/dx[j]   user-supplied     numerical               RD 
    8179    58            1 / 28         -4.474e+01     -5.974e+01              2