예제 #1
0
def simular(clicks):
    v = vector_final_imaginario(clicks)
    v = cal_complejos.transpuestaMatriz(v)
    a = [cal_complejos.modulo(v[0][i]) for i in range(len(v[0]))]
    x1 = [i for i in range(len(a))]
    plt.bar(x1,a, label = 'probabilidad', width = 0.5, color = 'blue')
    plt.ylabel('probabilidad')
    plt.title('Evolucion del sistema '+str(clicks)+' clicks')
    plt.legend()
    plt.savefig("simulacion.png")
예제 #2
0
def prob_pos_h(v, x):
    return cal.modulo(v[x])**2 / cal.normaVectorial(v)**2
예제 #3
0
def prob_pos_v(v, x):
    return cal.modulo(v[x][0])**2 / cal.normaVectorial(
        cal.traspuestaVector_v(v))**2
예제 #4
0
    def testModulo(self):
        a = (12, 11)
        self.assertEqual(cal_complejos.modulo(a), 16.278820596099706)

        self.assertFalse(cal_complejos.modulo(a) == 26)
예제 #5
0
def prob_pos(v, p):
    r1 = cal.modulo(v[p])**2
    r2 = cal.normaVectorial(v)**2
    return r1 / r2