I was wondering if anyone can help me with this question, this is the third part to the last question I had posted. Im not sure if my numbers are correct. we are trying to find the temperature of dough after being in the oven for 15 minutes. There are some pictures I inserted that include equations and values that are needed to complete this.
here is the following code and graph generated for this part
Here is the part we are trying to solve
this is the code I made:
R = 0.05 k = 12.84e-7 dx = 0.01 dt = 1.0 T = 305 * np.ones(int(R/dx) + 1)alpha = kpre_lam = k*dt/dx**2for t in range(1, int(900/dt) + 1): T_new = T.copy() for i in range(1, len(T)-1): T_new[i] = T[i] + pre_lam * (T[i+1] - 2*T[i] + T[i-1]) T_new[0] = T_new[1] T_new[-1] = 473.15 T = T_newnumerator = np.trapz([T[r_index] * r**2 for r_index, r in enumerate(np.linspace(0, R, len(T)))], np.linspace(0, R, len(T)))denominator = np.trapz([r**2 for r in np.linspace(0, R, len(T))], np.linspace(0, R, len(T)))T_avg = numerator / denominatorT_avg`
I got the ave temp to be 453.70843496841735
I am not sure if my code was done correctly, since I am using loops with numpy which isn't the best- can someone let me know if there is a more efficient way of getting this answeralso- and can someone please let me know how I can paste pictures on here properly.