Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Could you answer this question 3? thank you! 1. Explore the roll function from numpy. First, get set up import numpy as np a =np

image text in transcribedCould you answer this question 3? thank you!

1. Explore the roll function from numpy. First, get set up import numpy as np a =np . array ( [ [1,2,3],[4,5,6],[7,8,9]], float ) Then, answer this: What do each of the following return? 1.np.roll (a, 1, axis-0) 2. np.roll(a, 1, axis-1) 3. np.roll(a, 1, axis-o) 4. np.roll(a, 1, axis-l) 2. You have a 2D array of potentials called phi. Write the new potential, phiNew, in terms of the old potential, phi, using the appropriate calls to In other words,fl-in the missing bits phiNew .25 *(np.roll(phi, ?) +np.roll (phi, ) + np.roll(phi, ) + np.roll(phi, 22?)) 3. Write the commands that you need to set to boundary values for the array phiNew to the values in Part 1 below 1. Explore the roll function from numpy. First, get set up import numpy as np a =np . array ( [ [1,2,3],[4,5,6],[7,8,9]], float ) Then, answer this: What do each of the following return? 1.np.roll (a, 1, axis-0) 2. np.roll(a, 1, axis-1) 3. np.roll(a, 1, axis-o) 4. np.roll(a, 1, axis-l) 2. You have a 2D array of potentials called phi. Write the new potential, phiNew, in terms of the old potential, phi, using the appropriate calls to In other words,fl-in the missing bits phiNew .25 *(np.roll(phi, ?) +np.roll (phi, ) + np.roll(phi, ) + np.roll(phi, 22?)) 3. Write the commands that you need to set to boundary values for the array phiNew to the values in Part 1 below

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

Students also viewed these Databases questions

Question

How to solve maths problems with examples

Answered: 1 week ago

Question

Explain Coulomb's law with an example

Answered: 1 week ago

Question

What is operating system?

Answered: 1 week ago