Intlinprog: Different solutions with different computers but same code

조회 수: 9 (최근 30일)
b999
b999 2023년 11월 18일
댓글: Harald 2025년 1월 28일
Hello,
I wrote a problem-based matlab code with intlinprog. In my opinion the optimation results should be the same if I am using different computers with different processors / RAM or different Matlab versions. But neither the solution nor the objective values are the same.
Theoretically intlinprog is a deterministic solver so with the same input there has to be the same output.Is that correct? Is there a reason why the solutions could differ by using different computers?
One of these computers has Matlab 2023b and the other 2021b. Could that be the reason?

채택된 답변

Harald
Harald 2023년 11월 20일
Hi,
different releases can be the reason for the described behavior. From the release notes, you can see that there were changes in R2022a and, likely more relevant, R2023a ("Improvements in intlinprog and linprog").
A crucial question is of course: are the results in R2023b better than the ones for R2021b (i.e., lower objective function value for minimization)? If so, your example is one of the cases in which the R2023a modification has led to a better solution.
For further investigation, please consider sharing a reproducible example.
Best wishes,
Harald
  댓글 수: 2
Chiara
Chiara 2025년 1월 24일
what if this happens if on my local computer I use the same release (r2014b) that i used to compile the dll I'm using on costumer application?
Harald
Harald 2025년 1월 28일
I am not sure if I understand the question correctly. If it is about different computers producing different results even with the same results: Different computers may use different processors and thus instruction sets. Initially small deviations in calculations may eventually accumulate. If the R2014b is not a typo, I'd also consider upgrading.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!