jump-dev / JuMP.jl

Modeling language for Mathematical Optimization (linear, mixed-integer, conic, semidefinite, nonlinear)
http://jump.dev/JuMP.jl/
Other
2.17k stars 390 forks source link

[docs] add Transitioning from MATLAB tutorial #3698

Closed odow closed 3 months ago

odow commented 4 months ago

Cherry-picked from https://github.com/jump-dev/JuMP.jl/pull/3697

Preview: https://jump.dev/JuMP.jl/previews/PR3698/tutorials/getting_started/transitioning_from_matlab/

https://jump.dev/JuMP.jl/previews/PR3698/tutorials/transitioning/transitioning_from_matlab/

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.35%. Comparing base (ecaf80c) to head (319e9ff). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3698 +/- ## ======================================= Coverage 98.35% 98.35% ======================================= Files 43 43 Lines 5707 5707 ======================================= Hits 5613 5613 Misses 94 94 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

araujoms commented 4 months ago

I don't have write access anymore since this PR is now in your branch.

odow commented 4 months ago

I don't have write access anymore since this PR is now in your branch.

Yeah. I changed it here so that we can get a preview: https://jump.dev/JuMP.jl/previews/PR3698/tutorials/getting_started/transitioning_from_matlab/

araujoms commented 4 months ago

Maybe it is worth it adding a paragraph explaining Symmetric and Hermitian?

blegat commented 4 months ago

It's also worth mentioning the difference between YALMIP and JuMP according to dualization. YALMIP is always in image form / geometric conic form while in JuMP it depends on the solver. See section 2.1 of the MOI paper for instance. You can refer to https://jump.dev/JuMP.jl/stable/tutorials/conic/dualization/

odow commented 4 months ago

Maybe it is worth it adding a paragraph explaining Symmetric and Hermitian?

I'd like to keep this tutorial pretty tightly scoped to focus on JuMP/YALMIP/CVX.

It is not the place for this tutorial to be a cheatsheet of every difference between Julia and MATLAB. Symmetric and Hermitian should be reasonably self-evident. If it isn't users can always look up the Julia documentation.

odow commented 4 months ago

It's also worth mentioning the difference between YALMIP and JuMP according to dualization.

Is this necessary for users transitioning from MATLAB? It seems in the weeds. I'd prefer we left it out and got feedback first.

araujoms commented 4 months ago

It is not the place for this tutorial to be a cheatsheet of every difference between Julia and MATLAB. Symmetric and Hermitian should be reasonably self-evident. If it isn't users can always look up the Julia documentation.

The difference is that with YALMIP and CVX one needs to do a = 0.5*(a+a') over and over again, to make sure your matrices are exactly Hermitian, whereas with JuMP this doesn't matter, you just have to wrap them in Hermitian.

blegat commented 4 months ago

Is this necessary for users transitioning from MATLAB? It seems in the weeds. I'd prefer we left it out and got feedback first.

This is the n°1 comment people have when coming from YALMIP (see for instance https://discourse.julialang.org/t/yalmip-vs-jump/30776/10 and https://discourse.julialang.org/t/jump-sumofsquares-generate-sdps-with-18x-more-constraints-than-yalmip/65377/15). It can just be a small note refering to the relevant part of the doc. (sorry I closed, missed click)

araujoms commented 3 months ago

I also think it would be worth it such a remark, it has a large impact on performance.

odow commented 3 months ago

Merging because this is good enough for now. If needed, we can make tweaks in smaller PRs, instead of hashing everything out here. (There are already 56 comments!)