Problem With MATLAB RREF Function Returning Trivial Solution.

This is because any scalar multiple of eq1 will still satisfy eq2. So, in summary, the second solution is not unexpected since eq2 is dependent on eq1.
  • #1
lanew
13
0
I'm trying to solve a system of linearly dependent equations. I solved the first set no problem, but for some reason MATLAB is returning the trivial solution for the second one, can anyone explain why?

Systems:
eq1 =
-29.7250 -3.0000 0
-3.0000 -0.3028 0
eq2 =
2.7250 -3.0000 0
-3.0000 3.3028 0

Solutions
u1 =
1.0000 0.1009 0
0.0000 0.0000 0
u2 =
1 0 0
0 1 0

The first solution, u1, is what I expected, however, the second solution is not. If I do it by hand, I get:
eq2 =
1.0000 -1.1009 0
0.0000 0.0000 0

Thanks!
 
Physics news on Phys.org
  • #2
The reason why MATLAB is returning the trivial solution for the second equation is because it is a linearly dependent system. That is, there are two equations that are related by a scalar multiple. In this case, eq2 is equal to 2.7250*eq1. Since they are related in such a way, MATLAB is returning the trivial solution, which is the vector of all ones.
 

What is the problem with the MATLAB RREF function returning a trivial solution?

The problem with the MATLAB RREF function returning a trivial solution is that it may not accurately reflect the desired solution to the system of equations. In other words, the trivial solution may not be the correct or most useful solution to the problem at hand.

Why does the MATLAB RREF function sometimes return a trivial solution?

The MATLAB RREF function may return a trivial solution because it is designed to solve a system of equations using row operations, and in some cases, these row operations may result in a trivial solution. This can happen when one or more equations are linearly dependent, meaning they can be derived from other equations in the system.

How can I avoid getting a trivial solution from the MATLAB RREF function?

To avoid getting a trivial solution from the MATLAB RREF function, you can check your system of equations to ensure that it is not linearly dependent. You can also try using a different method, such as the LU decomposition method, to solve the system of equations.

Is there a way to modify the MATLAB RREF function to avoid a trivial solution?

No, there is no way to modify the MATLAB RREF function to avoid a trivial solution. The function is designed to perform row operations on a matrix, and these operations may result in a trivial solution if the system of equations is linearly dependent.

Are there any alternative functions or methods I can use to solve a system of equations without getting a trivial solution?

Yes, there are alternative functions and methods you can use to solve a system of equations without getting a trivial solution. Some examples include the LU decomposition method, the Gauss-Jordan elimination method, and the use of symbolic variables and equations. It is always a good idea to check and compare the results from different methods to ensure accuracy.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
Back
Top