osemosys_global icon indicating copy to clipboard operation
osemosys_global copied to clipboard

Different results in CSV files when comparing GLPK outputs vs CBC/otoole

Open maartenbrinkerink opened this issue 4 years ago • 3 comments

I'll leave this to @trevorb1 to add information because i'm not going to act as if I have any clue what's going on:)

maartenbrinkerink avatar Oct 15 '21 19:10 maartenbrinkerink

The snakemake workflow solves through CBC and passes the results into otoole to generate the result csv files. There are some weird results in these csvs (such as capacity differences between NewCapacity, TotalCapacityAnnual, and AccumulatedNewCapacity). These differences are not seen if we process the model through GLPK, which generates the csvs automatically.

At first I thought it was me just inputting the arguments into otool wrong, but I stepped through our workflow using simplicity and everything worked fine. The otoole results matched GLPK results. So it seems to be something specific to our workflow.

trevorb1 avatar Oct 21 '21 06:10 trevorb1

Compare the raw result files before processing. Check if CBC and GLPK text file outputs are the same (no processing) to help narrow down the issue. Also, run the model through CPLEX to see check the solution quality. It may just be since all our parameter data are not yet populated, weird things are happening in the solve process that GLPK and CBC are handling differently.

trevorb1 avatar Oct 21 '21 15:10 trevorb1

Solution quality seems fine according to cplex (see below), as I am specifically looking at condition number (see page 150) and Ax-b residual. But I am still getting different solutions from GLPK, CBC, CPLEX. Maybe since quite a few techs have the same default values for costs and efficiencies, its fairly arbitrary on which one the model decides to invest in?

CPLEX> display solution quality Max. unscaled (scaled) bound infeas. = 4.26326e-13 (3.41061e-12) Max. unscaled (scaled) reduced-cost infeas. = 5.21669e-18 (6.52086e-19) Max. unscaled (scaled) Ax-b resid. = 2.04636e-12 (1.17097e-11) Max. unscaled (scaled) c-B'pi resid. = 4.33681e-19 (4.33681e-19) Max. unscaled (scaled) |x| = 6772.09 (6772.09) Max. unscaled (scaled) |slack| = 6250.21 (50001.7) Max. unscaled (scaled) |pi| = 1 (1) Max. unscaled (scaled) |red-cost| = 7131.17 (7131.17) Condition number of scaled basis = 4.0e+03

trevorb1 avatar Nov 11 '21 00:11 trevorb1

@trevorb1 Can this issue be closed?

maartenbrinkerink avatar Sep 04 '24 16:09 maartenbrinkerink

yeah, I believe this got solved. Thanks @maartenbrinkerink !

trevorb1 avatar Sep 04 '24 16:09 trevorb1