text_plain_output_1.png
from scipy.special import erfc

import matplotlib.pyplot as plt

import numpy as np

def Dirichlet1(T0, dT, t, x, alpha):
    T = T0 + dT * erfc(abs(x) / (2.0 * np.sqrt(alpha * t)))
    return T

T0 = 0.2
dT = 15.0
t1 = 10.0
t2 = 1000.0
xs = np.arange(0, 0.1, 0.001)
alpha_m = 9.19e-08
T = Dirichlet1(T0, dT, t1, xs, alpha_m)
T2 = Dirichlet1(T0, dT, t2, xs, alpha_m)

fig0, ax0 = plt.subplots(1)
fig0.set_size_inches((5, 5))
ax0.plot(xs, T, label='t=%.0f' % t1)
ax0.plot(xs, T2, label='t=%.0f' % t2)
ax0.set_xlim([min(xs), max(xs)])
ax0.set_xlabel('distancia (m)', fontsize=18)
ax0.set_ylabel('Temperature ($^\\circ$C)', fontsize=18)
ax0.grid(True)
ax0.legend()