diff --git a/doc/pub/week46/html/._week46-bs029.html b/doc/pub/week46/html/._week46-bs029.html index 0e5dff381..76e5ee1d1 100644 --- a/doc/pub/week46/html/._week46-bs029.html +++ b/doc/pub/week46/html/._week46-bs029.html @@ -235,15 +235,15 @@ The following code solves the equations for us import numpy from cvxopt import matrix from cvxopt import solvers -P = matrix(numpy.diag([1,0]), tc=’d’) -q = matrix(numpy.array([3,4]), tc=’d’) -G = matrix(numpy.array([[-1,0],[0,-1],[-1,-3],[2,5],[3,4]]), tc=’d’) -h = matrix(numpy.array([0,0,-15,100,80]), tc=’d’) +P = matrix(numpy.diag([1,0]), tc='d') +q = matrix(numpy.array([3,4]), tc='d') +G = matrix(numpy.array([[-1,0],[0,-1],[-1,-3],[2,5],[3,4]]), tc='d') +h = matrix(numpy.array([0,0,-15,100,80]), tc='d') # Construct the QP, invoke solver sol = solvers.qp(P,q,G,h) # Extract optimal value and solution -sol[’x’] -sol[’primal objective’] +sol['x'] +sol['primal objective'] diff --git a/doc/pub/week46/html/week46-reveal.html b/doc/pub/week46/html/week46-reveal.html index 5a4ad358e..35f145a29 100644 --- a/doc/pub/week46/html/week46-reveal.html +++ b/doc/pub/week46/html/week46-reveal.html @@ -1584,15 +1584,15 @@ The following code solves the equations for us import numpy from cvxopt import matrix from cvxopt import solvers -P = matrix(numpy.diag([1,0]), tc=d) -q = matrix(numpy.array([3,4]), tc=d) -G = matrix(numpy.array([[-1,0],[0,-1],[-1,-3],[2,5],[3,4]]), tc=d) -h = matrix(numpy.array([0,0,-15,100,80]), tc=d) +P = matrix(numpy.diag([1,0]), tc='d') +q = matrix(numpy.array([3,4]), tc='d') +G = matrix(numpy.array([[-1,0],[0,-1],[-1,-3],[2,5],[3,4]]), tc='d') +h = matrix(numpy.array([0,0,-15,100,80]), tc='d') # Construct the QP, invoke solver sol = solvers.qp(P,q,G,h) # Extract optimal value and solution -sol[x] -sol[primal objective] +sol['x'] +sol['primal objective'] @@ -1628,8 +1628,6 @@ $$ \( \boldsymbol{y}=[y_1,y_2,\dots,y_n] \). With the slack constants this leads to the additional constraint \( 0\leq \lambda_i \leq C \).

- -code will be added diff --git a/doc/pub/week46/html/week46-solarized.html b/doc/pub/week46/html/week46-solarized.html index af76d1937..6eb3dc309 100644 --- a/doc/pub/week46/html/week46-solarized.html +++ b/doc/pub/week46/html/week46-solarized.html @@ -1399,15 +1399,15 @@ The following code solves the equations for us import numpy from cvxopt import matrix from cvxopt import solvers -P = matrix(numpy.diag([1,0]), tc=d) -q = matrix(numpy.array([3,4]), tc=d) -G = matrix(numpy.array([[-1,0],[0,-1],[-1,-3],[2,5],[3,4]]), tc=d) -h = matrix(numpy.array([0,0,-15,100,80]), tc=d) +P = matrix(numpy.diag([1,0]), tc='d') +q = matrix(numpy.array([3,4]), tc='d') +G = matrix(numpy.array([[-1,0],[0,-1],[-1,-3],[2,5],[3,4]]), tc='d') +h = matrix(numpy.array([0,0,-15,100,80]), tc='d') # Construct the QP, invoke solver sol = solvers.qp(P,q,G,h) # Extract optimal value and solution -sol[x] -sol[primal objective] +sol['x'] +sol['primal objective'] @@ -1442,8 +1442,6 @@ $$ With the slack constants this leads to the additional constraint \( 0\leq \lambda_i \leq C \).

-code will be added -
© 1999-2022, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license diff --git a/doc/pub/week46/html/week46.html b/doc/pub/week46/html/week46.html index 1bde18e5d..6642e43c7 100644 --- a/doc/pub/week46/html/week46.html +++ b/doc/pub/week46/html/week46.html @@ -1476,15 +1476,15 @@ The following code solves the equations for us import numpy from cvxopt import matrix from cvxopt import solvers -P = matrix(numpy.diag([1,0]), tc=’d’) -q = matrix(numpy.array([3,4]), tc=’d’) -G = matrix(numpy.array([[-1,0],[0,-1],[-1,-3],[2,5],[3,4]]), tc=’d’) -h = matrix(numpy.array([0,0,-15,100,80]), tc=’d’) +P = matrix(numpy.diag([1,0]), tc='d') +q = matrix(numpy.array([3,4]), tc='d') +G = matrix(numpy.array([[-1,0],[0,-1],[-1,-3],[2,5],[3,4]]), tc='d') +h = matrix(numpy.array([0,0,-15,100,80]), tc='d') # Construct the QP, invoke solver sol = solvers.qp(P,q,G,h) # Extract optimal value and solution -sol[’x’] -sol[’primal objective’] +sol['x'] +sol['primal objective'] @@ -1519,8 +1519,6 @@ $$ With the slack constants this leads to the additional constraint \( 0\leq \lambda_i \leq C \).

