def createMLCP_fromFile(): mlcp=N.MLCP() N.mixedLinearComplementarity_newFromFilename(mlcp, os.path.join(working_dir, "data/diodeBridge_mlcp.dat")) zsol =np.array([ 9.85185185e-01, 9.85185185e-01, -0.00000000e+00, 9.85185185e-04, 0.00000000e+00, 0.00000000e+00, 9.85185185e-04]) return (mlcp, zsol)
def createMLCP_small(): # basic interface # Murty88, p2 M = np.array([[2., 1.], [1., 2.]]) q = np.array([-5., -6.]) # solution zsol = np.array([4. / 3., 7. / 3.]) # problem mlcp = sn.MLCP(1, M, q) return (mlcp, zsol)
def createMLCP_large(): zsol = np.array([ 9.85185185e-01, 9.85185185e-01, -0.00000000e+00, 9.85185185e-04, 0.00000000e+00, 0.00000000e+00, 9.85185185e-04 ]) M = np.array( [[ 0.00000000e+00, -1.00000000e-03, 1.00000000e-03, 0.00000000e+00, 1.00000000e+00, 0.00000000e+00, 1.00000000e+00 ], [ 0.00000000e+00, 1.00000000e-03, -1.00000000e-03, -1.00000000e+00, 0.00000000e+00, -1.00000000e+00, 0.00000000e+00 ], [ -1.00250000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 1.00000000e+01, -1.00000000e+01 ], [ 0.00000000e+00, 0.00000000e+00, -1.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00 ], [ 0.00000000e+00, 1.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00 ], [ 1.00000000e+00, 0.00000000e+00, -1.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00 ], [ -1.00000000e+00, 1.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00 ]]) q = np.array([[0.], [0.], [0.9975], [0.], [0.], [0.], [0.]]) mlcp = sn.MLCP(3, M, q) return (mlcp, zsol)