Linear equations, elimination matrix and matlab

Click For Summary
SUMMARY

The discussion focuses on solving a system of linear equations using elimination matrices and MATLAB. The equations derived from a word problem involving coins are represented in matrix form as A x = B, where A is the coefficient matrix and B is the constants matrix. The user successfully solves for x, y, and z using MATLAB's inverse function but seeks clarification on performing the elimination process manually and implementing it in MATLAB. The elimination matrix E is introduced but not effectively applied in the user's attempt.

PREREQUISITES
  • Understanding of linear algebra concepts, specifically elimination matrices.
  • Proficiency in MATLAB, particularly matrix operations and the 'inv' function.
  • Familiarity with matrix representation of linear equations.
  • Knowledge of row echelon form and its application in solving systems of equations.
NEXT STEPS
  • Learn how to construct and apply elimination matrices in MATLAB.
  • Study the process of converting matrices to row echelon form.
  • Explore MATLAB's 'rref' function for reduced row echelon form.
  • Review the Gauss-Jordan elimination method for solving linear equations.
USEFUL FOR

Students and educators in mathematics, particularly those studying linear algebra, as well as MATLAB users looking to enhance their skills in solving systems of equations using elimination methods.

medinaj2160
Messages
13
Reaction score
0

Homework Statement


For part 1 I solve the problem and I got the follow equation and results:

.25x+.10y+.05z=1.15
x+y+z=9
-2y+z=0

The solution is x=3, y=2, z=4

Now I have to solve this by hand with the equation in matrix form using elimination matrix

Your mathematical formulation in part 2 can be expressed as a matrix equation of the form, A x = y. We can duplicate the each step in the elimination process by multipling the left and right sides of the matrix equation by an appropriate elimination matrix or permutation matrix. Write down these steps and the calculations. Duplicate your work using MATLAB (with format rat)

Homework Equations



EAx = Eb

The Attempt at a Solution



A=[.25 .1 .05; 0 -2 1; 1 1 1];
B= [ 1.15; 0; 9]

Using Matlab I can solve it like this X= inv(A)*B = x=3, y=2, z=4 but that is not what he wants

to me the first elimination matrix is E= [1 0 0; 0 1 0; -1 0 1] but is not eliminating anything.
This may help some but I don't see how:
http://www.gregthatcher.com/Mathematics/GaussJordan.aspx"

How do I solve this by hand and then input it into matlab?

Thanks
 
Last edited by a moderator:
Physics news on Phys.org
medinaj2160 said:

Homework Statement


For part 1 I solve the problem and I got the follow equation and results:

.25x+.10y+.05z=1.15
x+y+z=9
-2y+z=0

The solution is x=3, y=2, z=4

Now I have to solve this by hand with the equation in matrix form using elimination matrix



Homework Equations



EAx = Eb

The Attempt at a Solution



A=[.25 .1 .05; 0 -2 1; 1 1 1];
B= [ 1.15; 0; 9]

Using Matlab I can solve it like this X= inv(A)*B = x=3, y=2, z=4 but that not what he wants

to me the first elimination matrix is E= [1 0 0; 0 1 0; -1 0 1] but is not eliminating anything.
This may help some but I don't see how:
http://www.gregthatcher.com/Mathematics/GaussJordan.aspx"

How do I solve this by hand and then input it into matlab?

Thanks

Do you mean you need to put the original matrix in row echelon form?

http://en.wikipedia.org/wiki/Row-echelon_form

.
 
Last edited by a moderator:
berkeman said:
Do you mean you need to put the original matrix in row echelon form?

http://en.wikipedia.org/wiki/Row-echelon_form

.

no! I was given this in part 1:


Consider the following word problem.

John is leaving the grocery store with a bag of groceries in one hand. He knows that the clerk should have given him $1.15 in change, but since he said that he needed some nickels, the clerk gave him a handful of coins which John put in his empty pocket. John is now wondering if he got the right change. With his free hand John can tell that he has 9 coins in his pocket, and he can also tell that he has twice as many nickles as dimes. If John was given the correct change, how many quarters should he have in his pocket?

Develop a mathematical formulation of this problem



List the unknowns.


State the relationships between the unknowns, and include the assumption that John has the correct amount of change.


List the equations and use elimination to solve for all the unknowns. Show the details of your work.


How many quarters should John have in his pocket?

which I solve, and is on my first post.

On the second part I am suppose to do this:

Your mathematical formulation in part 1 can be expressed as a matrix equation of the form, A x = y. We can duplicate the each step in the elimination process by multipling the left and right sides of the matrix equation by an appropriate elimination matrix or permutation matrix. Write down these steps and the calculations. Duplicate your work using MATLAB (with format rat).
 

Similar threads

Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
Replies
8
Views
2K
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
5
Views
2K
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K