As the title say, one variable is causing another to become zero for no apparent reason. Here is my code, shorted with a ton of print statements trying to figure out what's going on.
for i in range(1, number_of_layers):
a_nt[i] = 0.5 * ((dia / 2) ** 2) * (theta_t[i] - sin(theta_t[i]))
print("ant 1 ", a_nt[i])
I assign a value to a_nt and later decide how that value will be used in an if state to assign it to a_t. The code goes into the else portion.
else:
print("ant 2 ", a_nt[i])
a_t[i] = a_nt[i]
print("at 1 ", a_t[i])
y_t[i] = y_nt[i]
print("at 2 ", a_t[i])
theta_c[i] = 0
print("at 3 ", a_t[i])
Python prints out:
ant 1 0.005738905060148785
ant 2 0.005738905060148785
at 1 0.005738905060148785
at 2 0.005738905060148785
at 3 0
For a reason that I cannot determine, a_t becomes zero after I assign theta_c a value of zero. I'm relatively new to python, but this is driving me insane!