Changeset 3226


Ignore:
Timestamp:
Nov 6, 2010 11:32:59 PM (10 years ago)
Author:
wehart
Message:

Setting up example, which was never converted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/coopr/pyomo/tests/NL/CUTE/gigomez1_cute.py

    r2882 r3226  
    3333
    3434from coopr.pyomo import *
    35 model = Model()
     35model = ConcreteModel()
    3636
    37 var x{1..2} := 2.0;
    38 var z:=2.0;
     37model.x = Var([1,2], initialize=2.0)
     38model.z = Var(initialize=2.0)
    3939
    40 model.f = Objective(rule=f,sense=minimize)
    41 minimize f:
    42         z;
    43 subject to cons1:
    44         z+5.0*x[1]-x[2] >= 0;
    45 subject to cons2:
    46         z-4*x[2]-x[1]^2-x[2]^2 >= 0;
    47 subject to cons3:
    48         z-5*x[1]-x[2] >= 0;
     40model.f = Objective(expr=model.z)
    4941
    50 solve;
    51 display f;
    52 display x;
    53 display z;
     42model.cons1 = Constraint(expr=model.z+5.0*model.x[1]-model.x[2] >= 0)
     43model.cons2 = Constraint(expr=model.z-4.0*model.x[2]-model.x[1]**2-model.x[2]**2 >= 0)
     44model.cons3 = Constraint(expr=model.z-5.0*model.x[1]-model.x[2] >= 0)
    5445
Note: See TracChangeset for help on using the changeset viewer.