Solver in excel is more efficient like PuLP Solver, or I made some mistake. Please can you help me?
Python PuLP (Not correct results):
from pulp import *
p = (120, 72, 80)
o = (0.85, 0.85, 0.80)
lp= LpProblem("Linka1_2_3", LpMaximize)
print("OBJECTIVE1: ",lp.objective)
x1 = LpVariable(name="Time:Line1Ref1",lowBound=0)
x2 = LpVariable(name='Time:Line2Ref1',lowBound=0)
print("Constrains: ",lp.constraints)
# Objective function
lp += lpSum(102*x1 + 61.2*x2)
# Constrains
lp += 102*x1 <= 500
lp += 61.2 *x2 <=500
lp += 102*x1 + 61.2*x2 <=500
lp += x1 <= 3.5
lp += x2 <= 3.5
status = lp.solve()
print("Status:", status, " ---1:optimal, 2:not solved, 3:infeasible, 4:unbounded, 5:undef")
#Print solution
i=0
for var in lp.variables():
print(f" ",var, "=", value(var), "Tzn. ",((p[i]*o[i]))," PxO a cas straveny", value(var)*(p[i]*o[i])," pcs")
i += 1
print("OPT =", value(lp.objective))
Result:
Time:Line1Ref1 = 2.8019608 Tzn. 102.0 PxO a cas straveny 285.8000016 pcs
Time:Line2Ref1 = 3.5 Tzn. 61.199999999999996 PxO a cas straveny 214.2 pcs
Time X1 + X2 = 6.3019....
Correct result should be: 5.836601 like in Excel (6.3 is too high & not correct solution)
Where in code I have fault?



Your problem is under-determined, so there are multiple solutions that produce the optimal value of 500 right at its bound. PuLP is more than capable of producing such a solution. More importantly, though, you've mis-constructed your problem, and need to replace your constraints and objective based on what it is you really want.