diff --git a/notebooks/03/02-shift-scheduling.ipynb b/notebooks/03/02-shift-scheduling.ipynb index 882c31ea..82b55afe 100644 --- a/notebooks/03/02-shift-scheduling.ipynb +++ b/notebooks/03/02-shift-scheduling.ipynb @@ -45,14 +45,15 @@ "outputs": [], "source": [ "import sys\n", - " \n", - "if 'google.colab' in sys.modules:\n", + "\n", + "if \"google.colab\" in sys.modules:\n", " %pip install pyomo >/dev/null 2>/dev/null\n", " %pip install highspy >/dev/null 2>/dev/null\n", - " \n", - "solver = 'appsi_highs'\n", + "\n", + "solver = \"appsi_highs\"\n", "\n", "import pyomo.environ as pyo\n", + "\n", "SOLVER = pyo.SolverFactory(solver)\n", "\n", "assert SOLVER.available(), f\"Solver {solver} is not available.\"" @@ -97,7 +98,7 @@ "source": [ "### Model sets\n", "\n", - "Assuming that we have $N$ available workers, the problem requires the assignment of these available workers to a predetermined set of shifts with specific staffing requirements. Let $\\textup{R}_{d, s}$ describe the minimum number of workers required for the day-shift pair $(d, s)$.\n", + "Assuming that we have $N$ available workers, the problem requires the assignment of these available workers to a predetermined set of shifts with specific staffing requirements. Let $\\text{R}_{d, s}$ describe the minimum number of workers required for the day-shift pair $(d, s)$.\n", "\n", "There are three shifts per day, seven days per week. These observations suggest the need for three ordered sets:\n", "\n", diff --git a/notebooks/03/05-machine-scheduling.ipynb b/notebooks/03/05-machine-scheduling.ipynb index 0ccecb45..2f5f1339 100644 --- a/notebooks/03/05-machine-scheduling.ipynb +++ b/notebooks/03/05-machine-scheduling.ipynb @@ -42,14 +42,15 @@ "outputs": [], "source": [ "import sys\n", - " \n", - "if 'google.colab' in sys.modules:\n", + "\n", + "if \"google.colab\" in sys.modules:\n", " %pip install pyomo >/dev/null 2>/dev/null\n", " %pip install highspy >/dev/null 2>/dev/null\n", - " \n", - "solver = 'appsi_highs'\n", - " \n", + "\n", + "solver = \"appsi_highs\"\n", + "\n", "import pyomo.environ as pyo\n", + "\n", "SOLVER = pyo.SolverFactory(solver)\n", "\n", "assert SOLVER.available(), f\"Solver {solver} is not available.\"" @@ -813,8 +814,8 @@ "\n", "$$\n", "\\begin{align*}\n", - "\\textup{finish}_i & \\leq \\textup{start}_j + M z_{ij} \\\\\n", - "\\textup{finish}_j & \\leq \\textup{start}_i + M (1 - z_{ij}).\n", + "\\text{finish}_i & \\leq \\text{start}_j + M z_{ij} \\\\\n", + "\\text{finish}_j & \\leq \\text{start}_i + M (1 - z_{ij}).\n", "\\end{align*}\n", "$$\n", "\n", diff --git a/notebooks/03/07-bim-production-revisited.ipynb b/notebooks/03/07-bim-production-revisited.ipynb index 699c6311..89b66fb3 100644 --- a/notebooks/03/07-bim-production-revisited.ipynb +++ b/notebooks/03/07-bim-production-revisited.ipynb @@ -43,14 +43,15 @@ "outputs": [], "source": [ "import sys\n", - " \n", - "if 'google.colab' in sys.modules:\n", + "\n", + "if \"google.colab\" in sys.modules:\n", " %pip install pyomo >/dev/null 2>/dev/null\n", " %pip install highspy >/dev/null 2>/dev/null\n", - " \n", - "solver = 'appsi_highs'\n", - " \n", + "\n", + "solver = \"appsi_highs\"\n", + "\n", "import pyomo.environ as pyo\n", + "\n", "SOLVER = pyo.SolverFactory(solver)\n", "\n", "assert SOLVER.available(), f\"Solver {solver} is not available.\"" @@ -520,7 +521,7 @@ "\\begin{align*}\n", " \\min \\quad & \\sum_{t \\in T} \\Big( \\Big( \\sum_{s \\in S} \\pi_{s} b_{ts} + \\alpha_{s} y_{ts} \\Big) - \\beta p_t \\Big) +&\n", " \\sum_{t \\in T} \\Big ( \\gamma_{\\text{copper}} r_t + \\sum_{p \\in P \\setminus \\{ \\text{copper}\\}} \\gamma_{p} s_{pt} \\Big) \\\\\n", - " \\textup{s.t.} \\quad \n", + " \\text{s.t.} \\quad \n", " & \\sum_{p \\in P \\setminus \\{ \\text{copper}\\}} x_{pts} \\leq 100 \\cdot b_{ts} & \\forall \\, t \\in T, \\, \\forall \\, s \\in S\\\\\n", " & s_{\\text{copper}, t} \\leq 10 \\cdot r_t & \\forall \\, t \\in T\\\\\n", " & s_{\\text{copper}, t} \\leq 10000 & \\forall \\, t \\in T\\\\\n", diff --git a/notebooks/10/02-two-stage-production-planning.ipynb b/notebooks/10/02-two-stage-production-planning.ipynb index d7d3e81c..dbe09d01 100644 --- a/notebooks/10/02-two-stage-production-planning.ipynb +++ b/notebooks/10/02-two-stage-production-planning.ipynb @@ -50,14 +50,15 @@ "outputs": [], "source": [ "import sys\n", - " \n", - "if 'google.colab' in sys.modules:\n", + "\n", + "if \"google.colab\" in sys.modules:\n", " %pip install pyomo >/dev/null 2>/dev/null\n", " %pip install highspy >/dev/null 2>/dev/null\n", "\n", - "solver = 'appsi_highs'\n", - " \n", + "solver = \"appsi_highs\"\n", + "\n", "import pyomo.environ as pyo\n", + "\n", "SOLVER = pyo.SolverFactory(solver)\n", "\n", "assert SOLVER.available(), f\"Solver {solver} is not available.\"" @@ -204,9 +205,9 @@ "\\begin{align*}\n", "x = \\begin{pmatrix} x \\end{pmatrix},\n", "\\\n", - "\\bm{y} = \\begin{pmatrix} y_1 \\\\ y_2 \\\\ y_3 \\end{pmatrix},\n", + "y = \\begin{pmatrix} y_1 \\\\ y_2 \\\\ y_3 \\end{pmatrix},\n", "\\\n", - "\\bm{z} = \\begin{pmatrix} z_A \\\\ z_B \\\\ z_D \\end{pmatrix}\n", + "z = \\begin{pmatrix} z_A \\\\ z_B \\\\ z_D \\end{pmatrix}\n", "\\end{align*}\n", "$$\n", "\n", @@ -221,11 +222,11 @@ "\n", "$$\n", "\\begin{align*}\n", - "R(\\bm{z}) = \\begin{pmatrix} 0 \\\\ 0 \\\\ 0 \\\\ 0 \\\\ -1 \\end{pmatrix}, \n", + "R(z) = \\begin{pmatrix} 0 \\\\ 0 \\\\ 0 \\\\ 0 \\\\ -1 \\end{pmatrix}, \n", "\\\n", - "S(\\bm{z}) = \\begin{pmatrix} - (140 - 50z_A - 80z_B) & - (120 - 50z_A - 40z_B) & 1 \\\\ 1 & 0 & 0 \\\\ 1+z_A & 1 + z_A & 0 \\\\ 2(1+z_B) & 1 + z_B & 0 \\\\ 10 & 9 & 0 \\end{pmatrix},\n", + "S(z) = \\begin{pmatrix} - (140 - 50z_A - 80z_B) & - (120 - 50z_A - 40z_B) & 1 \\\\ 1 & 0 & 0 \\\\ 1+z_A & 1 + z_A & 0 \\\\ 2(1+z_B) & 1 + z_B & 0 \\\\ 10 & 9 & 0 \\end{pmatrix},\n", "\\\n", - "t(\\bm{z}) = \\begin{pmatrix} 0 \\\\ -20(1+z_D) \\\\ 80 \\\\ 100 \\\\ 0 \\end{pmatrix} \\\\\n", + "t(z) = \\begin{pmatrix} 0 \\\\ -20(1+z_D) \\\\ 80 \\\\ 100 \\\\ 0 \\end{pmatrix} \\\\\n", "\\end{align*}\n", "$$" ]