Le 27/09/2014 01:19, Santiago Chialvo a écrit :
Hi, first of all, sorry for my english, it's not good enough. I'm using Scilab 5.5.0 Version, and I found a problem that I don't understand how it works.

First of all, when I do the operation

R = A/B;

With A = Scalar and B = Vector, the result that gives me is a R vector that satisfy:

R*B = A;

But, my question is, how does it works? I mean, we have

R(1)*B(1) + R(2)*B(2) .... + R(N)*B(N) = A;

Where we know the value of the components of B, and the value of A, but it's only 1 equation with N unknowns!

How does it works, to have the values of R? Thanks,
As the problem is underdetermined the equation as an infinity of solutions as follow. I will describe the process with the equivalent equation B'*R'=A that can be written suing standard notations as X*A=B, where A is a column vector X the row vector of the unknowns A can be factored as the product Q*R where Q is an othonormal square matrix and R a column vector whose all elements but the first one are zeros So the equation X*A=B can be rewritten (X*Q)*R=B or Y*R=B, all Y of the form [B/R(1),y2,....yn] are solutions, and consequently all X= [B/R(1),y2,....yn]*Q' are solutions of the initial equation

Example
-->A=(1:5)';B=4.5;
-->[Q,R]=qr(A);R
-->Y=[B/R(1),rand(1,4)];
-->Y*R-B
 ans  =
    0.
 -->X=Y*Q'
-->X*A-B
 ans  =
  - 8.882D-16

The particular solution computed by B/A serach for y2...yn that maximize the number of 0 in the solution X.

Serge
Santiago.


_______________________________________________
dev mailing list
dev@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
dev@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/dev

Reply via email to