Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 2 Write a Python function my_quadratic: The function takes 3 input: Hessian matrix Q, vector b, and vector x. (2pts) Test to see if
Problem 2 Write a Python function my_quadratic: The function takes 3 input: Hessian matrix Q, vector b, and vector x. (2pts) Test to see if the inputs have proper dimension. Print an error message if the dimensions of vectors are not correct. (2pts) Function returns 2 ouput: first is the quadratic function value evaluated at point x, second is the gradient of the function at point x. (6pts) Test to see if the quadratic is convex or not. Display a message if it is convex or not. You can use the a built-in function in Python that returns the eigenvalues of a matrix A. (5pts). Problem 2 Write a Python function my_quadratic: The function takes 3 input: Hessian matrix Q, vector b, and vector x. (2pts) Test to see if the inputs have proper dimension. Print an error message if the dimensions of vectors are not correct. (2pts) Function returns 2 ouput: first is the quadratic function value evaluated at point x, second is the gradient of the function at point x. (6pts) Test to see if the quadratic is convex or not. Display a message if it is convex or not. You can use the a built-in function in Python that returns the eigenvalues of a matrix A. (5pts)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started