Octave 倍频程:能解有多解或无解的线性系统吗? 八度音阶能识别出没有解决方案的线性系统,并发出这样的信息吗 八度音阶能“解”出有许多解的线性系统并描述解集吗

Octave 倍频程:能解有多解或无解的线性系统吗? 八度音阶能识别出没有解决方案的线性系统,并发出这样的信息吗 八度音阶能“解”出有许多解的线性系统并描述解集吗,octave,linear-algebra,Octave,Linear Algebra,这里有两个倍频程输出的例子,对我没有帮助。有没有其他方法可以要求八度音阶获得所需的输出 无解决方案: octave:13> A=[1,1,1;1,1,1] A = 1 1 1 1 1 1 octave:14> b=[0;1] b = 0 1 octave:15> A\b ans = 0.16667 0.16667 0.16667 无穷多解:取自()2.13(第16页) 我不知道是否有任

这里有两个倍频程输出的例子,对我没有帮助。有没有其他方法可以要求八度音阶获得所需的输出

无解决方案:

octave:13> A=[1,1,1;1,1,1] 
A =   
   1   1   1
   1   1   1   

octave:14> b=[0;1]
b =    
   0
   1

octave:15> A\b
ans =    
   0.16667
   0.16667
   0.16667
无穷多解:取自()2.13(第16页)


我不知道是否有任何内置函数可以检查您想要的内容,但对于第一个问题,您可以编写代码自己检查。您需要查看将扩充矩阵放入行缩减梯队形式(rref)后是否发生了矛盾。您可以通过查看是否对于任何行,所有变量都是0,但常量不是0来实现这一点。这意味着0*x1+0*x2+。。。0*xn不等于零(矛盾)。我相信下面的代码会检查这一点

%function [feasible, x] = isfeasible(A,b)
%checks if Ax = b is feasible (a solution exists)
%and returns the solution if it exits
%input
%A: M x N matrix representing the variables in each equation, with one equation per row
%b: N X 1 vector of the constants
%output
%feasible: 1 if a solution exists, 0 otherwise
%x: N x 1 vector containing the values of the variables
function [feasible, x] = isfeasible(A,b)
  feasible = 1; %assume function is feasible
  Rref = rref([A,b]); %put the augmented matrix into row reduced echelon form
  x = Rref(:,end); %these are the values that the variables should be to solve the set of equations
  variableSums = sum(abs(Rref(:,1:(end-1))),2);
  if(any((variableSums == 0) & (abs(x) ~= 0))) %a contradiction has occurred.
    feasible = 0; %this means that 0 * all the variables is not 0
  endif
endfunction 
至于你的第二个问题,如果在将增广矩阵[A,b]放入行缩减梯队形式后,任何行都有超过1列(不包括最后一列)的非零值,那么你的方程组有不止一个解。倍频程可以解决这个问题,并且可以描述解决方案集的特征。你所要做的就是重新引用([A,b]),然后阅读你得到的解决方案

在我发现的示例中使用rref rref([M,n])=

这意味着

x=w+0.5*u

y=4-w-u

z=3*w+0.5*u

%function [feasible, x] = isfeasible(A,b)
%checks if Ax = b is feasible (a solution exists)
%and returns the solution if it exits
%input
%A: M x N matrix representing the variables in each equation, with one equation per row
%b: N X 1 vector of the constants
%output
%feasible: 1 if a solution exists, 0 otherwise
%x: N x 1 vector containing the values of the variables
function [feasible, x] = isfeasible(A,b)
  feasible = 1; %assume function is feasible
  Rref = rref([A,b]); %put the augmented matrix into row reduced echelon form
  x = Rref(:,end); %these are the values that the variables should be to solve the set of equations
  variableSums = sum(abs(Rref(:,1:(end-1))),2);
  if(any((variableSums == 0) & (abs(x) ~= 0))) %a contradiction has occurred.
    feasible = 0; %this means that 0 * all the variables is not 0
  endif
endfunction 
      x         y         z         w         u      constant
   1.00000   0.00000   0.00000  -1.00000  -0.50000   0.00000
   0.00000   1.00000   0.00000   1.00000   1.00000   4.00000
   0.00000   0.00000   1.00000  -3.00000  -0.50000  -0.00000