diff --git a/genCurvas.py b/genCurvas.py index 8008356..01494e9 100644 --- a/genCurvas.py +++ b/genCurvas.py @@ -2,8 +2,14 @@ import numpy as np import pandas as pd import json -def valores_objetivo(): - pass +def valores_objetivo(archivo, material): + carga = pd.read_excel(archivo, sheet_name='carga', engine='openpyxl').dropna() + + E = np.mean(carga.loc[carga['material'] == material, ['V1', 'V2']].values, axis=1) + I = np.mean(carga.loc[carga['material'] == material, ['I1', 'I2']].values, axis=1) + f = np.array(carga['f'][carga['material'] == material]) + + return E, I, f def generar_curva(offset): muVacio = 4 * np.pi * 1e-7 @@ -25,13 +31,8 @@ if __name__ == '__main__': archivo = 'Ensayos.xlsx' material = 'PLACOND' - masIter = 10000 - carga = pd.read_excel(archivo, sheet_name='carga', engine='openpyxl').dropna() - - Eobjetivo = np.mean(carga.loc[carga['material'] == material, ['V1', 'V2']].values, axis=1) - Iobjetivo = np.mean(carga.loc[carga['material'] == material, ['I1', 'I2']].values, axis=1) - fObjetivo = np.array(carga['f'][carga['material'] == material]) + Eobjetivo, Iobjetivo, fObjetivo = valores_objetivo(archivo, material) errorObjetivo = 0.01 # +- cuanto % puede haber de diferencia errorCVobjetivo = 1