###This script calculates the fractions of HTPB and curative to use, given a set sum of HTPB and ###curative, and a given fraction of castor oils import numpy as np #inputs EW_curative = 178 EW_HTPB = 1234.6 EW_castor_oil = 164 frac_HTPB_curative = .1428 frac_castor = .003 #calculation 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])