Message Boards Message Boards

0
|
5616 Views
|
7 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Solve a system of linear equations?

Posted 7 years ago

Hi!

I have a pretty easy problem where I have 6 equations and 6 unknown of the form m*x = 0, where m is a 6x6 matrix and x is a vector of length 6 with the 6 unknown variables. I'm looking for a nontrivial solution to this problem so I use the Nullspace command.

My code is the following

m = {{E^(-I*x*b/2), E^(I*x*b/2), -E^(-I*y*b/2), -E^(I*y*b/2), 0, 0},
 {I*x*E^(-I*x*b/2), -I*x*E^(I*x*b/2), -I*y*E^(-I*y*b/2), 
  I*y*E^(I*y*b/2), 0, 0},
 {0, 0, -E^(I*y*b/2), -E^(-I*y*b/2), E^(I*x*b/2), E^(-I*x*b/2)},
 {0, 0, -I*y*E^(I*y*b/2), I*y*E^(-I*y*b/2), 
  I*x*E^(I*x*b/2), -I*x*E^(-I*x*b/2)},
 {E^(-I*x*(a + b/2)), E^(I*x*(a + b/2)), 0, 0, 0, 0},
 {0, 0, 0, 0, E^(I*x*(a + b/2)), E^(-I*x*(a + b/2))}}
ns = NullSpace[m]

This gives me the output { }. What does this result mean? All the coefficients x,y,a,b are real and greater than zero. Is that something that I should specify in the code? I wonder what is wrong with my code?

I've attached my code to this post.

Thanks in advance!

Attachments:
POSTED BY: Pontus Vikstål
7 Replies

NullSpace gives you a basis for the null space. When the null space is is zero-dimensional, its basis is the empty set {}.

You get a nonempty NullSpace for special values of the parameters:

sols = Solve[Det[m] == 0]
MatrixForm[m] /. sols
Map[NullSpace, m /. sols]
POSTED BY: Gianluca Gorni

Hi! I have a similar problem about solving a system of linear equations of the form AX = 0. I solved Det[A] =2(b^2 - 1)c^3(x - 2)^2Sin[Pix]^3(bfSin[Pix] + Cos[Pi*x]), but this matrix has parameters c > 0, -0.5 < b < 0.5, f ≠ 0, and 0 < x < 1. So there is only one solution for x: x=ArcTan[1/b/f]/Pi. But I brought this solution into A using the NullSpace to solve gives me the output { }. I guess it could be that the matrix does not define the domains of the parameters a,b,c,f. Is that something that I should specify in the code? I want to get the solution to the system of equations when x = ArcTan[1/b/f]/Pi.

My code is attached:

Attachments:
POSTED BY: Russell Michael

Your code does not run because of syntax errors. I tried to restore it:

mat = {{(-2 + x)  Cos[\[Pi]  (-2 + x)] - 
     f  (-2 + x)  Sin[\[Pi]  (-2 + x)], -f  (-2 + 
        x)  Cos[\[Pi]  (-2 + x)] + (2 - x)  Sin[\[Pi]  (-2 + x)],
    x  Cos[\[Pi]  x] - f  (-2 + x)  Sin[\[Pi]  x],
    -f  (-2 + x)  Cos[\[Pi]  x] - x  Sin[\[Pi]  x], 0, 0, 0, 
    0}, {(-2 + x)  Cos[\[Pi]  (-2 + x)], (2 - x)  Sin[\[Pi]  (-2 + x)],
    x  Cos[\[Pi]  x], -x  Sin[\[Pi]  x], (2 - x)  Cos[\[Pi]  (-2 + x)],
    (2 - 
       x)  Sin[\[Pi]  (-2 + 
         x)], -x  Cos[\[Pi]  x], -x  Sin[\[Pi]  x]}, {1/
      2  (-2 + a  c - b  c) (-2 + x)  Cos[\[Pi]  (-2 + x)],
    1/2  (2 - a  c + b  c) (-2 + x)  Sin[\[Pi]  (-2 + x)], 
    1/2  (-2 + a  c - b  c) (-1 - (-2 + c - b  c)/(2 - a  c + b  c) + 
       x)  Cos[\[Pi]  x], 
    1/2  (2 - a  c + b  c) (-1 - (-2 + c - b  c)/(2 - a  c + b  c) + 
       x)  Sin[\[Pi]  x], (-2 + x)  Cos[\[Pi]  (-2 + x)],
    (-2 + x)  Sin[\[Pi]  (-2 + x)],
    (-1 + 1/2  (2 - c - a  c) + x)  Cos[\[Pi]  x],
    (-1 + 1/2  (2 - c - a  c) + x)  Sin[\[Pi]  x]},
   {Sin[\[Pi]  (-2 + x)], Cos[\[Pi]  (-2 + x)], Sin[\[Pi]  x],
    Cos[\[Pi]  x], Sin[\[Pi]  (-2 + x)], -Cos[\[Pi]  (-2 + x)], 
    Sin[\[Pi]  x], -Cos[\[Pi]  x]}, {0, 1, 0, 1, 0, -1, 0, -1},
   {-2 + x, 0, x, 0, 2 - x, 0, -x, 0},
   {0, 1/2  (2 - a  c + b  c)  (-2 + x), 0,
    1/2  (2 - a  c + b  c)  (-1 + (-2 + c - b  c)/(2 - a  c + b  c) + 
       x),
    0, 2 - x, 0, 1 + 1/2  (2 - c - a  c) - x},
   {1/2  (2 - a  c + b  c)  (-2 + x), 0,
    1/2  (2 - a  c + b  c)  (-1 - (-2 + c - b  c)/(2 - a  c + b  c) + 
       x),
    0, 2 - x, 0, 1 + 1/2  (-2 + c + a  c) - x, 0}};
Det[mat] // Simplify // Factor
sols = Solve[% == 0 && c > 0 && -1/2 < b < 1/2 && f != 0 && 
   0 < x < 1 && c > 0, Reals]
mat2 = FullSimplify[
  mat /. sols[[1]], -1/2 < b < 1/2 && f != 0 && 0 < x < 1 && c > 0]
Det[mat2] // Simplify
NullSpace[mat2]
POSTED BY: Gianluca Gorni

Hi, I have the same problem and I would like to know how to solve such a system of linear equations

POSTED BY: Russell Michael

No nulls is good nulls?

POSTED BY: Daniel Lichtblau

For m *x == 0 you must have Det[ m ] == 0, but

In[17]:= Det[m] // FullSimplify

Out[17]= E^(-I (2 a x + b y)) (-(x + E^(2 I a x) (x - y) + y)^2 +    E^(2 I b y) (x - y + E^(2 I a x) (x + y))^2)
POSTED BY: Hans Dolhaine
Posted 7 years ago

Perhaps

MatrixForm[RowReduce[m]]

and

NullSpace[IdentityMatrix[6]]

might give a hint

POSTED BY: Bill Simpson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract