Advertisement
Guest User

Untitled

a guest
Nov 24th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.88 KB | None | 0 0
  1. def calcularSoakingYTSoaking(funcion, funcionDeEuler,temp1,temp2):
  2.     t = 0 # el tiempo
  3.     un = TO
  4.     datos = []# lista
  5.     tiempoYTemperatura = (t, un)  # hago una tupla con el tiempo y la temperatura en ese tiempo
  6.     datos.append(tiempoYTemperatura)#le agrego el primer elemento
  7.  
  8.     while  t != 1250:
  9.         t += CAD
  10.         un = funcion(un, CAD, funcionDeEuler,temp1,temp2,t)
  11.         datos.append((t,un))
  12.  
  13.     cantidadDeDatos = len(datos)
  14.     cantidadDeDatos -= 1 #voy a la ultima posición de la lista
  15.     tf,uf = datos[cantidadDeDatos]
  16.     cantidadDeDatos -= 1
  17.  
  18.     while cantidadDeDatos >=0:
  19.         ts,us = datos[cantidadDeDatos]
  20.         dif = round(uf - us) #busco el que este a -10 grados
  21.         if dif <=11+1 and dif >= 9-1 : #tolerancia de la temperatura
  22.             ts = tf - ts
  23.             us = (uf+us)/2
  24.             return (ts,us)
  25.         cantidadDeDatos -= 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement