Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The following systems of equations is easy to solve 2x+ y = 18 3x + 2y = 30 by g

ID: 3542592 • Letter: T

Question

The following systems of equations is easy to solve

2x+ y = 18

3x + 2y = 30

by graphing, by substitution, or elimination.The solution (6,6) is easily arrived at using a graphing calculator using matrix algebra to solve the matrix equation.

Ax=b

A= 2 1

     3 2


b= 18

     30


Ax=b so x=A^-1*b= 6

                             6

The literature contains numerous algorithms for solving ill conditioned systems.In order to illustrate the shortfalls of floating point arithmetic for this projects you will limited to algorithms implementing the gauss- jordan method.

A.) Write a java program that uses an algorithm implementing the Gauss- jordan method to solve the system of linear equations given in the introduction.Your output must show the output of every calculation to no more than 7 decimal places.You must create and use a function that cuts off the result of each calculation at exactly seven decimal places and uses this cutoff value in any susbsequesnt calculation.


B.) Use the following ten step procedure to solve the problem:

1)Problem

2)Input

3)Output

4)Discussion

5)Assumptions

6)Top Down Design

7)Variables

8)Pseudocode

9)Flowchart

10)a Java source code

b) program output

Explanation / Answer

1. problem is to solve system of ill formed equations by Gaus Jordan method. 2.Input is taken as no.of equations and each line we read coefficients of each equation into an two dimensional array 3.output is the giving nature of system of ill formed eequations and intersection if there . 4. the method is to take coefficients and write a method to inverse it and multiply it by B matrix . 5. Assumtions we can make is they are intersecting so we can write code easily . 6.Takeing input from user or file with one integer specifying no.of system of equations and each line containing coefficients . 7.number , coefficients[][] , bvalue[] 8. Take number of equations Take 2d array inverted = inversse (2d array) inverted * B = solution . 9.same as pseuddocode 10.Code : ///////////////////////////////////////////////////////////////////////////////////////////// // // GaussJordan.java // Runs Gauss Jordan Elimination on a matrix // // 1. Save this file as GaussJordan.java on any system with the javac compiler, available // from Sun Microsystems: http://java.sun.com/javase/downloads/index.jsp // 2. If you're on a unix system also save the file "Makefile" in the same directory, then // 3. Compile by typing "make" or "gmake" at the command line (leave out the quotes). // 4. Run the executable by doing "GaussJordan infile outfile", where "infile" is // a properly formated (described below) input file. // 5. Else if you're on any other system, then // 6. Compile by typing "javac GaussJordan.java" at the command line (leave out quotes). // 7. Run the executable by doing "java GaussJordan infile outfile, where "infile" is // a properly formated (described below) input file. // // Note: if "outfile" already exists in your working directory, then the above commands will // overwrite it. // // Input file format. // The first line of an input file consists of two integers n and m, separated by a space, // giving the number of rows and columns, respectively. The next n lines of the input file // specify the n rows of the matrix. Each line is a space separated list of m real numbers. // Note that the number of spaces separating the numbers in each row is irrelevant. // // Example 1 (Save the following lines as a text file called in1.) // 3 5 // 2 0 4 2 9 // 3 4 0 0 -7 // 0 1 0 5 0 // // Example 2 (Save as text file in2.) // 4 7 // 3.1 4.2 7.9 0.0 0.0 1.1 8.2 // -6.7 1.2 3.4 5.6 7.8 0.0 0.0 // 9.8 7.6 5.4 3.2 2.1 2.3 4.5 // 6.7 8.8 -9.1 2.5 3.6 4.7 -5.5 // ///////////////////////////////////////////////////////////////////////////////////////////// import java.io.*; import java.util.StringTokenizer; class GaussJordan{ // swap() // swap row i with row k // pre: A[i][q]==A[k][q]==0 for 1
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote