Singular matrix C in LSQ subproblem是什么原因 80C

from scipy import optimize as opt
import numpy as np
def func(X,G):
sum=0.0
for i in np.arange(G.shape[0]):
sum=sum+X[3*i]
return -1*sum
def sigma(X,G,i):
sum=0.0
for j in np.arange(G.shape[0]):
sum=sum+G[i,j]*X[3*j+2]
return sum*X[3*i+2]
def Cons1(G):
cons=()
for i in np.arange(G.shape[0]):
cons=np.append(cons,{'type':'eq','fun':lambda X:X[3*i]-X[3*i+1]-sigma(X,G,i)})
return cons
def Cons2(G,I):
cons=()
for i in np.arange(G.shape[0]):
for j in np.arange(i,G.shape[0]):
cons=np.append(cons,{'type':'ineq','fun':lambda X:I[i,j]-(X[3*i+2]-X[3*j+2])*G[i,j]})
cons=np.append(cons,{'type':'ineq','fun':lambda X:(X[3*i+2]-X[3*j+2])*G[i,j]+I[i,j]})
return cons
def bou(G,P,vn,Pg):
bounds=np.mat(np.zeros([3*G.shape[0],2]))
for i in np.arange(G.shape[0]):
bounds[3*i,:]=Pg[i,:]
bounds[3*i+1,0]=0
bounds[3*i+1,1]=P[0,i]
bounds[3*i+2,0]=0.95*vn
bounds[3*i+2,1]=1.05*vn
return bounds
def x_start(G,P,vn,Pg):
x0=np.array(np.zeros([1,3*G.shape[0]]))
for i in np.arange(G.shape[0]):
x0[0,i]=float((Pg[i,0]+Pg[i,1]))/2
x0[0,i+1]=P[0,i]
x0[0,i+2]=vn
return x0
def opf(G,I,P,vn,Pg):
b=bou(G,P,vn,Pg)
cons=Cons1(G)
cons=np.append(cons,Cons2(G,I))
x=x_start(G,P,vn,Pg)
res=opt.minimize(func, args=(G),x0=x,bounds=b,constraints=cons,method='SLSQP',options={'disp': True})
return res.x
#以下为输入数据：
G=np.mat([[1/0.64,0,-1/0.64,0,0],
[0,1/0.8+1/0.8+1/0.5,-1/0.8,-1/0.8,-1/0.5],
[-1/0.64,-1/0.8,1/0.64+1/0.8+1/1.6,-1/1.6,0],
[0,-1/0.8,-1/1.6,1/1.6+1/0.8+1,-1],
[0,-1/0.5,0,-1,1/0.5+1]])
I=np.mat([[0,0,1000,0,0],
[0,0,1000,1000,1000],
[1000,1000,0,1000,0],
[0,1000,1000,0,1000],
[0,1000,0,1000,0]])
P=np.mat([0,0,1000,800,0.1])
vn=250
Pg=np.mat([[300,400],[1100,1200],[0,0],[0,0],[200,300]])
print(opf(G,I,P,vn,Pg))

1个回答

baba_822 这个链接里面并没有说怎么解决，也是提出了一个和我类似的问题！

SVT：A Singular Value Thresholding Algorithm For Matrix Completion.pdf

Lsq一个MVC-CRUD例子
Lsq一个MVC-CRUD例子 希望可以帮助大家
matrix[0,:] 是什么意思
matrix[0,:]=line[0:3] 其中matrix[0 , :]代表什么？
singular control systems

C sharp matrix library
C# matrix library used for VS.NET C# matrix library used for VS.NET
C - Matrix(匈牙利 最大匹配数)
Give you a matrix(only contains 0 or 1),every time you can select a row or a column and delete all the '1' in this row or this column . Your task is to give out the minimum times of deleting all the '...
Meschach Matrix Computations in C
C语言的矩阵库——Meschach的说明书，Meschach Matrix Computations in C

<>是什么原因

