Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168729
Image: ubuntu2004
RealNumber=float Integer=int from cvxopt.base import matrix from cvxopt import solvers c=matrix([6.0,1,13]) A=matrix([[1.0,0,1,-1,0,0],[0,1,1,0,-1,0],[0,0,1,0,0,-1]]) b=matrix([300.0,200,400,0,0,0]) sol=solvers.lp(-c,A,b) print sol['x']
pcost dcost gap pres dres k/t 0: -1.8250e+03 -9.4750e+03 5e+03 0e+00 8e-01 1e+00 1: -4.5896e+03 -8.8278e+03 4e+03 1e-16 5e-01 3e+02 2: -5.0846e+03 -5.2649e+03 2e+02 8e-17 2e-02 2e+01 3: -5.1988e+03 -5.2007e+03 2e+00 2e-16 2e-04 2e-01 4: -5.2000e+03 -5.2000e+03 2e-02 8e-17 2e-06 2e-03 5: -5.2000e+03 -5.2000e+03 2e-04 2e-16 2e-08 2e-05 1.0334e-05 2.9019e-07 4.0000e+02