Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only

results(x&fval&sol) from Cplex class

  • 1.  results(x&fval&sol) from Cplex class

    Posted 12/24/11 06:18 PM

    Originally posted by: PingLiu


    I run the enr.lp in command window
    
    cplex>read enr.lp cplex>mipopt  enr.lp cplex>write filename:enrsol filetype:sol
    


    and also run the following code in matlab
    
    cplex=Cplex(
    'enr'); cplex.readModel(
    'enr.lp'); cplex.solve(); x = cplex.Solution.x; fval= cplex.Solution.objval;
    


    I have several questions after comparing the results.
    from the enrsol.sol file, we can see the index of x is not the same as that of variables.
    for example, x(3) is the value of variable 'x13', not 'x3'.
    How can I get the index of variables in x matrix after running the code 'cplex.Solution.x' in matlab?

    how can I write .sol file in class CPLEX through the interface of matlab?

    why is the value of fval (145.4616) got in matlab different from the objective one(145.459503720117) got from cmd command?

    thanks a lot.
    #CPLEXOptimizers
    #DecisionOptimization