Message Boards Message Boards

0
|
818 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

General solution of linear system of equations

Posted 5 months ago

Hello,

It is a little weird that LinearSolve function in Mathematica can't output general solution which should be the right solution for linear system of equations. Although someone has questioned this on the Stack Exchange, however it is still a difficulty in Mathamtica. So, is there a function or a easier way to achieve the general function in Mathematica?

a = {{1, 1, -3, -1}, {3, -1, -3, 4}, {1, 5, -9, -8}};b = {1, 4, 0};LinearSolve[a, b] // MatrixForm

No general solution.

POSTED BY: Zhenyu Zeng
2 Replies

From the documentation:

For underdetermined systems, LinearSolve will return one of the possible solutions; Solve will return a general solution.

Have a look also at NullSpace. The general solution is the sum of the output of LinearSolve plus any combination of vectors of NullSpace.

POSTED BY: Gianluca Gorni
Posted 5 months ago

Thanks. A another good idea. I will try it.

POSTED BY: Zhenyu Zeng
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