Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Please solve computer project on mathCAD, please post pictures of code. Will give instant thumbs up! Instructions: Follow the directions given below to create a

Please solve computer project on mathCAD, please post pictures of code. Will give instant thumbs up!

Instructions: Follow the directions given below to create a MathCAD worksheet for implementing the Gauss Elimination method to solve a system of equations. The basic instructions are given herein and the accompanying MathCAD worksheet should be consulted for additional hints and help. Each step is listed and some are followed by detailed steps on how to complete the step, while others are left to the student as exercises. All variable names in your worksheet should have your initials as subscripts in the name.

Assignment:

1. Enter your name and the current date in the upper right corner of the worksheet.

2. Enter the title of the course (EML 3034 Modeling Methods in MAE) and the assignment # (Project Assignment #3) centered at the top of the page. Note: Just as done on the previous assignments.

3. This assignment deals with implementing Gauss Elimination to solve a set of simultaneous linear equations. Up until now, we have provided guidance such that you could become familiar with MathCADs programming language, now we are asking that you code algorithms on your own. The accompanying MathCAD sheet is provided to you to provide guidance. The data for the matrix [A] and right-hand side {b} are in the ASCII text files A.dat and b.dat. You are to download these from the zipped data file on the CANVAS site and read them using the READPRN function, do not re-type the [A] matrix and {b} vector (these are shown on the help sheet only for your reference). Learning how to read input data into programs is part of the exercise. In the lab iclicker quiz, you will be required to read in a matrix [A] and a vector {b} provided to you in order to complete the quiz

These equations were generated from the equilibrium equations for the planar truss in Figure 3.27 in your course textbook using different problem parameter values. The vector of unknowns in our system [A]{x}={b} corresponds to the displacements at the nodes as shown in the figure.

MathCAD can solve the system very easily by using a Solve block, or by simply inverting the [A] matrix, that is {x}=[A]-1 {b}, use this capability to check the solutions of your code.

Try to determine the flow of the program before you start coding; understand how Gauss Elimination works and the structure should become clear.

If you are still having trouble with the assignment, your book has Pseudo code that can be used as a reference to help you with your program.

HIGHLIGHT: (1) the solution that you have found. (2) the L (infinity norm) of the residual.

4. Verify your code by solving a 3x3 or 4x4 problem for which you know the answer. Make sure the problems are diagonally dominant.

5. Determine if the given coefficient matrix [A] for your problem is diagonally dominant. Write a subroutine that will check this automatically, and determine if the simultaneous equations that you are solving have a coefficient matrix [A] that is diagonal dominant? In practice should you have used a pivoting Gausselimination routine to solve the matrix set of equations for this project?

Report if the matrix is or is not diagonally dominant

6. Solve the given set of equations utilizing your Gauss elimination code. In a single Table, provide the solution vector, provide the solution obtained by utilizing the intrinsic MATHCAD function for the inverse or the matrix, and report the residual vector from your calculation.

7. This completes your computer project assignment:

VIEW HELPSHEET for this assignment below

image text in transcribed

image text in transcribed

