Deterministic Systems Models Exam I

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/5

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 3:24 AM on 10/1/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

6 Terms

1
New cards

Write the code in Python/Gurobi to import “Gurobipy”

from gurobipy import

2
New cards

Write the code in Python/Gurobi to define/create a Gurobi model named

“Exam1_Problem4”

model = Model("Exam1_Problem4")

3
New cards

Write the code in Python/Gurobi to add the decision variables to the Gurobi model. Do not forget to indicate their respective coefficients (for the objective function) when defining the variables

x = model.addVar(S, D, obj = C, name = “x”)

4
New cards

Write the code in Python/Gurobi to set the “sense” of the Gurobi model to “Minimize

model.modelSense = GRB.Minimzie

5
New cards

Write the code in Python/Gurobi to add the constraints (c1, c2, and c3) to the Gurobi model

model.addConstrs((x.sum(‘*’, j) ==b[j] for j in D, “C1”)

model.addConstrs((x.sum(i,’*’)==a[i]) for i in S1, “C2”)

model.addConstrs((x[i,j] <= u[i,j] for i in S for j in D, “C3”)

6
New cards

Write the code in Python/Gurobi to solve (optimize) the Gurobi model

model.optimize