Group Abstract Group Abstract

Message Boards Message Boards

Solve a linear system M x = S ?

Posted 9 years ago

You can turn it into explicit equations and let Reduce or `Solve try to sort out conditions for existence of solutions.

mat = {{q^2, 0, q, 0, 0, 0, 0, 0}, {0, q^2, 0, q, 0, 0, 0, 0}, {q, -q, 1, -1, 0, 0, 0, 0},
 {0, 0, 0, 0, 1, -1, q, q}, {0, 0,  q, -q, 0, 0, 0, 0}};
rhs = {c1, c2, 0, 0, c1 - c2};
vars = Array[x, Length[mat[[1]]]];

Solve[mat.vars == rhs, Join[vars, Variables[rhs]]]

(* During evaluation of In[53]:= Solve::svars: Equations may not give solutions for all "solve" variables.

Out[53]= {{x[2] -> x[1], x[4] -> x[3], 
  x[8] -> -(x[5]/q) + x[6]/q - x[7], c1 -> q^2 x[1] + q x[3], 
  c2 -> q^2 x[1] + q x[3]}} *)
POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard