[Scilab-users] a linear equation

classic Classic list List threaded Threaded
9 messages Options
fujimoto2005 fujimoto2005
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] a linear equation

This post was updated on .
I am trying to solve linear equations with 30 unknown variables.
Since the determinant of the coefficient matrix is 0, I can tell that some row vectors
are linearly dependent on other row vectors. I want to solve the problem by
deleting the linearly dependent rows while simultaneously changing the
variables to exogenous variables.
So I want to find independent row vectors of the coefficient matrix whose number equals to the rank of the coefficient matrix.
Is there any way to find out such independent row vectors?

Best regards.



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
mottelet mottelet
Reply | Threaded
Open this post in threaded view
|

Re: a linear equation

Hello

Do you just want one of the solutions, e.g. of minimum norm, or do you want more precision on the nullspace ?

S.

> Le 2 déc. 2018 à 09:43, fujimoto2005 <[hidden email]> a écrit :
>
> I am trying to solve linear equations with 30 variables. Since the
> determinant of the coefficient matrix is 0, I can tell that some row vectors
> are linearly dependent on other row vectors. I want to solve the problem by
> deleting the linearly dependent rows while simultaneously changing the
> variables to exogenous variables.
> But I can't find which row vector expresses redundant constraints.  
> Is there any way to find out which row is linearly dependent?
>
> Best regards.
>
>
>
> --
> Sent from: https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
> _______________________________________________
> users mailing list
> [hidden email]
> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
fujimoto2005 fujimoto2005
Reply | Threaded
Open this post in threaded view
|

Re: a linear equation

This problem is an economic problem. The i-th row of the square constraint
matrix A with m dimension expresses certain economic constraints.
The elements of the constraint matrix are either 0 or 1.
Suppose the rank of A is r and by changing the row number a_1, ..., a_r are
linearly independent.
I guess the coefficient cj (1 ≤ j ≤ r) in a_i = c1 * a_1 + ... cr * a_r for
any m>=i> r is found to be 0, -1, 1 for some economic reasons.
I would like to find such a_1, ..., a_r pairs.

The following matrix is the constraint matrix which I am dealing with.

A=zeros(27,27)

A(1,10)=1
A(2,5)=1
A(3,14)=1
A(4,23)=1
A(5,9)=1
A(6,18)=1
A(7,27)=1
A(8,17)=1
A(9,1)=0,A(9,18)=1
A(10,2)=1,A(10,3)=1
A(11,4)=1,A(11,5)=1,A(11,6)=1
A(12,7)=1,A(12,8)=1,A(12,9)=1
A(13,10)=1,A(13,11)=1,A(13,12)=1
A(14,13)=1,A(14,14)=1,A(14,15)=1
A(15,19)=1,A(15,20)=1,A(15,21)=1
A(16,22)=1,A(16,23)=1,A(16,24)=1
A(17,1)=0,A(17,25)=1,A(17,26)=1,A(17,27)=1
A(18,4)=1,A(18,7)=1
A(19,2)=1,A(19,5)=1,A(19,8)=1
A(20,10)=1,A(20,13)=1,A(20,16)=1
A(21,11)=1,A(21,14)=1,A(21,17)=1
A(22,19)=1,A(22,22)=1,A(22,25)=1
A(23,1)=0,A(23,20)=1,A(23,23)=1,A(23,26)=1
A(24,4)=1,A(24,7)=1
A(25,2)=1,A(25,5)=1,A(25,8)=1
A(26,10)=1,A(26,13)=1,A(26,16)=1
A(27,20)=1,A(27,23)=1,A(27,26)=1

Best regards.



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
charle iwuji charle iwuji
Reply | Threaded
Open this post in threaded view
|

Re: a linear equation

Please I want to ask a question. Please I have been trying to export a graphic from scilab to an MS word document. How do I do that? Please help. Thanks