1. Solving Systems of Equations using Gauss Elimination: solving truss equilibrium equations - project problem 3.3 in Rao. Write a Mathcad routine that can solve the following resulting system of equations of the form: [A]{x} = {b} using Basic Gaussian Elimination (You do NOT need to include Row or Column Pivoting). The [A] matrix and right hand side vector, {b}, are given below for you to use. This is a system of N= 10 equations and N= 10 unknowns, therefore, your final solution vector, {x} should have 10 values. 4 | | | 000 | 1 | 1| 22 2] | -12 | | | | -5| 8 | 8.66 | | 10] 2 | 3 1 | | -12] 30 | 0 | 0 34 | -12 8.66 | -5 -15 | -8.66 | -5 | 8.66 | 30 | -8.66 | -15] 8.66 | -15 | 5 | 6 | 7 | -5| | | 8.66 | -12 -5 | -8.66 | 22 0 30 | 0 34 -5 | -8.66 | -12 -8.66 | -15 | 0 8 | 8.66 | -15] | -8.66 | -15 | | | 30 | 0 | 9 | 10 | | 0 -5| 8.66 | 8.66 | -15 -5 | -8.66 | -8.66 | -15 | -12] 34 | 30 | 1 | 11 0 -0.6429 3 | 4 | -0.6429 b = | -0.6429 8 | -0.6429 [10 -0.6429 Required: Verify your code by developing a systems of equations (3 x 3 or 4 x 4 ) with known solutions. You can use Mathcad's intrinsic functions to develop these test cases or make them up using the ideas presented to you in class. That is, make up a matrix Athat is diagonally dominant, make up a solution vector x, multiply the two to find the RHS vector b. Now you have a problem whose solution you know. Once you have the cases, run your Gauss code and verify that it produces the correct results. Gauss Elimination Code to solve [A]{x}={b} without partial pivoting: GAUSS(A,b) := n rows(b) for ke l..n-1 for iek+1..n -Ai, k determine the size of the given problem go across the columns k=1,2...n-1 and for every column "k" use akk as pivot element and row k to eliminate every element in the rows i =k+1, k+2...n below in that column for je 1..n A:,;+ A:,j + s-Ak,j | b; + b; + sub Matrix is now triangulated and upper triangular Back-substitute to solve for ien - 1..1 sum. -- 0 for jen.. i+ 1 sum, + sum, + A1, j'%; b; - sum, return the solution vector triangulated matrix [A] and modified RHS vector {b} 1. Solving Systems of Equations using Gauss Elimination: solving truss equilibrium equations - project problem 3.3 in Rao. Write a Mathcad routine that can solve the following resulting system of equations of the form: [A]{x} = {b} using Basic Gaussian Elimination (You do NOT need to include Row or Column Pivoting). The [A] matrix and right hand side vector, {b}, are given below for you to use. This is a system of N= 10 equations and N= 10 unknowns, therefore, your final solution vector, {x} should have 10 values. 4 | | | 000 | 1 | 1| 22 2] | -12 | | | | -5| 8 | 8.66 | | 10] 2 | 3 1 | | -12] 30 | 0 | 0 34 | -12 8.66 | -5 -15 | -8.66 | -5 | 8.66 | 30 | -8.66 | -15] 8.66 | -15 | 5 | 6 | 7 | -5| | | 8.66 | -12 -5 | -8.66 | 22 0 30 | 0 34 -5 | -8.66 | -12 -8.66 | -15 | 0 8 | 8.66 | -15] | -8.66 | -15 | | | 30 | 0 | 9 | 10 | | 0 -5| 8.66 | 8.66 | -15 -5 | -8.66 | -8.66 | -15 | -12] 34 | 30 | 1 | 11 0 -0.6429 3 | 4 | -0.6429 b = | -0.6429 8 | -0.6429 [10 -0.6429 Required: Verify your code by developing a systems of equations (3 x 3 or 4 x 4 ) with known solutions. You can use Mathcad's intrinsic functions to develop these test cases or make them up using the ideas presented to you in class. That is, make up a matrix Athat is diagonally dominant, make up a solution vector x, multiply the two to find the RHS vector b. Now you have a problem whose solution you know. Once you have the cases, run your Gauss code and verify that it produces the correct results. Gauss Elimination Code to solve [A]{x}={b} without partial pivoting: GAUSS(A,b) := n rows(b) for ke l..n-1 for iek+1..n -Ai, k determine the size of the given problem go across the columns k=1,2...n-1 and for every column "k" use akk as pivot element and row k to eliminate every element in the rows i =k+1, k+2...n below in that column for je 1..n A:,;+ A:,j + s-Ak,j | b; + b; + sub Matrix is now triangulated and upper triangular Back-substitute to solve for ien - 1..1 sum. -- 0 for jen.. i+ 1 sum, + sum, + A1, j'%; b; - sum, return the solution vector triangulated matrix [A] and modified RHS vector {b}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions