Solving matrix with some known column values
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ryan
el 28 de Mayo de 2017
Comentada: Ryan
el 29 de Mayo de 2017
I have a system of linear equations Ax = B where B is completely known and x and A are partially known. For the known values of x, the corresponding diagonal entry in A is unknown (although I consider these dummy variables in A that I'm not interested in, just there to make the math work). Is there a Matlab routine to solve for the unknown x values? I'm not so familiar with linear algebra techniques.
0 comentarios
Respuesta aceptada
Roger Stafford
el 29 de Mayo de 2017
Editada: Roger Stafford
el 29 de Mayo de 2017
By your assumption, for any i for which x(i) is already known, the corresponding coefficient A(i,i) will be unknown, while all A(j,i)*x(i) with j not equal to i will be known. Suppose we perform the following changes to your three arrays A, x, and B:
1) Give A(i,i) the known value x(i).
2) Consider x(i) as now the previously unknown value A(i,i).
3) For each j ~= i, subtract the known value A(j,i)*x(i) from B(j) and replace A(j,i) with zero.
I claim that the resulting set of linear equations will be entirely equivalent to the previous set, since we have only performed valid algebraic transformations on the equations. Therefore, if we repeat this action for each of the known values of x(i), we arrive at new arrays A, x, and B whose solution is the same as that of the original arrays, and all values in the new A are known while all values in x are unknown, and we can solve them by the ordinary methods for A*x = B, namely x = A\B.
I am confident that matlab does not have any single function which performs the above actions, but obviously they can be made by appropriate for-loops, and I leave that task to you, Ryan.
Note that you will get solutions for the unknown A(i,i) values even though you do not intend to.
Más respuestas (0)
Ver también
Categorías
Más información sobre Linear Algebra en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!