This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
home_test_julia [2017/02/07 10:15]
home_test_julia [2018/06/18 15:11] (current)
Line 1: Line 1:
-===== Installation ===== 
-**Step 1:**  
-  * Option a: Get an account on [[https://​juliabox.com|JuliaBox.com]] to run julia/JuMP script without installing anything on the local computer 
-  * Option b: Install Julia for your platform ([[http://​julialang.org/​downloads/​|http://​julialang.org/​downloads/​]]) 
-**Step 2:** 
 Run, only once, the following code to install JuMP language and a couple of open source solvers: Run, only once, the following code to install JuMP language and a couple of open source solvers:
 <code julia> <code julia>
-Pkg.update() ​                       ​# To refresh the list of newest packages + 
-Pkg.add("​JuMP"​) ​                    ​The mathematical optimisation library +Pkg.update() ​                        
-Pkg.add("​GLPKMathProgInterface"​) ​   ​# A lineaqr and MIP solver +Pkg.add("​JuMP"​) ​          ​asdasd ​         ​ 
-Pkg.add("​Ipopt"​) ​                   # A non-linear solver +Pkg.add("​GLPKMathProgInterface"​) ​    
-Pkg.add("​DataFrames"​) ​              # A library to deal with dataframes (R-like tabular data)+Pkg.add("​Ipopt"​) ​                  ​ 
 +Pkg.add("​DataFrames"​) ​              
 </​code>​ </​code>​
-===== Model components ===== 
-==== Importing the libraries ==== 
-You will need to import as a minima the ''​JuMP''​ module. If you wish to specify a solver engine rather than letting JuMP select a suitable one, you will need to import also the module relative to the solver, e.g. ''​Ipopt''​ or  ''​GLPKMathProgInterface''​ 
 <code julia> <code julia>
Line 27: Line 16:
 </​code>​ </​code>​
-==== Defining the "​sets"​ ==== 
-JuMP doesn'​t really have a concept of sets, but it uses the native containers available in the core Julia language\\Variables,​ parameters and constraints can be indexed using these containers.\\ 
-While many works with position-based lists, I find more readable using dictionaries instead. So the "​sets"​ are represented as lists, but then everything else is a dictionary with the elements of the list as keys.\\ 
-One note: it seems that Julia/JuMP don't like much the "​-"​ symbol, so I replaced it to "​_"​.\\ 
 <code julia> <code julia>
-## Define sets ##+# Define sets #
 #  Sets #  Sets
 #       ​i ​  ​canning plants ​  / seattle, san-diego / #       ​i ​  ​canning plants ​  / seattle, san-diego /
home_test_julia.txt · Last modified: 2018/06/18 15:11 (external edit)
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0