On Sun, Dec 2, 2018 at 5:57 PM, fujimoto2005
This problem is an economic problem. The i-th row of the square constraint
matrix A with m dimension expresses certain economic constraints.
The elements of the constraint matrix are either 0 or 1.
Suppose the rank of A is r and by changing the row number a_1, ..., a_r are
linearly independent.
I guess the coefficient cj (1 ≤ j ≤ r) in a_i = c1 * a_1 + ... cr * a_r for
any m>=i> r is found to be 0, -1, 1 for some economic reasons.
I would like to find such a_1, ..., a_r pairs.

The following matrix is the constraint matrix which I am dealing with.

A=zeros(27,27)

A(1,10)=1
A(2,5)=1
A(3,14)=1
A(4,23)=1
A(5,9)=1
A(6,18)=1
A(7,27)=1
A(8,17)=1
A(9,1)=0,A(9,18)=1
A(10,2)=1,A(10,3)=1
A(11,4)=1,A(11,5)=1,A(11,6)=1
A(12,7)=1,A(12,8)=1,A(12,9)=1
A(13,10)=1,A(13,11)=1,A(13,12)=1
A(14,13)=1,A(14,14)=1,A(14,15)=1
A(15,19)=1,A(15,20)=1,A(15,21)=1
A(16,22)=1,A(16,23)=1,A(16,24)=1
A(17,1)=0,A(17,25)=1,A(17,26)=1,A(17,27)=1
A(18,4)=1,A(18,7)=1
A(19,2)=1,A(19,5)=1,A(19,8)=1
A(20,10)=1,A(20,13)=1,A(20,16)=1
A(21,11)=1,A(21,14)=1,A(21,17)=1
A(22,19)=1,A(22,22)=1,A(22,25)=1
A(23,1)=0,A(23,20)=1,A(23,23)=1,A(23,26)=1
A(24,4)=1,A(24,7)=1
A(25,2)=1,A(25,5)=1,A(25,8)=1
A(26,10)=1,A(26,13)=1,A(26,16)=1
A(27,20)=1,A(27,23)=1,A(27,26)=1

Best regards.



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
fujimoto2005 fujimoto2005
Reply | Threaded
Open this post in threaded view
|

Re: a linear equation

In reply to this post by mottelet
Hi mottelet.
Thank you for the question.

I'm happy if all possible solutions are available. Since the rank is known
to be 22, the number of solutions is 27Conb22 = 80730 or less, but if the
number is small, I think I can find "basic" constraints that is economically
meaningful.

If it is impossible, if even one solution is found, then it may be possible
to follow a chain from the economic relationship to the basic constraints.

Best regards.



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Tim Wescott Tim Wescott
Reply | Threaded
Open this post in threaded view
|

Re: a linear equation

In reply to this post by fujimoto2005
Is there a reason not to do SVD, and throw out the singular values that
are too small?

On Sun, 2018-12-02 at 09:56 -0700, fujimoto2005 wrote:

