Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to write a C++ Program that will: The basis of finite element analysis (FEA) is understanding how to use a system of linear

I need to write a C++ Program that will:

The basis of finite element analysis (FEA) is understanding how to use a system of linear equations. A system of linear equations are a group equations that can solve n equations and n unknowns. A useful way to write the system is with a matrices (Equation 1), where A is m by n matrix, X is n by 1 matrix, and B is m by 1 matrix. The solution can be found by taking the inverse of A noted as A-1 (Equation 2). If A is a 3x3 matrix, one way to find the inverse is found in Equation 3. Each element of A is a constant. For example element a21 is the constant related to the 2nd equation and 1 variable. X is a column matrix containing the variables. B is what each equation is equated to.

Equation-1 Matrix System of equations.

[A][X]=[B]

Equation-2 Solution to equations.

[X]=[A]-1[B]

Equation-3 Inverse of 3x3 Matrix

A-1=1/det(A)

???1 = 1 det(??) |??22 ??23| |??13 ??12| |??12 ??13|

|??32 ??33| |??33 ??32| |??22 ??23|

|??23 ??21| |??11 ??13| |??13 ??11|

|??33 ??31| |??31 ??33| |??23 ??21|

|??21 ??22| |??12 ??11| |??11 ??12| |??31 ??32| |??32 ??31| |??21 ??22|

Problem 1

We need to solve a system of linear equations below. The system has 3 equations and 3 unknowns.

??? + 4?? ? 2?? = ?8

?3?? ? 2?? + ?? = ?17

+2?? ? 5?? + 3?? = 15

In a C++ Program:

a) Input Validation Determine if the square 3x3 matrix has an inverse. That is if and only if det(A) ? 0 then A will have an inverse. The user should be notified if A has an inverse or not.

b) Input Validation Matrix A should only be able to input numbers, matrix X should only be the variables (x, y, z), and B should only be able to input numbers.

c) Output the A, X, and B matrix in correct matrix format.

d) Calculate the inverse of A using functions, pointers, and 2D Arrays e) Find the solution of the system or equations using functions, pointers, and 2D Arrays

Problem 2 On paper answer the following questions.

1) Which of the following is a declaration for a pointer?

a. long a; b. char *c; c. char c; d. float *k;

b) For the following declarations, determine which of the following statements if valid:

int *xPt, *yptAddr;

long *dtAddr, *ptAddr;

double *ptZ;

int a;

long b;

double c;

a) yAddr = &a; b) dtAddr = a; c) yAddr = xPt; d) ptAddr=&b;

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Oracle RMAN For Absolute Beginners

Authors: Darl Kuhn

1st Edition

1484207637, 9781484207635

More Books

Students also viewed these Databases questions

Question

Explain the importance of HRM to all employees.

Answered: 1 week ago