Project

General

Profile

Gamma.py

Funçao para cálculo de Gamma e G(p) - Gabriel José Negrelli Gomes, 12/27/2017 07:53 PM

Download (443 Bytes)

 
1
# -*- coding: utf-8 -*-
2
"""
3
Created on Mon Mar 27 12:50:23 2017
4
Gamma function and dJ/dp
5
University of Sao Paulo
6
@author: Gabriel
7
"""
8

    
9
def Gamma(A,B,C):
10
    
11
    from numpy import *
12
    
13
    gamma = zeros((A.shape[2],A.shape[2]))
14
    dJdp = 0
15
    line = 0
16

    
17
    for i in A:
18
        gamma += dot(i.T[:,1:],i[1:,:])
19
        dJdp += dot(i.T[:,1:],array([(B-C)[line,1:]]).T)
20
        line += 1
21
            
22
    return gamma,dJdp