-code will be added -
© 1999-2022, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license diff --git a/doc/pub/week46/ipynb/ipynb-week46-src.tar.gz b/doc/pub/week46/ipynb/ipynb-week46-src.tar.gz index 71b644cca..846111d95 100644 Binary files a/doc/pub/week46/ipynb/ipynb-week46-src.tar.gz and b/doc/pub/week46/ipynb/ipynb-week46-src.tar.gz differ diff --git a/doc/pub/week46/ipynb/week46.ipynb b/doc/pub/week46/ipynb/week46.ipynb index ab04590da..0830feb18 100644 --- a/doc/pub/week46/ipynb/week46.ipynb +++ b/doc/pub/week46/ipynb/week46.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d33120af", + "id": "c729ff05", "metadata": { "editable": true }, @@ -14,7 +14,7 @@ }, { "cell_type": "markdown", - "id": "8bc720cc", + "id": "ea7ce43a", "metadata": { "editable": true }, @@ -29,7 +29,7 @@ }, { "cell_type": "markdown", - "id": "ade03988", + "id": "2f795544", "metadata": { "editable": true }, @@ -58,7 +58,7 @@ }, { "cell_type": "markdown", - "id": "7dd29a4a", + "id": "4ca2acda", "metadata": { "editable": true }, @@ -86,7 +86,7 @@ }, { "cell_type": "markdown", - "id": "c0684f07", + "id": "cddfb56d", "metadata": { "editable": true }, @@ -107,7 +107,7 @@ }, { "cell_type": "markdown", - "id": "18cb0dca", + "id": "38b91750", "metadata": { "editable": true }, @@ -141,7 +141,7 @@ }, { "cell_type": "markdown", - "id": "d85355fe", + "id": "05d68973", "metadata": { "editable": true }, @@ -163,7 +163,7 @@ { "cell_type": "code", "execution_count": 1, - "id": "41a222bc", + "id": "c9d58ad1", "metadata": { "collapsed": false, "editable": true @@ -242,7 +242,7 @@ }, { "cell_type": "markdown", - "id": "32651474", + "id": "d07c7ddc", "metadata": { "editable": true }, @@ -262,7 +262,7 @@ }, { "cell_type": "markdown", - "id": "ebe40ef1", + "id": "f908f7ec", "metadata": { "editable": true }, @@ -274,7 +274,7 @@ }, { "cell_type": "markdown", - "id": "eabfe7bb", + "id": "46b551a7", "metadata": { "editable": true }, @@ -287,7 +287,7 @@ }, { "cell_type": "markdown", - "id": "329dbb26", + "id": "38202117", "metadata": { "editable": true }, @@ -299,7 +299,7 @@ }, { "cell_type": "markdown", - "id": "b9d940b0", + "id": "23648f2b", "metadata": { "editable": true }, @@ -312,7 +312,7 @@ }, { "cell_type": "markdown", - "id": "c290bc6a", + "id": "87d830d0", "metadata": { "editable": true }, @@ -324,7 +324,7 @@ }, { "cell_type": "markdown", - "id": "9f84516b", + "id": "944625ca", "metadata": { "editable": true }, @@ -336,7 +336,7 @@ }, { "cell_type": "markdown", - "id": "6c542c2c", + "id": "46929e2f", "metadata": { "editable": true }, @@ -348,7 +348,7 @@ }, { "cell_type": "markdown", - "id": "2bc884dd", + "id": "db9e908f", "metadata": { "editable": true }, @@ -358,7 +358,7 @@ }, { "cell_type": "markdown", - "id": "de12e606", + "id": "001977b7", "metadata": { "editable": true }, @@ -370,7 +370,7 @@ }, { "cell_type": "markdown", - "id": "7c65eb4f", + "id": "394bb1bb", "metadata": { "editable": true }, @@ -381,7 +381,7 @@ }, { "cell_type": "markdown", - "id": "d8d1b671", + "id": "f9092c79", "metadata": { "editable": true }, @@ -393,7 +393,7 @@ }, { "cell_type": "markdown", - "id": "a0ae118f", + "id": "f3e3aa3d", "metadata": { "editable": true }, @@ -406,7 +406,7 @@ }, { "cell_type": "markdown", - "id": "d8c4ddce", + "id": "9d920ee9", "metadata": { "editable": true }, @@ -418,7 +418,7 @@ }, { "cell_type": "markdown", - "id": "1fc8e588", + "id": "141825ca", "metadata": { "editable": true }, @@ -428,7 +428,7 @@ }, { "cell_type": "markdown", - "id": "eab2468f", + "id": "f57410da", "metadata": { "editable": true }, @@ -457,7 +457,7 @@ }, { "cell_type": "markdown", - "id": "1dfa5b5c", + "id": "baeb66bb", "metadata": { "editable": true }, @@ -469,7 +469,7 @@ }, { "cell_type": "markdown", - "id": "32c8ebe0", + "id": "d00aa5e6", "metadata": { "editable": true }, @@ -481,7 +481,7 @@ }, { "cell_type": "markdown", - "id": "219bfa83", + "id": "840cf66b", "metadata": { "editable": true }, @@ -495,7 +495,7 @@ }, { "cell_type": "markdown", - "id": "5055b563", + "id": "4f2e9664", "metadata": { "editable": true }, @@ -507,7 +507,7 @@ }, { "cell_type": "markdown", - "id": "74f9b516", + "id": "1717e7fb", "metadata": { "editable": true }, @@ -521,7 +521,7 @@ }, { "cell_type": "markdown", - "id": "035a49ed", + "id": "9aee3baf", "metadata": { "editable": true }, @@ -533,7 +533,7 @@ }, { "cell_type": "markdown", - "id": "1bbc3c6b", + "id": "aa76c023", "metadata": { "editable": true }, @@ -543,7 +543,7 @@ }, { "cell_type": "markdown", - "id": "b781d475", + "id": "9e60c9f0", "metadata": { "editable": true }, @@ -555,7 +555,7 @@ }, { "cell_type": "markdown", - "id": "2ccc4b9a", + "id": "6f9c7063", "metadata": { "editable": true }, @@ -565,7 +565,7 @@ }, { "cell_type": "markdown", - "id": "7ed6707a", + "id": "8d9ca704", "metadata": { "editable": true }, @@ -577,7 +577,7 @@ }, { "cell_type": "markdown", - "id": "7e026464", + "id": "daffdb4c", "metadata": { "editable": true }, @@ -589,7 +589,7 @@ }, { "cell_type": "markdown", - "id": "a7e36eaa", + "id": "dfd76bfb", "metadata": { "editable": true }, @@ -601,7 +601,7 @@ }, { "cell_type": "markdown", - "id": "914e87e4", + "id": "56474a6d", "metadata": { "editable": true }, @@ -611,7 +611,7 @@ }, { "cell_type": "markdown", - "id": "886d1b88", + "id": "804fcdaa", "metadata": { "editable": true }, @@ -623,7 +623,7 @@ }, { "cell_type": "markdown", - "id": "48267a6b", + "id": "757f992e", "metadata": { "editable": true }, @@ -633,7 +633,7 @@ }, { "cell_type": "markdown", - "id": "d42d8176", + "id": "2420a529", "metadata": { "editable": true }, @@ -647,7 +647,7 @@ }, { "cell_type": "markdown", - "id": "cd4d9d57", + "id": "29b38fce", "metadata": { "editable": true }, @@ -666,7 +666,7 @@ }, { "cell_type": "markdown", - "id": "b10d537a", + "id": "e3a24783", "metadata": { "editable": true }, @@ -682,7 +682,7 @@ }, { "cell_type": "markdown", - "id": "236c046b", + "id": "4f190281", "metadata": { "editable": true }, @@ -694,7 +694,7 @@ }, { "cell_type": "markdown", - "id": "6246258d", + "id": "1f809787", "metadata": { "editable": true }, @@ -706,7 +706,7 @@ }, { "cell_type": "markdown", - "id": "9f0d657c", + "id": "9784caf1", "metadata": { "editable": true }, @@ -718,7 +718,7 @@ }, { "cell_type": "markdown", - "id": "b4f2b017", + "id": "daf06ded", "metadata": { "editable": true }, @@ -728,7 +728,7 @@ }, { "cell_type": "markdown", - "id": "49bfdb06", + "id": "1af6416d", "metadata": { "editable": true }, @@ -740,7 +740,7 @@ }, { "cell_type": "markdown", - "id": "fb144f26", + "id": "649c5a95", "metadata": { "editable": true }, @@ -751,7 +751,7 @@ }, { "cell_type": "markdown", - "id": "a3811efa", + "id": "9be8314b", "metadata": { "editable": true }, @@ -763,7 +763,7 @@ }, { "cell_type": "markdown", - "id": "8a35af9f", + "id": "31df68d2", "metadata": { "editable": true }, @@ -776,7 +776,7 @@ }, { "cell_type": "markdown", - "id": "9d011d47", + "id": "5dc67d38", "metadata": { "editable": true }, @@ -789,7 +789,7 @@ }, { "cell_type": "markdown", - "id": "71194d90", + "id": "86987299", "metadata": { "editable": true }, @@ -801,7 +801,7 @@ }, { "cell_type": "markdown", - "id": "f304df83", + "id": "8fc77bed", "metadata": { "editable": true }, @@ -811,7 +811,7 @@ }, { "cell_type": "markdown", - "id": "c1c0128c", + "id": "34a8cc9b", "metadata": { "editable": true }, @@ -823,7 +823,7 @@ }, { "cell_type": "markdown", - "id": "e4d27ffd", + "id": "731c710c", "metadata": { "editable": true }, @@ -833,7 +833,7 @@ }, { "cell_type": "markdown", - "id": "318f7ce4", + "id": "884dbf2b", "metadata": { "editable": true }, @@ -845,7 +845,7 @@ }, { "cell_type": "markdown", - "id": "043edc95", + "id": "691036d3", "metadata": { "editable": true }, @@ -862,7 +862,7 @@ }, { "cell_type": "markdown", - "id": "e0f8c621", + "id": "c7bd00f7", "metadata": { "editable": true }, @@ -874,7 +874,7 @@ }, { "cell_type": "markdown", - "id": "5ff7f59e", + "id": "140274ea", "metadata": { "editable": true }, @@ -884,7 +884,7 @@ }, { "cell_type": "markdown", - "id": "e0f5a8a4", + "id": "9a43f7dd", "metadata": { "editable": true }, @@ -896,7 +896,7 @@ }, { "cell_type": "markdown", - "id": "82dff586", + "id": "c639e9f9", "metadata": { "editable": true }, @@ -906,7 +906,7 @@ }, { "cell_type": "markdown", - "id": "a04a3cde", + "id": "916cf136", "metadata": { "editable": true }, @@ -918,7 +918,7 @@ }, { "cell_type": "markdown", - "id": "c8d9a1d0", + "id": "2eff919b", "metadata": { "editable": true }, @@ -931,7 +931,7 @@ }, { "cell_type": "markdown", - "id": "a6487ba7", + "id": "1b12af64", "metadata": { "editable": true }, @@ -943,7 +943,7 @@ }, { "cell_type": "markdown", - "id": "756ad0bc", + "id": "c6dc436b", "metadata": { "editable": true }, @@ -955,7 +955,7 @@ }, { "cell_type": "markdown", - "id": "541cde23", + "id": "675d6574", "metadata": { "editable": true }, @@ -965,7 +965,7 @@ }, { "cell_type": "markdown", - "id": "f4a9165c", + "id": "8978913a", "metadata": { "editable": true }, @@ -979,7 +979,7 @@ }, { "cell_type": "markdown", - "id": "4071f85c", + "id": "89dadfae", "metadata": { "editable": true }, @@ -989,7 +989,7 @@ }, { "cell_type": "markdown", - "id": "c6633851", + "id": "c3d64cd7", "metadata": { "editable": true }, @@ -1001,7 +1001,7 @@ }, { "cell_type": "markdown", - "id": "ab400c46", + "id": "6c327182", "metadata": { "editable": true }, @@ -1011,7 +1011,7 @@ }, { "cell_type": "markdown", - "id": "ac04ebea", + "id": "7b4b6a3b", "metadata": { "editable": true }, @@ -1023,7 +1023,7 @@ }, { "cell_type": "markdown", - "id": "f57af7a4", + "id": "40231440", "metadata": { "editable": true }, @@ -1033,7 +1033,7 @@ }, { "cell_type": "markdown", - "id": "3fd422f4", + "id": "9116ffa8", "metadata": { "editable": true }, @@ -1045,7 +1045,7 @@ }, { "cell_type": "markdown", - "id": "f66e7331", + "id": "63c2817b", "metadata": { "editable": true }, @@ -1059,7 +1059,7 @@ }, { "cell_type": "markdown", - "id": "0030f42d", + "id": "20ddd40a", "metadata": { "editable": true }, @@ -1071,7 +1071,7 @@ }, { "cell_type": "markdown", - "id": "f45442c2", + "id": "9bfd85bf", "metadata": { "editable": true }, @@ -1082,7 +1082,7 @@ }, { "cell_type": "markdown", - "id": "5fd6d5cf", + "id": "d27a05d9", "metadata": { "editable": true }, @@ -1094,7 +1094,7 @@ }, { "cell_type": "markdown", - "id": "0d0e1a16", + "id": "10bd6863", "metadata": { "editable": true }, @@ -1106,7 +1106,7 @@ }, { "cell_type": "markdown", - "id": "8a44932e", + "id": "0a4958f1", "metadata": { "editable": true }, @@ -1118,7 +1118,7 @@ }, { "cell_type": "markdown", - "id": "072e9ea2", + "id": "10fd06d2", "metadata": { "editable": true }, @@ -1128,7 +1128,7 @@ }, { "cell_type": "markdown", - "id": "0ac5c059", + "id": "9e42680b", "metadata": { "editable": true }, @@ -1140,7 +1140,7 @@ }, { "cell_type": "markdown", - "id": "f18e6991", + "id": "065592b2", "metadata": { "editable": true }, @@ -1150,7 +1150,7 @@ }, { "cell_type": "markdown", - "id": "1af0816f", + "id": "396a4b47", "metadata": { "editable": true }, @@ -1162,7 +1162,7 @@ }, { "cell_type": "markdown", - "id": "04dd0aa1", + "id": "2b023b89", "metadata": { "editable": true }, @@ -1173,7 +1173,7 @@ }, { "cell_type": "markdown", - "id": "0de59ee7", + "id": "67b4968e", "metadata": { "editable": true }, @@ -1185,7 +1185,7 @@ }, { "cell_type": "markdown", - "id": "f24a4f9f", + "id": "c1578e4f", "metadata": { "editable": true }, @@ -1199,7 +1199,7 @@ }, { "cell_type": "markdown", - "id": "a64660c3", + "id": "4afa5b4a", "metadata": { "editable": true }, @@ -1211,7 +1211,7 @@ }, { "cell_type": "markdown", - "id": "c043c2bf", + "id": "ffcff3ac", "metadata": { "editable": true }, @@ -1223,7 +1223,7 @@ }, { "cell_type": "markdown", - "id": "5d20b925", + "id": "edc1065c", "metadata": { "editable": true }, @@ -1233,7 +1233,7 @@ }, { "cell_type": "markdown", - "id": "35674dc4", + "id": "71166367", "metadata": { "editable": true }, @@ -1250,7 +1250,7 @@ }, { "cell_type": "markdown", - "id": "3e721b71", + "id": "07ee99de", "metadata": { "editable": true }, @@ -1261,7 +1261,7 @@ }, { "cell_type": "markdown", - "id": "46ffb0ac", + "id": "b579bc02", "metadata": { "editable": true }, @@ -1274,7 +1274,7 @@ }, { "cell_type": "markdown", - "id": "400804ce", + "id": "c37e51ba", "metadata": { "editable": true }, @@ -1286,7 +1286,7 @@ }, { "cell_type": "markdown", - "id": "3a30bd60", + "id": "6ff40288", "metadata": { "editable": true }, @@ -1296,7 +1296,7 @@ }, { "cell_type": "markdown", - "id": "43653a15", + "id": "7427be81", "metadata": { "editable": true }, @@ -1308,7 +1308,7 @@ }, { "cell_type": "markdown", - "id": "751a24eb", + "id": "e5df1a8b", "metadata": { "editable": true }, @@ -1318,7 +1318,7 @@ }, { "cell_type": "markdown", - "id": "66180245", + "id": "a63e3750", "metadata": { "editable": true }, @@ -1330,7 +1330,7 @@ }, { "cell_type": "markdown", - "id": "4d6047c5", + "id": "c62e0432", "metadata": { "editable": true }, @@ -1340,7 +1340,7 @@ }, { "cell_type": "markdown", - "id": "62aaa0aa", + "id": "07ff6daf", "metadata": { "editable": true }, @@ -1352,7 +1352,7 @@ }, { "cell_type": "markdown", - "id": "3b25aec8", + "id": "c2ecc701", "metadata": { "editable": true }, @@ -1362,7 +1362,7 @@ }, { "cell_type": "markdown", - "id": "7860dcff", + "id": "d09c934e", "metadata": { "editable": true }, @@ -1374,7 +1374,7 @@ }, { "cell_type": "markdown", - "id": "49244d77", + "id": "959f0516", "metadata": { "editable": true }, @@ -1384,7 +1384,7 @@ }, { "cell_type": "markdown", - "id": "2292225c", + "id": "febaa053", "metadata": { "editable": true }, @@ -1404,7 +1404,7 @@ }, { "cell_type": "markdown", - "id": "693b4fb0", + "id": "c3b76918", "metadata": { "editable": true }, @@ -1416,7 +1416,7 @@ }, { "cell_type": "markdown", - "id": "4bced371", + "id": "1d2a753c", "metadata": { "editable": true }, @@ -1426,7 +1426,7 @@ }, { "cell_type": "markdown", - "id": "afb3a588", + "id": "dc002c58", "metadata": { "editable": true }, @@ -1438,7 +1438,7 @@ }, { "cell_type": "markdown", - "id": "17f6eddb", + "id": "4c028d01", "metadata": { "editable": true }, @@ -1454,7 +1454,7 @@ }, { "cell_type": "markdown", - "id": "e5dc467a", + "id": "e8b61c3c", "metadata": { "editable": true }, @@ -1466,7 +1466,7 @@ }, { "cell_type": "markdown", - "id": "c4a41f30", + "id": "bde4c988", "metadata": { "editable": true }, @@ -1478,7 +1478,7 @@ }, { "cell_type": "markdown", - "id": "8ef9ceab", + "id": "2c5a3de4", "metadata": { "editable": true }, @@ -1488,7 +1488,7 @@ }, { "cell_type": "markdown", - "id": "c36497c7", + "id": "2d06427a", "metadata": { "editable": true }, @@ -1500,7 +1500,7 @@ }, { "cell_type": "markdown", - "id": "2f68e3b3", + "id": "bd208374", "metadata": { "editable": true }, @@ -1512,7 +1512,7 @@ }, { "cell_type": "markdown", - "id": "558485c2", + "id": "f5a1a4ef", "metadata": { "editable": true }, @@ -1524,7 +1524,7 @@ }, { "cell_type": "markdown", - "id": "57cb2be5", + "id": "2ebd58cd", "metadata": { "editable": true }, @@ -1534,7 +1534,7 @@ }, { "cell_type": "markdown", - "id": "5e5a1dc8", + "id": "36be3ad0", "metadata": { "editable": true }, @@ -1546,7 +1546,7 @@ }, { "cell_type": "markdown", - "id": "483a76aa", + "id": "3cf12272", "metadata": { "editable": true }, @@ -1556,7 +1556,7 @@ }, { "cell_type": "markdown", - "id": "1b08310e", + "id": "737cb12f", "metadata": { "editable": true }, @@ -1568,7 +1568,7 @@ }, { "cell_type": "markdown", - "id": "0bda2b6a", + "id": "a8a9261e", "metadata": { "editable": true }, @@ -1578,7 +1578,7 @@ }, { "cell_type": "markdown", - "id": "63783fe2", + "id": "6be0af92", "metadata": { "editable": true }, @@ -1590,7 +1590,7 @@ }, { "cell_type": "markdown", - "id": "6f22cf2f", + "id": "b10091d1", "metadata": { "editable": true }, @@ -1601,7 +1601,7 @@ }, { "cell_type": "markdown", - "id": "4a8e753e", + "id": "48674e40", "metadata": { "editable": true }, @@ -1613,7 +1613,7 @@ }, { "cell_type": "markdown", - "id": "ed2d3e5f", + "id": "595a9e6e", "metadata": { "editable": true }, @@ -1625,7 +1625,7 @@ }, { "cell_type": "markdown", - "id": "e39dc22c", + "id": "73a0a456", "metadata": { "editable": true }, @@ -1635,7 +1635,7 @@ }, { "cell_type": "markdown", - "id": "0db9d4f7", + "id": "9fd7cbc2", "metadata": { "editable": true }, @@ -1647,7 +1647,7 @@ }, { "cell_type": "markdown", - "id": "b8470958", + "id": "4d677ba1", "metadata": { "editable": true }, @@ -1673,7 +1673,7 @@ { "cell_type": "code", "execution_count": 2, - "id": "6bfa1ea4", + "id": "12fcace6", "metadata": { "collapsed": false, "editable": true @@ -1730,7 +1730,7 @@ }, { "cell_type": "markdown", - "id": "d9ef84b6", + "id": "eb7f7e57", "metadata": { "editable": true }, @@ -1742,7 +1742,7 @@ }, { "cell_type": "markdown", - "id": "78f48748", + "id": "2c295b10", "metadata": { "editable": true }, @@ -1754,7 +1754,7 @@ }, { "cell_type": "markdown", - "id": "9224d5f1", + "id": "a53e1b79", "metadata": { "editable": true }, @@ -1764,7 +1764,7 @@ }, { "cell_type": "markdown", - "id": "45c4747f", + "id": "56f9c15d", "metadata": { "editable": true }, @@ -1776,7 +1776,7 @@ }, { "cell_type": "markdown", - "id": "9c462d5b", + "id": "56d1e37b", "metadata": { "editable": true }, @@ -1786,7 +1786,7 @@ }, { "cell_type": "markdown", - "id": "96bb895c", + "id": "eb3fd329", "metadata": { "editable": true }, @@ -1798,7 +1798,7 @@ }, { "cell_type": "markdown", - "id": "cb40eb20", + "id": "cc9b0325", "metadata": { "editable": true }, @@ -1809,7 +1809,7 @@ }, { "cell_type": "markdown", - "id": "5bbf9e79", + "id": "0fa30cf7", "metadata": { "editable": true }, @@ -1821,7 +1821,7 @@ }, { "cell_type": "markdown", - "id": "18b6af3c", + "id": "1c08d16a", "metadata": { "editable": true }, @@ -1831,7 +1831,7 @@ }, { "cell_type": "markdown", - "id": "274baacb", + "id": "0d44a15d", "metadata": { "editable": true }, @@ -1843,7 +1843,7 @@ }, { "cell_type": "markdown", - "id": "ff3ddfa9", + "id": "e88f8ecc", "metadata": { "editable": true }, @@ -1861,7 +1861,7 @@ }, { "cell_type": "markdown", - "id": "a21e578c", + "id": "0cc660d3", "metadata": { "editable": true }, @@ -1872,7 +1872,7 @@ }, { "cell_type": "markdown", - "id": "4283508a", + "id": "03693b47", "metadata": { "editable": true }, @@ -1884,7 +1884,7 @@ }, { "cell_type": "markdown", - "id": "1946c46d", + "id": "20a53872", "metadata": { "editable": true }, @@ -1894,7 +1894,7 @@ }, { "cell_type": "markdown", - "id": "d6d2bc13", + "id": "2c3ec861", "metadata": { "editable": true }, @@ -1911,7 +1911,7 @@ }, { "cell_type": "markdown", - "id": "fcd488a4", + "id": "77f44e41", "metadata": { "editable": true }, @@ -1925,7 +1925,7 @@ }, { "cell_type": "markdown", - "id": "95fcc462", + "id": "09a4a456", "metadata": { "editable": true }, @@ -1940,7 +1940,7 @@ }, { "cell_type": "markdown", - "id": "45b6daac", + "id": "10e3a3a4", "metadata": { "editable": true }, @@ -1952,7 +1952,7 @@ }, { "cell_type": "markdown", - "id": "671e1044", + "id": "8b26bbd9", "metadata": { "editable": true }, @@ -1980,7 +1980,7 @@ }, { "cell_type": "markdown", - "id": "4c5d3311", + "id": "513fbb54", "metadata": { "editable": true }, @@ -1992,7 +1992,7 @@ }, { "cell_type": "markdown", - "id": "184e3a18", + "id": "425eeff8", "metadata": { "editable": true }, @@ -2007,7 +2007,7 @@ }, { "cell_type": "markdown", - "id": "0011f89f", + "id": "4b6914a8", "metadata": { "editable": true }, @@ -2018,7 +2018,7 @@ { "cell_type": "code", "execution_count": 3, - "id": "6fd92235", + "id": "658ca970", "metadata": { "collapsed": false, "editable": true @@ -2217,7 +2217,7 @@ }, { "cell_type": "markdown", - "id": "ccb7c9a3", + "id": "46f4bb9e", "metadata": { "editable": true }, @@ -2229,7 +2229,7 @@ }, { "cell_type": "markdown", - "id": "052eca82", + "id": "e674c7c8", "metadata": { "editable": true }, @@ -2244,7 +2244,7 @@ }, { "cell_type": "markdown", - "id": "3be97359", + "id": "6e3bbda9", "metadata": { "editable": true }, @@ -2261,7 +2261,7 @@ }, { "cell_type": "markdown", - "id": "56a6b1f5", + "id": "8e9ac2ba", "metadata": { "editable": true }, @@ -2282,7 +2282,7 @@ { "cell_type": "code", "execution_count": 4, - "id": "e371dcaf", + "id": "9884fd7b", "metadata": { "collapsed": false, "editable": true @@ -2295,7 +2295,7 @@ }, { "cell_type": "markdown", - "id": "8b6db1c5", + "id": "cdeac3ee", "metadata": { "editable": true }, @@ -2305,7 +2305,7 @@ }, { "cell_type": "markdown", - "id": "1074ba6e", + "id": "293f0f51", "metadata": { "editable": true }, @@ -2317,7 +2317,7 @@ }, { "cell_type": "markdown", - "id": "812cc05d", + "id": "327a71d8", "metadata": { "editable": true }, @@ -2332,7 +2332,7 @@ }, { "cell_type": "markdown", - "id": "eab0270e", + "id": "9b184143", "metadata": { "editable": true }, @@ -2342,7 +2342,7 @@ }, { "cell_type": "markdown", - "id": "3883c011", + "id": "facb4f1d", "metadata": { "editable": true }, @@ -2361,7 +2361,7 @@ }, { "cell_type": "markdown", - "id": "476392f8", + "id": "91730838", "metadata": { "editable": true }, @@ -2371,7 +2371,7 @@ }, { "cell_type": "markdown", - "id": "7e7fcbc9", + "id": "e7e3f557", "metadata": { "editable": true }, @@ -2383,7 +2383,7 @@ }, { "cell_type": "markdown", - "id": "0bf10947", + "id": "f8d0f139", "metadata": { "editable": true }, @@ -2393,7 +2393,7 @@ }, { "cell_type": "markdown", - "id": "0a1089ab", + "id": "16172933", "metadata": { "editable": true }, @@ -2405,7 +2405,7 @@ }, { "cell_type": "markdown", - "id": "c29cb3a3", + "id": "cf467dc4", "metadata": { "editable": true }, @@ -2415,7 +2415,7 @@ }, { "cell_type": "markdown", - "id": "ba173ff1", + "id": "70381e15", "metadata": { "editable": true }, @@ -2427,7 +2427,7 @@ }, { "cell_type": "markdown", - "id": "7511a6e4", + "id": "3200aa57", "metadata": { "editable": true }, @@ -2438,7 +2438,7 @@ }, { "cell_type": "markdown", - "id": "20dd32f8", + "id": "df6ebba2", "metadata": { "editable": true }, @@ -2450,7 +2450,7 @@ }, { "cell_type": "markdown", - "id": "a266e040", + "id": "0cec9eaf", "metadata": { "editable": true }, @@ -2462,7 +2462,7 @@ { "cell_type": "code", "execution_count": 5, - "id": "b5283e4d", + "id": "ea9e14cd", "metadata": { "collapsed": false, "editable": true @@ -2473,20 +2473,20 @@ "import numpy\n", "from cvxopt import matrix\n", "from cvxopt import solvers\n", - "P = matrix(numpy.diag([1,0]), tc=’d’)\n", - "q = matrix(numpy.array([3,4]), tc=’d’)\n", - "G = matrix(numpy.array([[-1,0],[0,-1],[-1,-3],[2,5],[3,4]]), tc=’d’)\n", - "h = matrix(numpy.array([0,0,-15,100,80]), tc=’d’)\n", + "P = matrix(numpy.diag([1,0]), tc='d')\n", + "q = matrix(numpy.array([3,4]), tc='d')\n", + "G = matrix(numpy.array([[-1,0],[0,-1],[-1,-3],[2,5],[3,4]]), tc='d')\n", + "h = matrix(numpy.array([0,0,-15,100,80]), tc='d')\n", "# Construct the QP, invoke solver\n", "sol = solvers.qp(P,q,G,h)\n", "# Extract optimal value and solution\n", - "sol[’x’] \n", - "sol[’primal objective’]" + "sol['x'] \n", + "sol['primal objective']" ] }, { "cell_type": "markdown", - "id": "e16846f4", + "id": "0a62eeaf", "metadata": { "editable": true }, @@ -2498,7 +2498,7 @@ }, { "cell_type": "markdown", - "id": "ef1a4dbe", + "id": "dffd3cdc", "metadata": { "editable": true }, @@ -2515,16 +2515,14 @@ }, { "cell_type": "markdown", - "id": "251b3924", + "id": "9970fc85", "metadata": { "editable": true }, "source": [ "subject to $\\boldsymbol{y}^T\\boldsymbol{\\lambda}=0$. Here we defined the vectors $\\boldsymbol{\\lambda} =[\\lambda_1,\\lambda_2,\\dots,\\lambda_n]$ and \n", "$\\boldsymbol{y}=[y_1,y_2,\\dots,y_n]$. \n", - "With the slack constants this leads to the additional constraint $0\\leq \\lambda_i \\leq C$.\n", - "\n", - "**code will be added**" + "With the slack constants this leads to the additional constraint $0\\leq \\lambda_i \\leq C$." ] } ], diff --git a/doc/src/week46/week46.do.txt b/doc/src/week46/week46.do.txt index a8d294653..4b718bd2d 100644 --- a/doc/src/week46/week46.do.txt +++ b/doc/src/week46/week46.do.txt @@ -1158,15 +1158,15 @@ The following code solves the equations for us import numpy from cvxopt import matrix from cvxopt import solvers -P = matrix(numpy.diag([1,0]), tc=’d’) -q = matrix(numpy.array([3,4]), tc=’d’) -G = matrix(numpy.array([[-1,0],[0,-1],[-1,-3],[2,5],[3,4]]), tc=’d’) -h = matrix(numpy.array([0,0,-15,100,80]), tc=’d’) +P = matrix(numpy.diag([1,0]), tc='d') +q = matrix(numpy.array([3,4]), tc='d') +G = matrix(numpy.array([[-1,0],[0,-1],[-1,-3],[2,5],[3,4]]), tc='d') +h = matrix(numpy.array([0,0,-15,100,80]), tc='d') # Construct the QP, invoke solver sol = solvers.qp(P,q,G,h) # Extract optimal value and solution -sol[’x’] -sol[’primal objective’] +sol['x'] +sol['primal objective'] !ec !split @@ -1187,7 +1187,6 @@ subject to $\bm{y}^T\bm{\lambda}=0$. Here we defined the vectors $\bm{\lambda} = $\bm{y}=[y_1,y_2,\dots,y_n]$. With the slack constants this leads to the additional constraint $0\leq \lambda_i \leq C$. -_code will be added_