- Details
- Parent Category: Programming Assignments' Solutions

# We Helped With This Python Programming Homework: Have A Similar One?

Category | Programming |
---|---|

Subject | Python |

Difficulty | College |

Status | Solved |

More Info | Python Help Online |

## Short Assignment Requirements

## Assignment Description

**ME581 Homework 2 **

**Due: 4:15pm
September 26, 2017 **

** **

The following problems are to be documented, solved, and presented in a Jupyter notebook.

**On-Campus students:** Save
the notebook as a single PDF, then print and return a hard copy in class.

**Off-Campus students:**
Save the notebook as a single PDF, then upload and submit the PDF in
Blackboard. The name of the file should be SURNAME-HW2.pdf.

### Problem 1

A system of equations 𝐴𝒙 = 𝒃 is given as

2.01 1.99 4

[ ] 𝒙 = [ ] .

1.99 2.01 4

The solution to this system of equations is

1

𝒙 = [ ] , 1

and one approximate solution is

2

𝒙̃ = [ ] .

0

(i) Compute the error 𝒆 = 𝒙̃ − 𝒙.

(ii) Compute the residual 𝒓 = 𝐴𝒙̃ − 𝒃.

(iii) Using the 𝑙_{∞} norm, compute the relative error _{‖}^{‖}_{𝒙}^{𝒆‖}_{‖}__ ^{∞}__∞ .

(iv) Using the 𝑙_{∞} norm, compute the condition number 𝜅_{∞}.

(v) Using the 𝑙_{∞} norm, compute the relative residual _{‖}^{‖}_{𝒃}^{𝒓‖}_{‖}__ ^{∞}__∞ .

(vi) Compute the product of the condition number and the relative residual.

(vii) Compare the relative error to the product of the condition number and the relative residual.

### Problem 2

Let

5.1 8.7 9.48

𝐴 = [ ] and 𝑏 = [ ] .

2.4 4.1 4.48

(i) Using the 𝑙_{∞} norm, compute the condition number 𝜅_{∞}(𝐴).

(ii) Solve the system of equations 𝐴𝒙 = 𝒃 for 𝒙.

(iii) Perturb the coefficient matrix 𝐴 and the right-side vector 𝒃 by

−0.001 0 0.05

𝛿𝐴 = [ ] and 𝛿𝒃 = [ ]

0.001 0 −0.05

and solve the resulting perturbed system of equations (𝐴 + 𝛿𝐴)𝒙̃ = (𝒃 + 𝛿𝒃) for the approximate solution 𝒙̃ .

(iv) Using the 𝑙_{∞} norm, compute the actual value of the relative change in the

‖𝛿𝒙‖^{∞ }solution, for the
perturbation in part (iii).

‖𝒙‖_{∞}

(v) Using the 𝑙_{∞} norm, compute the theoretical upper bound of the relative

‖𝛿𝒙‖^{∞ }change
in the solution, for the perturbation in part (iii). ‖𝒙‖_{∞}

(vi) For the perturbation in part (iii), compare the actual value of ^{‖}^{𝛿𝒙‖}^{∞} to its

‖𝒙‖_{∞ }theoretical
upper bound.

(vii) Perturb the original coefficient matrix 𝐴 and the original right-side vector 𝒃 by

0.001 −0.001 −0.1

𝛿𝐴 = [ ] and 𝛿𝒃 = [ ]

−0.001 0.001 0.1

and solve the resulting perturbed system of equations (𝐴 + 𝛿𝐴)𝒙̃ = (𝒃 + 𝛿𝒃) for 𝒙̃ .

(viii) Using the 𝑙_{∞} norm, compute the actual value of the relative change in the

‖𝛿𝒙‖^{∞ }solution, for the
perturbation in part (vii).

‖𝒙‖_{∞}

(ix) Using the 𝑙_{∞} norm, compute the theoretical upper bound of the relative

‖𝛿𝒙‖^{∞ }change
in the solution, for the perturbation in part (vii). ‖𝒙‖_{∞}

(x) For the perturbation in part (vii), Compare the actual value of ^{‖}^{𝛿𝒙‖}^{∞} to its

‖𝒙‖_{∞ }theoretical
upper bound.

### Problem 3

Solve the augmented matrix

3 1 4 −1 7

2 −2 −1 2 ^{1 }]

[ |

5 7 14 −9 21

1 3 2 4 −4

By means of

(i) Gaussian Elimination with Partial Pivoting.

(ii) Gaussian Elimination with Scaled Partial Pivoting.

### Problem 4

(i) Solve the augmented matrix by means of Gaussian Elimination with Partial Pivoting in double precision:

(ii) Using the 𝑙 norm, estimate the condition number of the coefficient matrix based on your result. The exact solution for this problem is given by

𝒙 = [1 −1 1 −1 1]^{𝑇}.

**Problem 5 **

Determine the member and reaction forces within the plane truss shown in Figure 1 when the truss is subjected to each of the following loading configurations.

(a) 500-pound forces directed vertically downward at nodes#3 and #5, and a 1000pound force directed vertically downward at node#4.

(b) A 500-pound force directed vertically downward at nodes#3, a 1000-pound force directed vertically downward at node#4, a 1500-pound force directed vertically downward at node#5.

(c) A 1500-pound force directed vertically downward at nodes#3, a 1000-pound force directed vertically downward at node#4, a 500-pound force directed vertically downward at node#5.

(d) 500-pound force acting at node#4, and a 1000-pound force acting at node #3, both forces acting horizontally to the right.

(e) 500-pound force acting at node#4, and a 1000-pound force acting at node #5, both forces acting horizontally to the left.

Solve the problem using your GE code with partial pivoting. Show the augmented matrix and the resulting forces for each case.