- #1
aheight
- 320
- 108
Hi,
I am using Solve to solve a system of linear equations with more unknowns than equations. For example, I have 36 variables and Solve returns 30 equations. Six of the variables I can assign a value of one. But I can only figure out which ones are arbitrary by manually looking at the equations. In the example below, the subscripts 0, 1,2, 10, 11, and 12 are arbitrary. But I would want to solve larger systems and manually looking for the arbitrary variables is not practical. Just to make the notation clear, the subscripts are 0,1,2,3,4,5,10,11,12,13,14,15,20,21,22,23 24,25 and so on for a total of 36.
Would someone know of a way that I can programatically determine which ones are arbitrary and then assign them for example a value of one and then get the rest of them?
Thanks for reading.
##\left\{\left\{s_3\to -10 s_0-6 s_1-3 s_2,s_4\to 15 s_0+8 s_1+3 s_2,s_5\to -6 s_0-3 s_1-s_2,s_{13}\to -40 s_0-16 s_1-4 s_2-10 s_{10}-6 s_{11}-3 s_{12},s_{14}\to 80 s_0+32 s_1+8 s_2+15 s_{10}+8 s_{11}+3 s_{12},s_{15}\to -40 s_0-16 s_1-4 s_2-6 s_{10}-3 s_{11}-s_{12},s_{20}\to -10 s_0-4 s_{10},s_{21}\to -20 s_0-10 s_1-4 s_{10}-4 s_{11},s_{22}\to -30 s_0-20 s_1-10 s_2-4 s_{10}-4 s_{11}-4 s_{12},s_{23}\to 220 s_0+94 s_1+26 s_2+36 s_{10}+20 s_{11}+8 s_{12},s_{24}\to -160 s_0-64 s_1-16 s_2-24 s_{10}-12 s_{11}-4 s_{12},s_{25}\to 0,s_{30}\to 20 s_0+6 s_{10},s_{31}\to 60 s_0+20 s_1+12 s_{10}+6 s_{11},s_{32}\to 120 s_0+60 s_1+20 s_2+18 s_{10}+12 s_{11}+6 s_{12},s_{33}\to -240 s_0-96 s_1-24 s_2-36 s_{10}-18 s_{11}-6 s_{12},s_{34}\to 0,s_{35}\to 0,s_{40}\to -15 s_0-4 s_{10},s_{41}\to -61 s_0-15 s_1-12 s_{10}-4 s_{11},s_{42}\to -154 s_0-61 s_1-15 s_2-24 s_{10}-12 s_{11}-4 s_{12},s_{43}\to 0,s_{44}\to 0,s_{45}\to 0,s_{50}\to 4 s_0+s_{10},s_{51}\to 16 s_0+4 s_1+3 s_{10}+s_{11},s_{52}\to 40 s_0+16 s_1+4 s_2+6 s_{10}+3 s_{11}+s_{12},s_{53}\to 0,s_{54}\to 0,s_{55}\to 0\right\}\right\}
##
And here is what I get when I assign the arbitrary ones to a value of one:
##\left\{\left\{s_3\to -19,s_4\to 26,s_5\to -10,s_{13}\to -79,s_{14}\to 146,s_{15}\to -70,s_{20}\to -14,s_{21}\to -38,s_{22}\to -72,s_{23}\to 404,s_{24}\to -280,s_{25}\to 0,s_{30}\to 26,s_{31}\to 98,s_{32}\to 236,s_{33}\to -420,s_{34}\to 0,s_{35}\to 0,s_{40}\to -19,s_{41}\to -92,s_{42}\to -270,s_{43}\to 0,s_{44}\to 0,s_{45}\to 0,s_{50}\to 5,s_{51}\to 24,s_{52}\to 70,s_{53}\to 0,s_{54}\to 0,s_{55}\to 0\right\}\right\}
##
I am using Solve to solve a system of linear equations with more unknowns than equations. For example, I have 36 variables and Solve returns 30 equations. Six of the variables I can assign a value of one. But I can only figure out which ones are arbitrary by manually looking at the equations. In the example below, the subscripts 0, 1,2, 10, 11, and 12 are arbitrary. But I would want to solve larger systems and manually looking for the arbitrary variables is not practical. Just to make the notation clear, the subscripts are 0,1,2,3,4,5,10,11,12,13,14,15,20,21,22,23 24,25 and so on for a total of 36.
Would someone know of a way that I can programatically determine which ones are arbitrary and then assign them for example a value of one and then get the rest of them?
Thanks for reading.
##\left\{\left\{s_3\to -10 s_0-6 s_1-3 s_2,s_4\to 15 s_0+8 s_1+3 s_2,s_5\to -6 s_0-3 s_1-s_2,s_{13}\to -40 s_0-16 s_1-4 s_2-10 s_{10}-6 s_{11}-3 s_{12},s_{14}\to 80 s_0+32 s_1+8 s_2+15 s_{10}+8 s_{11}+3 s_{12},s_{15}\to -40 s_0-16 s_1-4 s_2-6 s_{10}-3 s_{11}-s_{12},s_{20}\to -10 s_0-4 s_{10},s_{21}\to -20 s_0-10 s_1-4 s_{10}-4 s_{11},s_{22}\to -30 s_0-20 s_1-10 s_2-4 s_{10}-4 s_{11}-4 s_{12},s_{23}\to 220 s_0+94 s_1+26 s_2+36 s_{10}+20 s_{11}+8 s_{12},s_{24}\to -160 s_0-64 s_1-16 s_2-24 s_{10}-12 s_{11}-4 s_{12},s_{25}\to 0,s_{30}\to 20 s_0+6 s_{10},s_{31}\to 60 s_0+20 s_1+12 s_{10}+6 s_{11},s_{32}\to 120 s_0+60 s_1+20 s_2+18 s_{10}+12 s_{11}+6 s_{12},s_{33}\to -240 s_0-96 s_1-24 s_2-36 s_{10}-18 s_{11}-6 s_{12},s_{34}\to 0,s_{35}\to 0,s_{40}\to -15 s_0-4 s_{10},s_{41}\to -61 s_0-15 s_1-12 s_{10}-4 s_{11},s_{42}\to -154 s_0-61 s_1-15 s_2-24 s_{10}-12 s_{11}-4 s_{12},s_{43}\to 0,s_{44}\to 0,s_{45}\to 0,s_{50}\to 4 s_0+s_{10},s_{51}\to 16 s_0+4 s_1+3 s_{10}+s_{11},s_{52}\to 40 s_0+16 s_1+4 s_2+6 s_{10}+3 s_{11}+s_{12},s_{53}\to 0,s_{54}\to 0,s_{55}\to 0\right\}\right\}
##
And here is what I get when I assign the arbitrary ones to a value of one:
##\left\{\left\{s_3\to -19,s_4\to 26,s_5\to -10,s_{13}\to -79,s_{14}\to 146,s_{15}\to -70,s_{20}\to -14,s_{21}\to -38,s_{22}\to -72,s_{23}\to 404,s_{24}\to -280,s_{25}\to 0,s_{30}\to 26,s_{31}\to 98,s_{32}\to 236,s_{33}\to -420,s_{34}\to 0,s_{35}\to 0,s_{40}\to -19,s_{41}\to -92,s_{42}\to -270,s_{43}\to 0,s_{44}\to 0,s_{45}\to 0,s_{50}\to 5,s_{51}\to 24,s_{52}\to 70,s_{53}\to 0,s_{54}\to 0,s_{55}\to 0\right\}\right\}
##