In [105]:
liT=[]
m=1
mmax=1
mpers=0.0
c=4185
dq=2000
q=0
Tini=20
T=Tini
sig=5.67e-8
for t in range(280):
    # add water
    if (m<mmax):
        m=m+mpers
    else:
        mpers=0
    # mix temperatures
    T=(T*c*(m-mpers)+Tini*c*mpers)/m/c
    # 
    dtemp=dq/m/c - sig*(T-20)**4 *0.01
    T=T+dtemp
    liT.append(T)
    if ( t % 20 ==0):
        print('t=',t,'sec; dT = ',dtemp, 'T=',T,'m=',m)
    if ( T>=100):
        print('t=',t,'sec; dT = ',dtemp, 'T=',T,'m=',m)
        break
t= 0 sec; dT =  0.4778972520908005 T= 20.477897252090802 m= 1
t= 20 sec; dT =  0.47789252016255496 T= 30.03582092132473 m= 1
t= 40 sec; dT =  0.47782154971663565 T= 39.593143202467914 m= 1
t= 60 sec; dT =  0.4775141988966611 T= 49.14694082100387 m= 1
t= 80 sec; dT =  0.47668824613363947 T= 58.68970682496618 m= 1
t= 100 sec; dT =  0.4749539916600158 T= 68.20714921745714 m= 1
t= 120 sec; dT =  0.47182571850976235 T= 77.676146799768 m= 1
t= 140 sec; dT =  0.46674446315535334 T= 87.06304524228844 m= 1
t= 160 sec; dT =  0.4591164807782781 T= 96.32256690089059 m= 1
t= 169 sec; dT =  0.45469810619281387 T= 100.43301020202186 m= 1
In [106]:
liTm=[]
m=0
mmax=1
mpers=0.02
c=4185
dq=2000
q=0
Tini=20
T=Tini
sig=5.67e-8
for t in range(280):
    # add water
    if (m<mmax):
        m=m+mpers
    else:
        mpers=0
    # mix temperatures
    T=(T*c*(m-mpers)+Tini*c*mpers)/m/c
    # 
    dtemp=dq/m/c - sig*(T-20)**4 *0.01
    T=T+dtemp
    liTm.append(T)
    if ( t % 20 ==0):
        print('t=',t,'sec; dT = ',dtemp, 'T=',T,'m=',m)
    if ( T>=100):
        print('t=',t,'sec; dT = ',dtemp, 'T=',T,'m=',m)
        break
t= 0 sec; dT =  23.894862604540023 T= 43.89486260454002 m= 0.02
t= 20 sec; dT =  1.1376985644894024 T= 43.89342210679046 m= 0.4200000000000001
t= 40 sec; dT =  0.5826341570895881 T= 43.891628811564765 m= 0.8200000000000004
t= 60 sec; dT =  0.4775143215188033 T= 49.144646269763946 m= 1.0000000000000004
t= 80 sec; dT =  0.4766885360168304 T= 58.68741632632058 m= 1.0000000000000004
t= 100 sec; dT =  0.4749545546158589 T= 68.20486718884294 m= 1.0000000000000004
t= 120 sec; dT =  0.47182668123137317 T= 77.67388000302022 m= 1.0000000000000004
t= 140 sec; dT =  0.46674596601836416 T= 87.06080313201579 m= 1.0000000000000004
t= 160 sec; dT =  0.4591186664420722 T= 96.32036178592037 m= 1.0000000000000004
t= 169 sec; dT =  0.4547006427272458 T= 100.4308264936212 m= 1.0000000000000004
In [107]:
import matplotlib.pyplot as plt
%matplotlib inline
plt.plot( liT )
plt.plot( liTm )
plt.show()
In [ ]:

In [ ]: