Solving Systems of Linear Equations with ljx.m

In summary, the conversation discusses the use of the Matlab function ljx.m for solving a system of linear equations. A specific example with matrices A and b is provided, and the function is called with different pivot elements, leading to different results. The question arises as to why a specific pivot element is chosen and whether any element can be used as a pivot as long as it is not 0. It is also noted that when solving for y3, the results for y1 may differ depending on the chosen pivot, but it is unclear if this affects the overall solution.
  • #1
mathmari
Gold Member
MHB
5,049
7
Hey! I need some help using the Matlab function ljx.m for solving a system of linear equations. I found a solved example for A= [tex] \bigl(\begin{smallmatrix}
1 & -1 &0 & 1\\
1 & 0& 1 & 0\\
1 &1 &2 & -1
\end{smallmatrix}\bigr) [/tex] and b=[tex] \bigl(\begin{smallmatrix}
1\\
1\\
-1
\end{smallmatrix}\bigr) [/tex].
At the first time they call the function by ljx(T,2,1).
Why do they take as pivot this element, and not for example ljx(T,1,1)??
Is there a specific reason, or can we take as pivot any element we want as long as it's different from 0?
:confused:
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
When I call the function ljx(T,1,1), then ljx(2,2) I get that the row [tex] y_{3} [/tex] is dependent and can be written as [tex] y_{3}=-y_{1}+2y_{2}+1 [/tex].

When I call the function ljx(T,2,1), then ljx(T,3,2) I get [tex] y_{1}=2y_{2}-y_{3}+1 [/tex].
If I solve for [tex] y_{3} [/tex] I get the same answer as at the first case. But the result [tex] y_{1}=2y_{2}-y_{3}+1 [/tex] doesn't mean that [tex] y_{1} [/tex] is dependent and [tex] y_{3} [/tex] independent?
Are the results at both cases equal??
 

Related to Solving Systems of Linear Equations with ljx.m

What is a system of linear equations?

A system of linear equations is a set of equations that involve two or more variables, where the solutions of the equations satisfy all of the equations in the set. In other words, the solutions are the values that make all of the equations true at the same time.

What is the purpose of solving a system of linear equations?

The purpose of solving a system of linear equations is to find the values of the variables that satisfy all of the equations in the system. This can be useful in a variety of real-world applications, such as determining the intersection point of two lines or finding the optimal solution to a system of equations representing a business problem.

What are the different methods for solving a system of linear equations?

There are several methods for solving a system of linear equations, including substitution, elimination, and graphing. In substitution, one equation is solved for one variable and then substituted into the other equations to solve for the remaining variables. In elimination, the equations are manipulated to eliminate one variable and solve for the remaining variables. Graphing involves graphing each equation and finding the point of intersection.

What is the role of matrices in solving systems of linear equations?

Matrices are a useful tool for solving systems of linear equations because they allow for efficient organization and manipulation of the coefficients and variables. Matrices can be used to represent a system of equations and can be manipulated using matrix operations to solve for the variables.

What are some tips for solving systems of linear equations effectively?

Some tips for solving systems of linear equations effectively include: checking for consistency (i.e. making sure there is a solution), using a method that works best for the given system, simplifying equations before solving, and checking the solution to ensure it satisfies all of the equations in the system.

Similar threads

  • Linear and Abstract Algebra
Replies
2
Views
649
  • Linear and Abstract Algebra
Replies
3
Views
969
  • Linear and Abstract Algebra
Replies
1
Views
906
  • Linear and Abstract Algebra
Replies
3
Views
1K
  • Linear and Abstract Algebra
Replies
5
Views
1K
  • Linear and Abstract Algebra
Replies
2
Views
2K
  • Linear and Abstract Algebra
Replies
6
Views
752
  • Calculus and Beyond Homework Help
Replies
6
Views
621
  • Linear and Abstract Algebra
Replies
12
Views
1K
  • Linear and Abstract Algebra
Replies
11
Views
1K
Back
Top