Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def calcularSoakingYTSoaking(funcion, funcionDeEuler,temp1,temp2):
- t = 0 # el tiempo
- un = TO
- datos = []# lista
- tiempoYTemperatura = (t, un) # hago una tupla con el tiempo y la temperatura en ese tiempo
- datos.append(tiempoYTemperatura)#le agrego el primer elemento
- while t != 1250:
- t += CAD
- un = funcion(un, CAD, funcionDeEuler,temp1,temp2,t)
- datos.append((t,un))
- cantidadDeDatos = len(datos)
- cantidadDeDatos -= 1 #voy a la ultima posición de la lista
- tf,uf = datos[cantidadDeDatos]
- cantidadDeDatos -= 1
- while cantidadDeDatos >=0:
- ts,us = datos[cantidadDeDatos]
- dif = round(uf - us) #busco el que este a -10 grados
- if dif <=11+1 and dif >= 9-1 : #tolerancia de la temperatura
- ts = tf - ts
- us = (uf+us)/2
- return (ts,us)
- cantidadDeDatos -= 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement