Building a coefficient matrix for a system of equations

Click For Summary

Discussion Overview

The discussion revolves around constructing a coefficient matrix for a system of equations involving known coefficients (M) and unknown coefficients (f, m, s). Participants explore methods for organizing these equations to facilitate solving for the unknowns, considering both algebraic manipulation and numerical approaches.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant outlines a system of equations and expresses a desire to build a coefficient matrix for solving unknowns through inversion, questioning the arrangement of coefficients.
  • Another participant suggests combining equations to simplify the process and reduce the number of equations for the unknowns.
  • A participant emphasizes the importance of starting with a naive approach to establish a working solution, noting that the coefficient matrix does not need to be square.
  • Concerns are raised about the correctness of solutions obtained through MATLAB, with a participant noting that the results do not satisfy the original equations.
  • One participant points out that the backslash operator in MATLAB will yield a least-squares solution if the equations are inconsistent, prompting a discussion about checking for consistency.
  • Another participant proposes changing the unknowns to more meaningful variables to simplify the equations and suggests that consistency tests can be applied to the system.
  • There is a suggestion that the problem may be artificially complex and a request for clarification on its origin and relation to other problems discussed previously.
  • A link to a resource on Gaussian elimination is provided for further reference.

Areas of Agreement / Disagreement

Participants express differing views on the best approach to constructing the coefficient matrix and solving the system. There is no consensus on the method to be used, and concerns about the consistency of the equations remain unresolved.

Contextual Notes

Participants note potential issues with the consistency of the equations and the implications for the solutions obtained. There are also discussions about the implications of changing the arrangement of the coefficient matrix and the left-hand side vector.

Hypatio
Messages
147
Reaction score
1
I want to solve the following system of equations

##M_{1} = f_1+f_2+m_1+m_2\ \ ;\ \ M_{7} = f_1+f_2+s_1+s_2\ \ ;\ \ M_{13} = m_1+m_2+s_1+s_2##
##M_{2} = f_1+f_3+m_1+m_3\ \ ;\ \ M_{8} = f_1+f_3+s_1+s_3\ \ ;\ \ M_{14} = m_1+m_3+s_1+s_3##
##M_{3} = f_1+f_4+m_1+m_4\ \ ;\ \ M_{9} = f_1+f_4+s_1+s_4\ \ ;\ \ M_{15} = m_1+m_4+s_1+s_4##
##M_{4} = f_2+f_3+m_2+m_3\ \ ;\ \ M_{10} = f_2+f_3+s_2+s_3\ \ ;\ \ M_{16} = m_2+m_3+s_2+s_3##
##M_{5} = f_2+f_4+m_2+m_4\ \ ;\ \ M_{11} = f_2+f_4+s_2+s_4\ \ ;\ \ M_{17} = m_2+m_4+s_2+s_4##
##M_{6} = f_3+f_4+m_3+m_4\ \ ;\ \ M_{12} = f_3+f_4+s_3+s_4\ \ ;\ \ M_{18} = m_3+m_4+s_3+s_4##

where the 18 M coefficients are known and the 12 f, m, and s coefficients are unknown.

The strategy I want to use is to build a coefficient matrix and solve by inversion, but how can I do this for this system with minimal algebraic manipulation? For example, it is easy to see that at least 6 expressions for each unknown coefficient can be written. Perhaps this could result in a (6*12) by (6*12) coefficient matrix, but I'm unsure what it would look like, or if I am thinking about this correctly.

So, how do I arrange the coefficients so that
##f_1=M_1-f_2-m_1-m_2##
and
##f_1=M_2-f_3-m_1-m_3##
etc. are both satisfied. I thought you could make them both separate variables, like ##f_{1a}## and ##f_{1b}## and then have another equation express that ##f_{1a}=f_{1b}##, but I can't recall how to do this.
 
Last edited:
Physics news on Phys.org
Can't you simply combine equations? It won't be too bad. Reduce to a set of equations for the ##m_i## first.
 
I'll be interested in getting rid of superfluous information or simplifying things, but at the moment I just want to get a naive approach working because the solution follows straightforwardly from the equations. Also, I need to learn this..

I figured that the coefficient matrix doesn't need to be square, so maybe the system could look like:

