[SOLVED] CSE5004 Homework 1- NumPy and Matplotlib

30.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon HW1-b2jdtk.zip (2969.6 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
πŸ”’ Securely Powered by:
Secure Checkout
5/5 - (1 vote)

HW1. NumPy and Matplotlib
1. (Matrix Arithmetic)
Let consider a matrix A and a vector b,
.
(1) Generate arrays for A matrix and b vector using NumPy library.
(2) Transpose A and apply matrix multiplication with the original matrix (ATA).
(3) Calculate x as the solution of ATAx = ATb.
(4) Calculate the norm of Ax βˆ’ b with line-by-line coding and using NumPy library.
2. (Drawing Graphs)
A two-dimensional Ackley function, f(x,y), has many local minima and one global minimum in the domain, (x,y) ∈ [βˆ’4,4] Γ— [βˆ’4,4].
f(x,y) = βˆ’aexp(βˆ’bp0.5(x2 + y2)) βˆ’ exp(0.5(cos(cx) + cos(cy))) + a + exp(1) where a = 20, b = 0.2, and c = 2Ο€.
(1) Plot a 2D contour of the Ackley function on (x,y) ∈ [βˆ’4,4] Γ— [βˆ’4,4].
(2) Plot a 3D graph of the Ackley function on (x,y) ∈ [βˆ’4,4] Γ— [βˆ’4,4].
(3) Find the global minimum and its position.
(4) Plot a graph for f(y|x = βˆ’2), f(y|x = 0), and f(y|x = 2) in one plot with legends.
(5) Plot the x-direction averaged one-dimensional graph and the y-direction averaged one-dimensional graph on the same canvas.

  • HW1-b2jdtk.zip