I work with sympy and I have three symbolic variables (y , p_s , p_h). I want to solve the equation in terms of p_s and p_h, solving y in terms of p_s and p_h. My code is as follows when I run it, give me an empty list output. I don't know what is wrong! Could you help me?!
Note: My parameters come from a class HH.
def s_r():
α , π , τ = hh.α , hh.π , hh.τ
y , p_s = sympy.symbols('y p_s')
return ((1-α)/p_s)*((y/(1+π))+τ)
def c_r():
α , π , τ = hh.α , hh.π , hh.τ
y = sympy.symbols('y')
return α*((y/(1+π))+τ)
def c0_o():
π , θ , h0 , τ = hh.π , hh.θ , hh.h0 , hh.τ
y , p_h = sympy.symbols('y p_h')
return (y/(1+π))-((p_h*θ*h0**2)/(1+π))+τ
def func():
α , h0 = hh.α , hh.h0
y , p_h , p_s = sympy.symbols('y p_h p_s')
expression1 = (((c_r()**α)*(s_r()**(1-α))) - ((c0_o()**α)*(h0**(1-α))))
lam1 = lambdify(y, expression1 , modules=['numpy'])
y00 = solve(lam1(y), y, dict = True)
return y00
func()
for more details, I want the "solve" to set equal to zero the "expression1" and give me an equation for y in terms of p_s and p_h.