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.
[SOLVED] CSE5004 Homework 1- NumPy and Matplotlib
30.00 $
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
Securely Powered by:
- HW1-b2jdtk.zip



