0% found this document useful (0 votes)
3 views

Programa Python

This document is a Python script that simulates temperature changes over a specified time interval based on an initial temperature input by the user. It uses a loop to update eight temperature variables according to predefined formulas and prints their values at each time step. The simulation runs for a duration determined by the user's input time and a fixed time increment of 0.005 seconds.

Uploaded by

jerson6uni
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Programa Python

This document is a Python script that simulates temperature changes over a specified time interval based on an initial temperature input by the user. It uses a loop to update eight temperature variables according to predefined formulas and prints their values at each time step. The simulation runs for a duration determined by the user's input time and a fixed time increment of 0.005 seconds.

Uploaded by

jerson6uni
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

from math import *

T0=float(input('Ingrese temperatura inicial:'))


t=float(input('Ingrese el tiempo (segundos):'))

T1=T0
T2=T0
T3=T0
T4=T0
T5=T0
T6=T0
T7=T0
T8=T0

#intervalo de tiempo 0.005 segundos


Dt=0.005

tiempo=t/Dt+1

y=0
while (y!=tiempo):

print("\n#",y,"\nT1",round(T1,2),"\nT2",round(T2,2),"\nT3",round(T3,2),"\nT4",ro
und(T4,2),"\nT5",round(T5,2),"\nT6",round(T6,2),"\nT7",round(T7,2),"\nT8",round(
T8,2))
y = y + 1
T1 = 0.99406*T1 + 2.857E-3*(T2+T5+28)
T2 = 0.99417*T2 + 1.429E-3*(T1+T3+2*T6+28)
T3 = 0.99417*T3 + 1.429E-3*(T2+T4+2*T7+28)
T4 = 0.99406*T4 + 2.857E-3*(T3+T8+28)
T5 = 0.98834*T5 + 2.857E-3*(T1+2*T6+128)
T6 = 0.99429*T6 + 1.429E-3*(T2+T5+T7+100)
T7 = 0.99429*T7 + 1.429E-3*(T3+T6+T8+100)
T8 = 0.98834*T8 + 2.857E-3*(T4+2*T7+128)

print("\nFin")

You might also like