<br /> \begin{bmatrix}<br /> 1 &amp; 1 &amp; &amp; &amp; 1 &amp; 1 &amp; &amp; &amp; &amp; &amp; &amp; \\<br /> 1 &amp; &amp; 1 &amp; &amp; 1 &amp; &amp; 1 &amp; &amp; &amp; &amp; &amp; \\<br /> 1 &amp; &amp; &amp; 1 &amp; 1 &amp; &amp; &amp; 1 &amp; &amp; &amp; &amp; \\<br /> &amp; 1 &amp; 1 &amp; &amp; &amp; 1 &amp; 1 &amp; &amp; &amp; &amp; &amp; \\<br /> &amp; 1 &amp; &amp; 1 &amp; &amp; 1 &amp; &amp; 1 &amp; &amp; &amp; &amp; \\<br /> &amp; &amp; 1 &amp; 1 &amp; &amp; &amp; 1 &amp; 1 &amp; &amp; &amp; &amp; \\<br /> 1 &amp; 1 &amp; &amp; &amp; &amp; &amp; &amp; &amp; 1 &amp; 1 &amp; &amp; \\<br /> 1 &amp; &amp; 1 &amp; &amp; &amp; &amp; &amp; &amp; 1 &amp; &amp; 1 &amp; \\<br /> 1 &amp; &amp; &amp; 1 &amp; &amp; &amp; &amp; &amp; 1 &amp; &amp; &amp; 1\\<br /> &amp; 1 &amp; 1 &amp; &amp; &amp; &amp; &amp; &amp; &amp; 1 &amp; 1 &amp; \\<br /> &amp; 1 &amp; &amp; 1 &amp; &amp; &amp; &amp; &amp; &amp; 1 &amp; &amp; 1\\<br /> &amp; &amp; 1 &amp; 1 &amp; &amp; &amp; &amp; &amp; &amp; &amp; 1 &amp; 1\\<br /> &amp; &amp; &amp; &amp; 1 &amp; 1 &amp; &amp; &amp; 1 &amp; 1 &amp; &amp; \\<br /> &amp; &amp; &amp; &amp; 1 &amp; &amp; 1 &amp; &amp; 1 &amp; &amp; 1 &amp; \\<br /> &amp; &amp; &amp; &amp; 1 &amp; &amp; &amp; 1 &amp; 1 &amp; &amp; &amp; 1\\<br /> &amp; &amp; &amp; &amp; &amp; 1 &amp; 1 &amp; &amp; &amp; 1 &amp; 1 &amp; \\<br /> &amp; &amp; &amp; &amp; &amp; 1 &amp; &amp; 1 &amp; &amp; 1 &amp; &amp; 1\\<br /> &amp; &amp; &amp; &amp; &amp; &amp; 1 &amp; 1 &amp; &amp; &amp; 1 &amp; 1\\<br /> \end{bmatrix}<br /> <br /> \begin{bmatrix}<br /> f_1\\<br /> f_2\\<br /> f_3\\<br /> f_4\\<br /> m_1\\<br /> m_2\\<br /> m_3\\<br /> m_4\\<br /> s_1\\<br /> s_2\\<br /> s_3\\<br /> s_4<br /> \end{bmatrix}<br /> =<br /> \begin{bmatrix}<br /> M_1\\<br /> M_2\\<br /> M_3\\<br /> M_4\\<br /> M_5\\<br /> M_6\\<br /> M_7\\<br /> M_8\\<br /> M_9\\<br /> M_{10}\\<br /> M_{11}\\<br /> M_{12}\\<br /> M_{13}\\<br /> M_{14}\\<br /> M_{15}\\<br /> M_{16}\\<br /> M_{17}\\<br /> M_{18}<br /> \end{bmatrix}<br />

Unfortunately, I solved an example with MATLAB backslash and the result is not correct. The solved unknowns do not return the M coefficients with the original equations. Also, vertically flipping the coefficient matrix and left hand side vector changes the solution, which should not happen because they are the same equations.
 
Last edited:
Doing row operations on that matrix is just the same as combining equations. Using the equations looks like a good option, as you can keep it simple. A 12x18 matrix is a bit unwieldy.
 
Hypatio said:
Unfortunately, I solved an example with MATLAB backslash and the result is not correct. The solved unknowns do not return the M coefficients with the original equations. Also, vertically flipping the coefficient matrix and left hand side vector changes the solution, which should not happen because they are the same equations.
You have 18 equations for 12 unknowns. In this case the backslash operator will find the least-squares solution, so if the equations are not consistent then the solution you get will not exactly solve them. Are your equations consistent?

jason
 
  • Like
Likes   Reactions: Paul Colby
By the way, one way to check for consistency is the following. If your matrix equation is ##\mathbf{A}x=b##, then you can look at the row-reduced form of the augmented matrix to see if any of the equations reduce to ##1=0##. In matlab,
>> M=[A, b]; %M is the augmented matrix
>> R = rref(M) %R is the row-reduced echelon form of M

jason
 
Hypatio seems almost there. If this is an algebraic problem (and Hypatio, not for the first time, does not fully inform us) I would change the unknowns to more meaningful ones e.g ##a_{i}=f_{i}+m_{i}##, i = 1, 2, 3, 4.
Then the first column of equations is 6 equations in 4 unknowns and you find you must have ##M_{5}-M_{6}=M_{1}-M_{2}## etc. or else this column is not consistent, has no solutions. And there should be a second test of that kind. Similarly you can test the second and third columns.

Assuming this OK, you have for the first column 4 equations in 4 unknowns, ##a_{i}##, fairly easy to solve as the matrices are full of zeroes. If the second and third columns are consistent equations with unique solution you do not have to solve them again, Just change names and numbers in your previous solutions.

It should then be possible to express solutions in terms of the original unknowns in an infinite number of ways, amongst which perhaps some are natural, depending on what the original problem was.

If instead this is not an algebraic question but a numerical analysis/statistical one where e.g. ##\left( M_{1}-M_{2}\right) -\left( M_{5}-M_{6}\right) ## is not exactly 0 but sufficiently small this would be above my pay grade, but I imagine you still do these things anyway.

And anyway (afterthought but should come first) the f, m, s can be isolated. Subtract the second column from the first and add the result to the third and we have a column of s (×2) alone, and we can get one for f and m too.

This problem begins to look so artificially inflated in apparent difficulty I think Hypatio should tell us where it comes from. And also relation with other problems he has brought.
 
Last edited:

Similar threads

  • · Replies 10 ·
Replies
10
Views
3K
Replies
13
Views
2K
  • · Replies 4 ·
Replies
4
Views
6K
  • · Replies 29 ·
Replies
29
Views
4K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
14
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
7K