Project

General

Profile

Classification.py

Funçao para classificaçao dos parametros em bom e mau comportados - Gabriel José Negrelli Gomes, 12/27/2017 07:53 PM

Download (1.61 KB)

 
1
# -*- coding: utf-8 -*-
2
"""
3
Created on Wed May 10 22:29:55 2017
4

5
@author: Gabriel
6
"""
7

    
8
def Classification(A):
9
    
10
    from scipy.linalg import qr as QRS
11
    from numpy import *
12
    
13
#    print A
14
    
15
    V, U = linalg.eig(A)
16
    Vnorm = sqrt(abs(amax(V)/V))
17
    
18
    """
19
    from numpy import *
20

21
    A = array([[144.9, 325.5],[325.5, 5298.1]])
22

23
    A = array([[373578.259736529, -75959.1753700779, 107886.540739222, -911851.666529192, -4372.36884977606, 9.70566096510859, -576.948411888186],
24
           [-75959.1753700779,15598.1583827228,-22258.4899241412,189047.624322781,902.590009048401,-2.85505513579881,117.788193401234],
25
           [107886.540739222,-22258.4899241412,33476.4122301726,-298238.386542411,-1392.16298076536,9.20059171036572,-163.477888321700],
26
           [-911851.666529192,189047.624322781,-298238.386542411,2772982.33892791,12640.1219891103,-183.135384780116,1348.89391477318],
27
           [-4372.36884977606,902.590009048401,-1392.16298076536,12640.1219891103,59.1562556682830,0.184217618636096,6.56962009773013],
28
           [9.70566096510859,-2.85505513579881,9.20059171036572,-183.135384780116,0.184217618636096,0.930258362200925,0],
29
           [-576.948411888186,117.788193401234,-163.477888321700,1348.89391477318,6.56962009773013,0,0.930258362200925]])
30
"""
31

    
32
    Up = empty(shape=[U.shape[0],0])
33
    
34
    print Vnorm
35

    
36
    for j in Vnorm:
37
        if j < 1000:
38
            Up = hstack((Up,U[:,where(Vnorm==j)].reshape((U.shape[0],-1))))
39
            print j, where(Vnorm==j)
40

    
41
    print "\nParameters Classification:\n"
42
    print QRS(Up.T, pivoting=True)[2] + 1
43
    print "\n"
44