[英]Solving a Combustion Chemical Equation for Product Molar Values using 10 different values for equivalence ratio (Phi)
我正在嘗試使用 Cantera 來解決一些熱力學問題。 我無法得到這個函數來解決 b1、c1、d1 和 e1 作為 phi_rich 的函數。 基本上我需要在 Phi_rich 的每個值處找到這些值。 我的功能將不起作用。
這是我的代碼:
import numpy as np
phi_rich = phi[10:20] # Pulls final 10 values of phi array
b1 = np.zeros(phi_rich.shape)
c1 = np.zeros(phi_rich.shape)
d1 = np.zeros(phi_rich.shape)
e1 = np.zeros(phi_rich.shape)
def func(b1,c1,d1,e1):
## Now Calculate Fuel Rich
phi_rich = phi[10:20]
x = 3
y = 8
a_rich =((x+(y/4))/phi_rich)
return[ (c1 + d1 - 2*a_rich)/2, 3 - b1, 4 - e1, x + (y/2) - b1 - c1 - d1]
result = optimize.fsolve(func,(0.1, 0.1, 0.1, 0.1))
我包括這個來幫助解釋我的問題。 我正在嘗試使用 Phi 值數組(准確地說是 10)設置一個 python 函數來解決每個值(a、b、c、d 和 e):
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.