I am currently trying to solve an equation for T but unfortunately I am unable to get a solution due to the program running for too long. Is there a way to speed up the time taken to solve the equation?
Code:
Psat_scale = 101325/760
Zi, a, b, c, T, P, VF = symbols('Zi a b c T P VF')
Ki = (exp(a-(b/(T+c)))*Psat_scale)/P
RR = 0
# Costants
P_val = 1
z_vals = [0.4, 0.6]
a_vals = [15.9008, 16.0963]
b_vals = [2788.51, 3346.65]
c_vals = [-52.36, -57.84]
# Part 2
for i in range(2):
Ki_val = Ki.subs(a, a_vals[i]).subs(b, b_vals[i]).subs(c, c_vals[i]).subs(P, P_val)
temp_RR_numerator = z_vals[i]*(Ki_val-1)
temp_RR_denominator = 1+(Ki_val-1)*0
RR += (temp_RR_numerator/temp_RR_denominator)
RR_equ = Eq(RR, 0)
print(solve(RR_equ, T, simplify=True))