> This problem is an economic problem. The i-th row of the square
> constraint
> matrix A with m dimension expresses certain economic constraints.
> The elements of the constraint matrix are either 0 or 1.
> Suppose the rank of A is r and by changing the row number a_1, ...,
> a_r are
> linearly independent. 
> I guess the coefficient cj (1 ≤ j ≤ r) in a_i = c1 * a_1 + ... cr *
> a_r for
> any m>=i> r is found to be 0, -1, 1 for some economic reasons.
> I would like to find such a_1, ..., a_r pairs.
>
> The following matrix is the constraint matrix which I am dealing
> with.
>
> A=zeros(27,27)
>
> A(1,10)=1
> A(2,5)=1
> A(3,14)=1
> A(4,23)=1
> A(5,9)=1
> A(6,18)=1
> A(7,27)=1
> A(8,17)=1
> A(9,1)=0,A(9,18)=1
> A(10,2)=1,A(10,3)=1
> A(11,4)=1,A(11,5)=1,A(11,6)=1
> A(12,7)=1,A(12,8)=1,A(12,9)=1
> A(13,10)=1,A(13,11)=1,A(13,12)=1
> A(14,13)=1,A(14,14)=1,A(14,15)=1
> A(15,19)=1,A(15,20)=1,A(15,21)=1
> A(16,22)=1,A(16,23)=1,A(16,24)=1
> A(17,1)=0,A(17,25)=1,A(17,26)=1,A(17,27)=1
> A(18,4)=1,A(18,7)=1
> A(19,2)=1,A(19,5)=1,A(19,8)=1
> A(20,10)=1,A(20,13)=1,A(20,16)=1
> A(21,11)=1,A(21,14)=1,A(21,17)=1
> A(22,19)=1,A(22,22)=1,A(22,25)=1
> A(23,1)=0,A(23,20)=1,A(23,23)=1,A(23,26)=1
> A(24,4)=1,A(24,7)=1
> A(25,2)=1,A(25,5)=1,A(25,8)=1
> A(26,10)=1,A(26,13)=1,A(26,16)=1
> A(27,20)=1,A(27,23)=1,A(27,26)=1
>
> Best regards.
>
>
>
> --
> Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-
> Archives-f2602246.html
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
--

Tim Wescott
www.wescottdesign.com
Control & Communications systems, circuit & software design.
Phone: 503.631.7815
Cell:  503.349.8432



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
fujimoto2005 fujimoto2005
Reply | Threaded
Open this post in threaded view
|

Re: a linear equation

In reply to this post by fujimoto2005
Sorry, I was werong with the constraint matrix.

The right values are as follows.

A=zeros(27,27)

A(1,10)=1
A(1,10)=1
A(2,5)=1
A(3,14)=1
A(4,23)=1
A(5,7)=1
A(6,16)=1
A(7,25)=1
A(8,17)=1
A(9,1)=0,A(9,18)=1
A(10,2)=1,A(10,3)=1
A(11,4)=1,A(11,5)=1,A(11,6)=1
A(12,7)=1,A(12,8)=1,A(12,9)=1
A(13,10)=1,A(13,11)=1,A(13,12)=1
A(14,13)=1,A(14,14)=1,A(14,15)=1
A(15,19)=1,A(15,20)=1,A(15,21)=1
A(16,22)=1,A(16,23)=1,A(16,24)=1
A(17,1)=0,A(17,25)=1,A(17,26)=1,A(17,27)=1
A(18,4)=1,A(18,7)=1
A(19,2)=1,A(19,5)=1,A(19,8)=1
A(20,10)=1,A(20,13)=1,A(20,16)=1
A(21,11)=1,A(21,14)=1,A(21,17)=1
A(22,19)=1,A(22,22)=1,A(22,25)=1
A(23,1)=0,A(23,20)=1,A(23,23)=1,A(23,26)=1
A(24,10)=1,A(24,19)=1
A(25,2)=1,A(25,11)=1,A(25,20)=1
A(26,4)=1,A(26,13)=1,A(26,22)=1
A(27,8)=1,A(27,17)=1,A(27,26)=1

Best regards.



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
fujimoto2005 fujimoto2005
Reply | Threaded
Open this post in threaded view
|

Re: a linear equation

In reply to this post by Tim Wescott
Dear Wescot

I know how to approximate A with SVD, but I do not know how to find
independent row vectors of A.
How can I do?

Best regards.



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
fujimoto2005 fujimoto2005
Reply | Threaded
Open this post in threaded view
|

Re: a linear equation

Dear all
I found a solution.
I get the column echelon form of A  by X=rref(A')'.
Then the rows' numbers with the non-zero pivot of X are the independent
rows' numbers of A.

In this problem 26th row and 27th row are redundant.
26th rows are represented by linear combinations of 24th row and 1st-23rd
rows.
27th rows are represented by a linear combination of 25th row and 1st-23rd
rows.

Best regards.



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users