Answered step by step
Verified Expert Solution
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
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 . 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 belowStep 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