I want to plot solutions of an inequality by matplotlib so I need solution values in sth like an array. the inequality is F1(γ)>=0 for γ>1.11.
To do so first I create F1 function by sympy and then transform it by lambdify. my code is:
import sympy
from sympy import *
r, γ, W, c= symbols('r γ W c', positive=True, real=True)
D = 2*γ-c-sqrt((2*γ-c)**2-4*γ*(1+r)*(1-W))
EU_e = γ-D+D**2/(4*γ)
F = EU_e - (1+r)*W
F1 = F.subs([(W, 0.003), (c, 0.2), (r, 0.11)])
now F1 is a symbolic function of γ: click here
then I lambdify F1 and find the the nearest value of γ that applies to equality equation F1(γ)=0 for γ>1.11.
from scipy.optimize import minimize
import numpy as np
ff=lambdify(γ, F1)
bounds = ((1.11, None),)
x0 = np.array([1.3])
res = minimize(lambda x: np.linalg.norm(ff(x)), x0=x0, bounds=bounds)
It works for many values of parametres W,c,r but doesn`t work for some such as (W=0.003), (c= 0.2), (r= 0.11) i.e. I encounter the following error:
click here
and res is:
click here
Does anyone know how to find solution values of γ (or the nearest values) of the inequality equation?
I drawed solutions area by desmos.com. I`d like to plot sth like this by matplotlib: click here
Thank you

