julia-jump

is there any possibility to change the RHS of non-linear constraints in julia?

耗尽温柔 提交于 2021-02-10 12:51:59
问题 Is there any possibility to change the RHS of non-linear constraints? using JuMP, Ipopt, Juniper,Gurobi,CPUTime T=0; ZT=zeros(2,1); ZB=zeros(2,1); #-----Model parameters-------------------------------------------------------- sig=0.86; landa=50; E=T0=T1=.0833; T2=0.75; gam2=1; gam1=0; a1=5; a2=4.22; a3=977.4; ap=977.4; C1=949.2; c0=114.24; f(x) = cdf(Normal(0, 1), x); #--------------------------------------------------------------------------- ALT= Model(optimizer_with_attributes(Juniper

is there any possibility to change the RHS of non-linear constraints in julia?

邮差的信 提交于 2021-02-10 12:50:10
问题 Is there any possibility to change the RHS of non-linear constraints? using JuMP, Ipopt, Juniper,Gurobi,CPUTime T=0; ZT=zeros(2,1); ZB=zeros(2,1); #-----Model parameters-------------------------------------------------------- sig=0.86; landa=50; E=T0=T1=.0833; T2=0.75; gam2=1; gam1=0; a1=5; a2=4.22; a3=977.4; ap=977.4; C1=949.2; c0=114.24; f(x) = cdf(Normal(0, 1), x); #--------------------------------------------------------------------------- ALT= Model(optimizer_with_attributes(Juniper

How to convert type of a variable when using JuMP

北城余情 提交于 2021-01-27 21:31:42
问题 I am using Julia/JuMP to implement an algorithm. In one part, I define a model with continues variables and solve the linear model. I do some other calculations based on which I add a couple constraints to the model, and then I want to solve the same problem but with integer variables. I could not use convert() function as it does not take variables. I tried to define the variable again as integer, but the model did not seem to consider it! I provide a sample code here: m = Model() @defVar(m,

JuMP constraints involving matrix inverse

眉间皱痕 提交于 2020-12-14 22:39:28
问题 I'm attempting to solve for an n*n matrix U , which satisfies a variety of constraints, including some involving inverses of its sub-matrices. However, it seems that JuMP can't handle inverses, at least without some additional specification of invertibility. Here's an example of the problem with n=2 . using JuMP, Ipopt m = Model(with_optimizer(Ipopt.Optimizer)) A = [5 7; 7 10] B = [9 13; 13 19] C = [3 4; 4 6] nnodes = 2 @variable(m, U[1:nnodes, 1:nnodes]) A1 = U * A * U' B1 = U * B * U' C1 =

How to extract optimization problem matrices A,b,c using JuMP in Julia

孤人 提交于 2020-07-22 06:00:17
问题 I create an optimization model in Julia-JuMP using the symbolic variables and constraints e.g. below using JuMP using CPLEX # model Mod = Model(CPLEX.Optimizer) # sets I = 1:2; # Variables x = @variable( Mod , [I] , base_name = "x" ) y = @variable( Mod , [I] , base_name = "y" ) # constraints Con1 = @constraint( Mod , [i in I] , 2 * x[i] + 3 * y[i] <= 100 ) # objective ObjFun = @objective( Mod , Max , sum( x[i] + 2 * y[i] for i in I) ) ; # solve optimize!(Mod) I guess JuMP creates the problem

How to ask for second best solution to a MIP using JuMP

房东的猫 提交于 2020-06-14 04:06:54
问题 I have a Mixed Integer Programming problem. I can use JuMP to find the optimal solution. But how can I find the second best solution? Or the third-best etc. This potentially might be another equally optimal solution, or it might be a worse solution, or it might be :Infeasible -- there might be no most solutions. I know for a TSP-like problem, I can find additional solutions by progressively removing links that are on the optimal path (I.e setting the distances between some of the cities to be

Fitting two curves with linear/non-linear regression

孤街醉人 提交于 2020-01-14 07:51:09
问题 I need to fit two curves(which both should belong to cubic functions) into a set of points with JuMP. I've done fitting one curve, but I'm struggling at fitting 2 curves into same dataset. I thought that if I can distribute points to curves - so if each point can only be used once - I can do it like below, but it didn't work. (I know that I can use much more complicated things, I want to keep it simple.) This is a part of my current code: # cubicFunc is a two dimensional array which accepts