Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Note: make a flow chart diagram in human language from this python code : import numpy as np from scipy.optimize import fsolve F = 80.0

Note: make a flow chart diagram in human language from this python code :

import numpy as np from scipy.optimize import fsolve F = 80.0 F_mf = np.array([0.15, 0.25, 0.40, 0.20]) D1_mf = np.array([0.06, 0.05, 0.50, 0.39]) B1_mf = np.array([0.13, 0.29, 0.30, 0.28]) D2_mf = np.array([0.15, 0.10, 0.55, 0.22]) B2_mf = np.array([0.24, 0.65, 0.10, 0.01]) D,B,D1,B1,D2,B2 = [10.0]*6 D_mf = np.array([0.1]*4) B_mf = np.array([0.1]*4) def mass_balance(x): D, B, D1, B1, D2, B2 = x[0:6] D_mf = np.array(x[6:10]) B_mf = np.array(x[10:15]) error_1 = 1 - sum(D_mf) error_2 = 1 - sum(B_mf) error_mf_1 = D *D_mf + B *B_mf - F*F_mf error_mf_2 = D1*D1_mf + B1*B1_mf - D*D_mf error_mf_3 = D2*D2_mf + B2*B2_mf - B*B_mf return np.append([error_1, error_2], [error_mf_1, error_mf_2, error_mf_3]) solution = fsolve(mass_balance, np.append([D, B, D1, B1, D2, B2],[D_mf, B_mf]))

D, B, D1, B1, D2, B2 = solution[0:6] D_mf = solution[6:10] B_mf = solution[10:15] class style: BOLD = '\033[1m' END = '\033[0m'

print(style.BOLD + 'Primary column' + style.END) print('stream D:') print('molar flow = %.2f mol/min' %D) print('xylene = %.2f' %D_mf[0]) print('styrene = %.2f' %D_mf[1]) print('toluene = %.2f' %D_mf[2]) print('benzene = %.2f' %D_mf[3]) print('') print('stream B:') print('molar flow = %.2f mol/min' %B) print('xylene = %.2f' %B_mf[0]) print('styrene = %.2f' %B_mf[1]) print('toluene = %.2f' %B_mf[2]) print('benzene = %.2f' %B_mf[3])

print('') print(style.BOLD + 'Distillate column' + style.END) print('stream D1:') print('molar flow = %.2f mol/min' %D1) print('xylene = %.2f' %D1_mf[0]) print('styrene = %.2f' %D1_mf[1]) print('toluene = %.2f' %D1_mf[2]) print('benzene = %.2f' %D1_mf[3]) print('') print('stream B1:') print('molar flow = %.2f mol/min' %B1) print('xylene = %.2f' %B1_mf[0]) print('styrene = %.2f' %B1_mf[1]) print('toluene = %.2f' %B1_mf[2]) print('benzene = %.2f' %B1_mf[3])

print('') print(style.BOLD + 'Bottoms column' + style.END) print('stream D2:') print('molar flow = %.2f mol/min' %D2) print('xylene = %.2f' %D2_mf[0]) print('styrene = %.2f' %D2_mf[1]) print('toluene = %.2f' %D2_mf[2]) print('benzene = %.2f' %D2_mf[3]) print('') print('stream B2:') print('molar flow = %.2f mol/min' %B2) print('xylene = %.2f' %B2_mf[0]) print('styrene = %.2f' %B2_mf[1]) print('toluene = %.2f' %B2_mf[2]) print('benzene = %.2f' %B2_mf[3])

Note: make a flow chart diagram in human language from this python code :

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions