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

  Create a function that will determine the total resistance

Create a function that will determine the total resistance of a number of resistors that are connected in parallel. This function should accept a row vector for input,

  Realistic animations include more

Realistic animations include more than just translations of shapes. They also have scaling involved. For this question, you're asked to write a function called "problem4" that accepts a single input variable and applies a scaling constant of 3. Th..

  Dimensional plot of the free surface charge

Include a qualitative dispersion curve sketch thatdemonstrates the operating point at which your Matlab plot applies.

  Calculate the inverse of a function

Using matlab write the function [Bag,x] = EG(A,b) to solve the system without pivoting. The solution is the vector x and flag is 0 when the algorithm is completed and 1 otherwise.

  Viewing the guided solutions for stormy attaway''s intro

I subscribed for a 7 day study membership trial 2 days ago. I have been viewing the Guided solutions for Stormy Attaway's Intro to programming in Matlab 2nd edition

  The concentration of medication in the blood declines

After a dose, the concentration of medication in the blood declines due to metabolic processes. The half-life of a medication is the time required after an initial dosage for the concentration to be reduced by one-half.

  Least squares

For homework consider the points (0,0), (1,2), (2,3), (3,9), ( 4,17), (5,24), (6,37). (1) Use Matlab to find the least squares best fit with a line.  Turn in A, y and c and a plot like the one above.  Also (2) use Matlab to find the least square best..

  Create a matrix of 5x6

Prepare a matrix of 5x6. with identical columns and rows ranging from 200 to 1000 in equal increments

  Convert each numeric value in the vector days

Write a function dayName that has one input argument, day, containing the numerical value of a day in the month of November, 2014.

  Compare two sound wave in matlab

Compare two sound wave in matlab as on speech to text processing and open as notepad, calculator,C:,D: and many other on speaking

  Compute and flote 4 average temperature profiles

Generate by measdata.m an array A withsize (365,24), containing temperature measurements for an entire year [1 January,..., 31 December], 24 hours a day [00.00h,...,23.00h].

  Finds the largest integer in the list recursively

Write a program that, given a list of 20 integers, finds the largest integer in the list recursively

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