Linear equations, elimination matrix and matlab

In summary, linear equations are mathematical equations that involve two or more variables and can be represented graphically as a straight line. The elimination matrix method is a technique used to solve systems of linear equations by eliminating one variable at a time. Matlab is a popular software tool used for numerical computation and data visualization, making it useful for solving linear equations and creating elimination matrices. With its ability to handle large datasets and perform complex calculations, Matlab is a valuable tool for solving linear equations and other mathematical problems.
  • #1
medinaj2160
15
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
  • #2
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:
  • #3
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).
 

FAQ: Linear equations, elimination matrix and matlab

What is a linear equation?

A linear equation is an algebraic equation that contains only variables raised to the first power and a constant. It can be represented in the form of y = mx + b, where m is the slope and b is the y-intercept. It describes a straight line on a graph.

How is elimination used in solving linear equations?

Elimination is a method used to solve systems of linear equations, where two or more equations are solved simultaneously. It involves manipulating the equations by adding or subtracting them to eliminate one of the variables. This results in a simpler equation that can be solved to find the value of the remaining variable.

What is a matrix in the context of linear equations?

In linear algebra, a matrix is a rectangular array of numbers or variables arranged in rows and columns. It is used to represent a system of linear equations and perform operations such as addition, subtraction, and multiplication. Each element in a matrix is identified by its row and column position.

How can MATLAB be used to solve linear equations?

MATLAB is a programming software commonly used in scientific and engineering fields. It has built-in functions and tools that can be used to solve linear equations. The 'solve' function can be used to find the solutions to a system of equations, while the 'linsolve' function can be used to solve linear equations with multiple variables.

What are the benefits of using MATLAB for solving linear equations?

MATLAB offers several benefits for solving linear equations, such as its ability to handle large systems of equations and provide accurate solutions. It also allows for easy visualization of the equations and their solutions through graphs and plots. Additionally, MATLAB has a user-friendly interface and a wide range of tools and functions that make solving linear equations efficient and convenient.

Back
Top