我想绘制优化进度。我在SLSQP方法中使用scipy.optimize.minimize函数。 使用相同功能的6个约束条件,我想绘制这些条件的进度。 下面显示的代码已简化。
def pre_objective(x):
A=0.5*(W_UPR+W_LWR)*H-2*Ak
return A
def pre_constraint(x,al,exc):
sV=math.sqrt((abs(sN)+abs(sB))**2+3*(sS**2))
global result_sV
result_SV.append(sV)
return sV-Rp
#this is implemented 6 times with different bounds and arguments for the constraint function
pre_optimize_01=minimize(fun=pre_objective,
x0=x_init,
method='SLSQP',
bounds=BOUNDS_01,
constraints=pre_constraint1,
options={'maxiter': 1000, 'ftol': 1e-4, 'iprint': 1, 'disp': True,
'eps': 1.4901161193847656e-08})
我想在6个不同的图中用x轴上的迭代次数和y轴上的sV来显示约束的进度。
您能帮我实现吗?