Hello,
I have two JuMP model like following:
m1=Model(solver=ClpSolver())
@variable(m1, x[1:3]>=0)
@constraint(m1, sum(x[i] for i in 1:3)>=0)
@constraint(m1, sum(x[i] for i in [1,3])>=0)
@constraint(m1, sum(x[i] for i in [2,3])>=0)
@objective(m1, Min, sum(x[i] for i in 1:3))
And the second model is
m2=Model(solver=IpoptSolver())
@variable(m2, x[1:3]>=0)
@NLconstraint(m2, sum(x[i]^2 for i in 1:3)>=0)
@NLconstraint(m2, sum(x[i]^2 for i in [1,3])>=0)
@NLconstraint(m2, sum(x[i]^2 for i in [2,3])>=0)
@NLobjective(m2, Min, sum(x[i]^2 for i in 1:3))
Now I want to add last two constraints of model “m1” to model “m2”, that is I want to make model “m2” looks like the following:
m2=Model(solver=IpoptSolver())
@variable(m2, x[1:3]>=0)
@NLconstraint(m2, sum(x[i]^2 for i in 1:3)>=0)
@NLconstraint(m2, sum(x[i]^2 for i in [1,3])>=0)
@NLconstraint(m2, sum(x[i]^2 for i in [2,3])>=0)
@constraint(m2, sum(x[i] for i in [1,3])>=0)
@constraint(m2, sum(x[i] for i in [2,3])>=0)
@NLobjective(m2, Min, sum(x[i]^2 for i in 1:3))
I do not know how to do this. I will appreciate your opinion/suggestion on this issue. Thank you in advance.