Singular Control Systems
1989年，Dm L Y系统地总结了众学者和他本人的研究成果，出版了{Singular Control Systems》一书 详细地介绍了广义系统的基本理论

Meschach: Matrix Computations in C
C语言矩阵运算库Meschach使用文档，由David E. Stewart和Zbigniew Leyk编写。 清晰，带目录，
singular value decomposition tutorial
singular value decomposition tutorial，适用于engineering的学生，在工程中有广泛应用
Cygwin完全安装以后的Singular CAS: 到底什么是Singular?

C:/WINDOWS/winsg3a.dll加载出错是什么原因？
C:/WINDOWS/winsg3a.dll加载出错是什么原因？打开电脑后一段时间一出现，该怎么解决？

AS不能新建cpp和c文件是什么原因

Convolution Calder´on-Zygmund singular integral
Convolution Calder´on-Zygmund singular integralConvolution Calder´on-Zygmund singular integral
The Singular Value Decomposition, Applications and Beyond
The Singular Value Decomposition, Applications and Beyond 张志华的大牛作，适合有英文基础的
C语言处理Matrix的代码

Singular Value Decomposition source code
powerful set of techniques for dealing with sets of equations or matrices. In many cases where Gaussian elimination and LU decomposition fail to give satisfactory results, this set of techniques, known as singular value decomposition, or SVD, will diagnose for you precisely what the problem is. In some cases, SVD will not only diagnose the problem, it will also solve it.
AN IMAGE WATERMARKING METHOD BASED ON THE SINGULAR
A robust image watermarking scheme in which a binary image is embedded in the singular values of selected DWT blocks in the horizontal and vertical sub-bands of a 1-level decomposition of a gray-scale image is proposed. The embedded blocks are selected by a secret key to enhance imperceptibility. A watermarked image that is perceptually indistinguishable from the original is obtained. The watermarking retrieval is non-blind and requires the use of parameters extracted during the watermarking process. The performance of the proposed algorithm is tested by comparing the retrieved watermark to the original watermark. Computer simulation results show that the algorithm is robust to common signal processing attacks such as Gaussian noise, cropping, and low pass filtering. It is also resistant to JPEG compression.
A multilinear singular value decomposition.pdf
We discuss a multilinear generalization of the singular value decomposition. There is a strong analogy between several properties of the matrix and the higher-order tensor decomposition; uniqueness, link with the matrix eigenvalue decomposition, first-order perturbation effects, etc., are analyzed. We investigate how tensor symmetries affect the decomposition and propose a multilinear generalization of the symmetric eigenvalue decomposition for pair-wise symmetric tensors
Matrix
Java写的仿Matrix的小程序<br>（骇客帝国中电脑屏幕上出现的神秘文字）
matrix
用于矩阵计算　　我不太会用
The Matrix
The Matrix

rn bmp:=Tbitmap.Create;rn mem:=cds.CreateBlobStream(cds.Fieldbyname('Graphic'),bmread);rn mem.Position:=0;rn[color=#FF0000] bmp.LoadFromStream(mem);[/color] 当运行到这里的时候 出现raised exception class EinvalidGraphic with message 'bitmap image is not valid'.process stoppedrn image1.Picture.Assign(bmp);rn bmp.Free;rn mem.Free ;rnrnrn如何解决
cmake编译错误是什么原因？？？
1>CMake is re-running because D:/MyGUI/Build/CMakeFiles/generate.stamp dependency file is missing.rn1>CMake Error: The source directory "D:/mygui" does not appear to contain CMakeLists.txt.rn1>Specify --help for usage, or press the help button on the CMake GUI.rn1>Project : error PRJ0019: 工具从"Checking Build System"

[code=php][/code]rn上面的写法为啥当文件test.txt是0字节的时候提示这个呢rn[b][color=#FF0000]Warning: fread() [function.fread]: Length parameter must be greater than 0 in D:\APMServ5.2.6\www\htdocs\01\file.php on line 7[/color][/b]rnrn另外上面和下面这两种读取方式哪个更好点rn[code=php]",\$con);rn echo \$con;rn?>[/code]

internal interface IFormViewrn rn abstract event UpdateCommandEventHandler UpdateCommand;rnrn ViewController Controller get; rnrn System.Windows.Forms.Form Form get; rnrn IFormPanel TaskPanel get; rnrn rnrn public delegate void UpdateCommandEventHandler(object sender, EventArgsViewCommand e);rn rn rnrn错误：rnUpdateCommandEventHandler 接口不能声明类型，应怎么改？

C:\Documents and Settings\俊\桌面\1\RPG.cpp(588) : error C2440: '=' : cannot convert from 'void *' to 'struct HBRUSH__ *'rn Conversion from 'void*' to pointer to non-'void' requires an explicit castrnError executing cl.exe.rnrn请问什么错误？怎么解决？rnrn

1 我的SQL7 在2000P下没有问题,可是在2000S下打开表(open table ->return all rows)的时候总是出现一个错误"无法定位程序输入点.....(一长串字符) 于mdt2fw.DLL 上" ,使用"SQL Server Query Analyzer"查询数据却没有问题， 这是什么原因？是不是sql7 不能在2000server下正常运行？ rn2 以前针对sql7做的程序，如果改用SQL2000来做后台数据库，程序需不需要改动？rnrn盼高手指点。rn