[SciPy-User] Maximum Lyapunov exponent of my previous system

Barrett B barrett.n.b at gmail.com
Sat Jul 19 19:19:11 EDT 2014


Lou Pecora <lou_boog2000 <at> yahoo.com> writes:

> 
> 
> One mistake in my pseudo code:
> 
> The line,
> 
> 
> 		dx= NP.RN.random_sample((n,))/sqrt(n)  # Make random unit vector
> 
> should be replaced with,
> 
> 
> 
> 		temp= NP.RN.random_sample((n,))  # Make random unit vector
> 
> 		templen= sqrt(dot(temp,temp))
> 
> 		dx= temp/templen
> 
> Sorry.
> 

Thanks, Lou. Can I double-check to make sure I've got the tabs in the
correct places? (comments removed from this code)

def LypExp_calc(vics, n, T, NT):
    lnsum= 0.0   
    x= vics  
    for i in xrange(NT):
        temp= NP.RN.random_sample((n,))
        templen= sqrt(dot(temp,temp))
        dx= temp/templen
        y=NP.concatenate([x,dx])
    yT= YourODEintegrator(y,T, vecf)
    dxT= yT[n:2*n] 
    lnsum += log(lendx)
    x= yT[:n]
    LypExp= lnsum/(NT*T)
    return LypExp

def vecf(y):
    n=3
    x= y[:n]
    dx= y[n:2*n]
    vf= F(x)
    Dvf= NP.dot(DF(x),dx)
    return NP.concatenate([vf, Dvf])




More information about the SciPy-User mailing list