Esempio n. 1
0
def imagenNR(LFn, Lx):
    tparse = Parse()
    LFxn = []
    for i in range(len(LFn)):
        tparse.setEc(LFn[i])
        tparse.addVarFromList(Lx)
        LFxn.append(tparse.evaluate())
    return LFxn
Esempio n. 2
0
def jacobiana(LFn, Lx, err):
    tparse = Parse()
    Jmatrix = []
    h = err / 10
    TLx = []
    for i in range(len(LFn)):
        mTemp = []
        for j in range(len(Lx)):
            TLx = list(Lx)
            TLx[j] = Lx[j] + h
            tparse.setEc(LFn[i])
            tparse.addVarFromList(TLx)
            rH = tparse.evaluate()
            TLx = list(Lx)
            TLx[j] = Lx[j] - h
            tparse.addVarFromList(TLx)
            r_H = tparse.evaluate()
            DR = (rH - r_H) / (2 * (h * 100))
            mTemp.append(DR)
        Jmatrix.append(mTemp)

    result = Jmatrix
    return result