Post Reply 
Numerical integration vs. integrals that are zero
03-06-2019, 05:27 PM
Post: #11
RE: Numerical integration vs. integrals that are zero
(03-06-2019 02:19 PM)Thomas Klemm Wrote:  Cf. About the Algorithm

Noticed a typo, transformed integral involve 2 substitutions, not 1:

x = (b-a)/2 * v + (b+a)/2, to transform integration range from [a,b]  to [-1,1]
v = 3u/2 - u³/2, nonlinear transformed, integration range from [-1,1] to (-1, 1)

PHP Code:
def nonlinear(fab):
    
c= (b-a)/4, (b+a)/2
    def t
(uk=3.*c):
        
eps 1.0 u*u      # return 0 if eps=0
        
return eps and k*eps f(c*u*(eps 2.) + d)
    return 


With nonlinear defined, integrate(f, a, b) = integrate(nonlinear(f, a, b), -1, 1)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Numerical integration vs. integrals that are zero - Albert Chan - 03-06-2019 05:27 PM



User(s) browsing this thread: 1 Guest(s)