I am trying to use Cantera to solve some thermodynamics problems. I cannot get this function to solve for b1, c1, d1, and e1 as functions of phi_rich. Basically I need to find these values at each value of Phi_rich. My function will not work.
Here is my code:
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))
I included this to help explain my problem. I am trying to set up a python function to solve for each of these values (a,b,c,d, and e) using an array of Phi values (10 to be exact):