Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

np . pi Make sure your ( Python ) code passes ALL test provided by the following code: ' ' Check whether grodf

np.pi
Make sure your (Python) code passes ALL test provided by the following code:
"'"'Check whether grodf is a function with a tuple output" "'
assert callable(gradf), "Sorry, you need gradf defined as a function"
assert isinstance(grodf(2 np.pi/4),tuple), "Sorry, your output is not a tuple."
assert len(grgdf (2,np.4), "Sorry, the answer should be a tuple of length 2
And
assert abs(gradf(2,np.pi/4)[0]-1.24292646471695)=1e-5, "Sorry, partial deriv. w.r.t. x is wrong"
assert abs(grgdf(2np.pi/4)[1]-6.85971476198386)=1e-5, "Sorry, partial deriv. w.r.t. y is wrong"
And
assert np.linglg:norm(np.array(gradf(3,np.pi/6))-np.array((0.72237426,6.79537460)))=1e-5, "Sorry, grodf(5,np.pi/3) is wrong"
assert np.linglg:norm(np.array(gradf(5.np.pi/3))-np.array((6.39247624,31.0675475)))=1e-5, "Sorry, grodf(5.n......p/3) is wrong"
image text in transcribed

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

Modern Database Management

Authors: Heikki Topi, Jeffrey A Hoffer, Ramesh Venkataraman

13th Edition

0134773659, 978-0134773650

More Books

Students also viewed these Databases questions