actualizacion del generador

This commit is contained in:
Oscar Suescun Elizalde 2025-03-27 14:54:06 +01:00
parent 62cf1655d1
commit c3c8c431a9

View File

@ -15,7 +15,7 @@ def valores_objetivo(archivo, material):
def generar_curva(offset, ruta):
muVacio = 4 * np.pi * 1e-7
h = np.arange(0,30000,1000)
h = np.arange(1,30000,1000)
b = muVacio * h + offset
with open(ruta, "w") as f:
@ -31,8 +31,10 @@ def generar_curva(offset, ruta):
f.write('PoissonsRatio=0\n')
f.write('YoungsCoefficient=0\n')
f.write('YieldStress=0\n')
f.write(f'BValue[0]=0\n')
f.write(f'HValue[0]=0\n')
for i in np.arange(len(h)):
for i in np.arange(1,len(h)):
f.write(f'BValue[{i}]={b[i]}\n')
f.write(f'HValue[{i}]={h[i]}\n')
@ -79,29 +81,29 @@ if __name__ == '__main__':
nombre = "PLACond.mdb"
ruta = f'{directorio}{nombre}'
offset = 0
generar_curva(1,ruta)
offset = 0
B = 1e-2
BObjetivo = 2e-2
# B = 1e-2
# BObjetivo = 2e-2
errorObjetivo = 0.01
# errorObjetivo = 0.01
flag = False
# flag = False
while flag == False:
os.system('cls')
# while flag == False:
# os.system('cls')
B = B + offset
# B = B + offset
error = B/BObjetivo
# error = B/BObjetivo
print(B)
print(error)
# print(B)
# print(error)
flag, offset = logica_offset(offset, error, errorObjetivo)
# flag, offset = logica_offset(offset, error, errorObjetivo)