Нужно построить график для уравнения на скрине при разных значениях t,
Код выглядит следующим образом:
import matplotlib.pyplot as plt
from scipy import integrate
import scipy
P0=1
L1=-4
L=1
L2=4
d=0.01
x=np.arange(L1,L2,d)
E=1
t_1=0.1
t_2=0.5
t_3=1
t_4=2
a=1
u=1
def make_T(t):
Fo=a*t/(L*L)
k=u*L/(2*a)
def f(x):
return scipy.special.erfc((1-2*k*Fo*(1-x)/(2*np.sqrt(Fo*(1-x)))-scipy.special.erfc(k*np.sqrt(Fo*(1-x)))))
v, err = integrate.quad(f, 0, 1)
Txt = k*Fo*v
T_otnos = Txt/(P0*E)
return(T_otnos)
Txt_1=make_T(t_1)
Txt_2=make_T(t_2)
Txt_3=make_T(t_3)
Txt_4=make_T(t_4)
fig, ax = plt.subplots()
ax.plot(x, Txt_1, label = 'u*t ='+str(t_1))
ax.plot(x, Txt_2, label = 'u*t ='+str(t_2))
ax.plot(x, Txt_3, label = 'u*t='+str(t_3))
ax.plot(x, Txt_4, label = 'u*t ='+str(t_4))
ax.set(xlabel='x', ylabel='dT/(E*dP)',
title='dT/(E*dP)')
ax.grid()
legend = ax.legend()
plt.show()
На выходе эта ошибка: ValueError: x and y must have same first dimension, but have shapes (800,) and (1,). В чем может заключаться проблема?