### This script uses the equivalent weight of the binder, curative, and castor oil ### to calculate the fractions of HTPB and curative, given the sum of HTPB/curative ### and fraction of castor oil import numpy as np #inputs, example numbers given EW_curative = 178 EW_HTPB = 1234.6 EW_castor_oil = 164 frac_HTPB_curative = .1428 frac_castor = .003 #calculation - solving linear equation inputs = np.array([EW_curative, EW_HTPB, EW_castor_oil, frac_HTPB_curative, frac_castor]) W_c = (((inputs[0]*inputs[3])/inputs[1]) + ((inputs[0]*inputs[4])/inputs[2]))/(1 + inputs[0]/inputs[1]) #outputs print('Fraction curative:', round(W_c, 5)) print('Fraction HTPB:', round(inputs[3]-W_c, 5)) print('Fraction HTPB + Curative:',inputs[3])