Greetings:
I'm pretty new using Python and I was practicing with the following problem:
I wanted to graph the value of heat transfer through an aluminum plate (I tried to make it as simple as possible by simply practicing how to graph results in python).
import matplotlib.pyplot as plt
span_L = [] #Initialize span
span_Q = []
Q= []
Delta_T = 100 #Assuming delta T = 100 C
T_cond = (207 /100) #Aluminum thermal conductivity W/(cm K)
Area = 1 #Assuming Area is 1 cm^2
for lenght in range (100): #Loop that appends different values
span_L.append(float(lenght))
print("Lenght (L) in centimeters: ", span_L) #Shows the output of values
for span_L in range (1,101):
Q = (T_cond*Area*Delta_T/span_L)
span_Q.append(float(Q))
print(span_Q)
plt.plot(span_L,span_Q)
plt.title("Heat transfer for different thichkness values in an Al plate")
plt.xlabel("Lenght in cm")
plt.ylabel("Heat transfer in Watts [W]")
plt.show()
The problem I have is that I get the error: ValueError: x and y must have same first dimension
and when checking the length of both lists, both have the same length.