Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

answer in jupyter notebook Here we want to define a function z of x and y coordinates: z=B+xsinAxcos(y+r) where r=x2+y2,A and B are constants. We

answer in jupyter notebookimage text in transcribed

Here we want to define a function z of x and y coordinates: z=B+xsinAxcos(y+r) where r=x2+y2,A and B are constants. We then plot the function with a colour map and make a histogram giving some details about the map. In particular, please do the following: - Introduce a Python function that does the following (1) defines Numpy arrays x and y from a to b with N elements each; (2) computes the values of the function z as defined above; (3) accepts N,a and b as arguments and A and B as keywords with default values A=1,B=0;(4) return arrays x,y and the 2D Numpy array z. - Produce a figure with two panels side by side horisontally. The left hand side panel should show the colour map image and a contour plot (on the same image) of function z for A=1,B=1,N=100,a=0,b=2. The right hand panel should show the histogram of the values of z for all the ( NN ) pixels. Make sure that you plot looks professional, eg. has labels and the title. Test that your code works for B between 0 and 2 . - Compute and print in one line the mean of the function z(x,y) on the domain defined above. Use . format statement and the scientific notation with 4 digits after the floating point

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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

8th Edition

013460153X, 978-0134601533

More Books

Students also viewed these Databases questions

Question

In what ways do personal and social media change how we think?

Answered: 1 week ago