Solve a system of linear equations

Assignment Help MATLAB Programming
Reference no: EM13540520

Use Gauss-Jordan elimination to solve the system of simultaneous equations:

2v + 3w -5y + y -z =15

v-3w+4x+y-z=-6

-2v+w-3x+3y+2z=3

3v-w-x+4y=-3

v+4w-2x+y-2z=6

1. Write a MATLAB function (upperTriangle) using the functions to convert a matrix to upper triangular form. Start with row 1, column1. Find the row that has the largest absolute value in the current column (you have a function that will do that). If the row is not your working row, swap rows (you have a function that will do that). Calculate a factor that you can use to form a linear combination with your working row to zero the value in the column below your working row. Use that factor and the linear combination of rows to zero the first column below your working row (you have a function that will do that). Continue down that column until you reach the last row. All the values in your working column below your working row should be zero. Move to the next diagonal position (down 1 row over 1 column) and repeat the process. Continue the process moving down the diagonal until you reach the last row. You matrix should be in upper triangular form.

Your function should be written to handle matrices of any size. Test your function with matrices of different sizes for which you know the solution to ensure that your function works correctly.

Use variable names that relate to their function and include comments that explain your program logic.

Do not use any built-in MATLAB functions except size(), input(), and zeros().

Next update the functionto a function that solves a system of linear equations or calculates the inverse of a matrix by Gauss-Jordan elimination. Your function should accept a matrix as an argument and return a matrix of the same dimension.

Note: Your function should be written to handle matrices of any size. Test your function with matrices of different sizes for which you know the solution to ensure that your function works correctly.

Use variable names that relate to their function and include comments that explain your program logic.

Do not use any built-in MATLAB functions except size(), input(), and zeros().

As example of what is expected from this function consider the following linear system:

3x + 2y + z = 11

2x + 3y +z = 13

x + y + 4z = 12

In this case you should pass into your function the following augmented matrix:

1424_Matrix.png

After performing Gauss-Jordan elimination, your function should return the following reduced system:

2449_Matrix1.png

from which we can determine that x = 1, y = 3, z = 2.

Furthermore, if you pass a double augmented matrix such as

578_Matrix2.png

Your function should return

1899_Matrix3.png

which solves the original equations

3x + 2y + z = 11

2x + 3y +z = 13

x + y + 4z = 12

as x = 1, y = 3, z = 2

and, at the same time, the equations

3x + 2y + z = -5

2x + 3y +z = -4

x + y + 4z = 9

as x = -2, y = -1, z = 3.

Additionally, if you pass to your function a square matrix on the left augmented by the identity matrix on the right, such as

2377_Matrix4.png

your function should return the identity matrix on the left and the inverse of the original square matrix on the right.

Reference no: EM13540520

Questions Cloud

Explain effect that the amount of salt has on the corrosion : Describe a controlled experiment to investigate the effect that the amoun tof salt has on the corrosion process of a copper penny.
Describe the concepts of feedback and equilibrium : Explain the term model , and describe how models can help us understand our complex physical world and describe the concepts of feedback and equilibrium. provide an example from a natural system
The preferred stockholders in 2011 : What are the dividends received bu the preferred stockholders in 2011?
State what will happen to the density of the metal : A certain metal crystallizes in a body-centered cubic arrangement. If it rearranges to a face-centered cubic structure, what will happen to the density of the metal
Solve a system of linear equations : Use Gauss-Jordan elimination to solve the system of simultaneous equations - functions to convert a matrix to upper triangular form.
Find out the normal boiling point of a substance : Determine the normal boiling point of a substance whose vapor pressure is 55.1 mm Hg at 35°C and has a Hvap of 32.1 kJ/mol
Bakker corporation applies manufacturing overhead : Bakker Corporation applies manufacturing overhead on the basis of direct labor-hours.
Evaluate the mass of sun : Use the period of the earth (2.54 y), its mean orbital radius (1.496 × 10^11 m), and the universal gravitational constant (6.673 × 10^?11 N · m2/kg2) to calculate the mass of sun
Explain the reaction between c6h5mgbr and co2 : Explain why neither triphenylmethanol, (C6H5)3COH, nor benzophenone, C6H5COCH5, was produced in the reaction between C6H5MgBr and CO2

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Finite difference method

Use the finite difference method to calculate the temperature at the point specified since it is easier.

  Determine the necessary shell temperature

In a shell-and-tube heat exchanger, one fluid passes through a central tube while another fluid flows through an outer shell in the opposite direction. The purpose is to heat the fluid passing through the central tube.

  Find the integral of a function at an arbitrary location

Write a Matlab function to perform numerical integration of a set of evenly spaced data points using the trapezoidal rule

  Compute the speed of single-stage planetary gear train

Write a MATLAB function [speed] = planetary (N, emesh, first, last, arm) that computes the speed of a given link in a single-stage planetary gear train.

  Calculate and plot the error in the numerical derivative

Write a program to calculate and plot the error in the numerical estimate of the derivative.

  Create the graph using matlab functions

Create the graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and the sine function in the third interval.

  Develop a simulation program

Develop a simulation program

  Create a vector in matlab

Create a three dimensional diagram of function.

  Open a named pipe and to read data from the pipe

Open a named pipe and to read data from the pipe in matlab

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd