DerApproximator

DerApproximator
  • Downloads: 167
  • Requirements:
  • Size:
  • Licence:
  • Version: 0.502
  • 2013-28-07
  • Publisher Site:



DerApproximator

Share

DerApproximator is a Python library for finite-differences derivatives approximation.Example:from DerApproximator import *print get_d1(lambda x: (x**2).sum(), [1,2,3])print get_d1(lambda x: x**2, [1,2,3])Expected output: [ 1.99999993 3.99999998 5.99999996][[ 2. 0. 0. ][ 0. 3.99999996 0. ][ 0. 0. 5.99999996]] * check_d1 checks user-provided routing for obtaining 1st derivatives of a functionExample:from numpy import *from DerApproximator import *func = lambda x: (x**4).sum()func_d = lambda x: 40 * x**3x = arange(1.0, 6.0)r = check_d1(func, func_d, x)func = lambda x: x**4func_d = lambda x: 40 * diag(x**3)x = arange(1.0, 6.0)r = check_d1(func, func_d, x)Expected output:func num user-supplied numerical RD0 +4.000e+01 +4.000e+00 31 +3.200e+02 +3.200e+01 32 +1.080e+03 +1.080e+02 33 +2.560e+03 +2.560e+02 34 +5.000e+03 +5.000e+02 3max(abs(d_user - d_numerical)) = 4499.9999861(is registered
DerApproximator is a Python library for finite-differences derivatives approximation.Example:from DerApproximator import *print get_d1(lambda x: (x**2).sum(), [1,2,3])print get_d1(lambda x: x**2, [1,2,3])Expected output: [ 1.99999993 3.99999998 5.99999996][[ 2. 0. 0. ][ 0. 3.99999996 0. ][ 0. 0. 5.99999996]] * check_d1 checks user-provided routing for obtaining 1st derivatives of a functionExample:from numpy import *from DerApproximator import *func = lambda x: (x**4).sum()func_d = lambda x: 40 * x**3x = arange(1.0, 6.0)r = check_d1(func, func_d, x)func = lambda x: x**4func_d = lambda x: 40 * diag(x**3)x = arange(1.0, 6.0)r = check_d1(func, func_d, x)Expected output:func num user-supplied numerical RD0 +4.000e+01 +4.000e+00 31 +3.200e+02 +3.200e+01 32 +1.080e+03 +1.080e+02 33 +2.560e+03 +2.560e+02 34 +5.000e+03 +5.000e+02 3max(abs(d_user - d_numerical)) = 4499.9999861(is registered  . you can free download DerApproximator now.
Soft85 only provide legal software, please help us keeping pur site legal, if you think this page is violating copyrights please let us know by clicking here Here

DerApproximator sources and versions








comments powered by Disqus

Download DerApproximator _FREE_