Message Boards Message Boards

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

Solve a Matrix-vector equation with Solve instead of LinearSolve?

Posted 5 years ago

Hey guys, I'm currently stuck on this one task where I'm trying to calculate how many solutions the equation A * B = X has, where A is a 3x3 matrix, and B is a 1x3 vector. I'm supposed to use Solve as a command, but I can't get it to work unless I'm using LinearSolve. So far, I've got the code:

LinearSolve[( {
   {1, 1, -2},
   {3, 4, -3},
   {1, 2, 1}} ),
   {1, 1, -1}]

Where the (1,1,1) is my vector. This gave me the correct solution, but I'm supposed to use the Solve command instead, and I have no idea how to. I'd be very greatful if you could help me out with this.

POSTED BY: Jhn Doe
7 Replies

Here is another quick video!

https://www.youtube.com/watch?v=OCs9D2rEGeI&feature=youtu.be

Hope this helps you!

POSTED BY: Arnoud Buzing

Here is a nice video on solving equations in the Wolfram Language:

https://www.youtube.com/watch?v=00fGb4wsZ40

Another one, with really nice background music!

https://www.youtube.com/watch?v=XbgECztAYjE

POSTED BY: Arnoud Buzing

Jhn,

You can find all Wolfram Language functions documented online at:

https://reference.wolfram.com

and in-product (e.g in Mathematica) by pressing F1 and searching for the relevant function.

You can also select any function and press F1 to get usage help on that function.

POSTED BY: Arnoud Buzing

enter image description here

POSTED BY: Arnoud Buzing

enter image description here

POSTED BY: Arnoud Buzing

Solve wants equations using explicit variables. That can be done along the lines below.

mat = {{1, 1, -2}, {3, 4, -3}, {1, 2, 1}};
b = {1, 1, -1};
vars = Array[x, 3];

In[30]:= mat.vars == b

(* Out[30]= {x[1] + x[2] - 2 x[3], 3 x[1] + 4 x[2] - 3 x[3], 
  x[1] + 2 x[2] + x[3]} == {1, 1, -1} *)
POSTED BY: Daniel Lichtblau
Posted 5 years ago

What specifically is this command for? i don't quite understand what it means.

vars = Array[x, 3];
POSTED BY: Jhn Doe
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