Write a PYTHON program to numerically calculate the potential of an electric dipole, i.e., two opposite...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a PYTHON program to numerically calculate the potential of an electric dipole, i.e., two opposite point charges, Q/o = ±2, separated by a distance a=1 around the origin (e.g., at x = ±0.5, y=z=0). Solve the 3D Poisson equation in Cartesian coordinates but impose spherical boundary conditions, V(R)=0, at a large distance R=20 or so. (a) Starting from an initial condition of zero potential use the Jacobi relaxation algorithm with appropriate numerical tolerance and grid density to obtain the (converged) solution. Plot the equipotential lines, as well as V(r) for x=y=z. (b) Compute the magnitude of the electric field, E(r)] (r: distance from dipole center) along the x-y-z-axis and extract the exponent n for the large-distance behavior, E(r) x r for large r, through an eyeball fit. Do you find the theoretically expected n-value for the dipole? (c) Investigate how the number of required iteration steps, Niter, increases with reducing the tolerance (error) limit, "tol", and plot Niter (tol). (d) Write a program by modifying the algorithm using the Simultaneous Over Relaxation (SOR) method, and study the convergence behavior for varying grid density (fixed total size) in different relaxation runs, focusing on the 2D problem in the x-y plane (for which the optimal value of a is close to 2). For fixed point-by-point accuracy in the solution (not total tolerance!), investigate (and plot) how the number of iteration steps, Niter, depends on the number n=n, ny, of grid points. Do you find the expected behavior of Niter xn² and Niter xn, for the Jacobi and SOR method, respectively? Write a PYTHON program to numerically calculate the potential of an electric dipole, i.e., two opposite point charges, Q/o = ±2, separated by a distance a=1 around the origin (e.g., at x = ±0.5, y=z=0). Solve the 3D Poisson equation in Cartesian coordinates but impose spherical boundary conditions, V(R)=0, at a large distance R=20 or so. (a) Starting from an initial condition of zero potential use the Jacobi relaxation algorithm with appropriate numerical tolerance and grid density to obtain the (converged) solution. Plot the equipotential lines, as well as V(r) for x=y=z. (b) Compute the magnitude of the electric field, E(r)] (r: distance from dipole center) along the x-y-z-axis and extract the exponent n for the large-distance behavior, E(r) x r for large r, through an eyeball fit. Do you find the theoretically expected n-value for the dipole? (c) Investigate how the number of required iteration steps, Niter, increases with reducing the tolerance (error) limit, "tol", and plot Niter (tol). (d) Write a program by modifying the algorithm using the Simultaneous Over Relaxation (SOR) method, and study the convergence behavior for varying grid density (fixed total size) in different relaxation runs, focusing on the 2D problem in the x-y plane (for which the optimal value of a is close to 2). For fixed point-by-point accuracy in the solution (not total tolerance!), investigate (and plot) how the number of iteration steps, Niter, depends on the number n=n, ny, of grid points. Do you find the expected behavior of Niter xn² and Niter xn, for the Jacobi and SOR method, respectively?
Expert Answer:
Answer rating: 100% (QA)
import numpy as np import matplotlibpyplot as plt Constants Q 10 Magnitude of each charge a 10 Separation distance R 200 Large distance for boundary condition npoints 200 Number of grid points toleran... View the full answer
Related Book For
Physics for Scientists and Engineers A Strategic Approach with Modern Physics
ISBN: 978-0133942651
4th edition
Authors: Randall D. Knight
Posted Date:
Students also viewed these programming questions
-
Below is estimated model of market values of houses Market Values-47331.38-825.161 House Age +40.91107 Square Feet a. Refer to the estimated model. Are the impacts of "House Age" and "Square Feet"...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
14. In a heat pump, 15% of the heat is from the heat generated running the compressor. The rest is from the exchange of heat with the air or ground. How much heat is generated running the compressor...
-
In a bygone day, airlines issued discount tickets to students who would be willing to fly on a particular day, with no notice, at a discounted price, one needed to show proof of being of student. The...
-
Show that, if a driven oscillator is only lightly damped and driven near resonance, the Q of the system is approximately. Total energy Q= 27 X Energy loss during one period
-
Provide your opinion as to how information technology can be very helpful to, but also can detract from, operational performance and efficiency. propose at least two examples of efforts that should...
-
Consider the simple linear regression model fit to the copolyester viscosity data in Problem 2.14. Problem 2.14 Hsuie, Ma, and Tsai ("Separation and Characterizations of Thermotropic Copolyesters of...
-
For a student, a grade of 65 percent is nothing to write home about. But for the airline . [industry], filling 65 percent of the seats . is the difference between profit and loss. The [economy] might...
-
Campbell, a single taxpayer, earns $400,000 in taxable income and $2,000 in interest from an investment in State of New York bonds. (Use the U.S. tax rate schedule.) Required: a. How much federal tax...
-
A specific closed-loop control system is to be designed for an underdamped response to a step input. The specifications for the system are as follows: %OS 5% T <2s T, < 1.5 s a. (5 marks) Identify...
-
The reaction of hydrogen gas in the presence of oxygen produces water according to the following reaction: H2 + 02 H20 Balance the chemical equation and determine: a) How many moles of 02 will be...
-
Cellular Access, Inc. is a cellular telephone service provider that reported net income of $241 million for the most recent fiscal year. The firm had depreciation expenses of $128 million, capital...
-
Who are the key customers of financial institutions? Who are net suppliers, and who are net demanders of funds?
-
Francesco Giovannis business partner, Pepino, has proposed that they invest in a coffee shop. This investment costs 90,000 today and promises to pay 22,000, 25,000, 25,000, 20,000, and 18,000 over...
-
Explain why low- cost airlines often operate a single fleet type whereas full- service network carriers use several different aircraft types.
-
Eastern Trading Company has a pretax trading profit of 250,000. Britain has a flat corporation tax rate of 19% on trading profits while Ireland has a flat rate of 12.5% on trading profits. As Britain...
-
the standard width of a high school basketball court is 50 feet. If 1 meter =3.3 feet, what is the width of the basketball court in meters? Round to the nearest tenth, if necessary.
-
Suppose you need to answer any four of seven essay questions on a history test and you can answer them in any order. a. How many different question combinations are possible? b. What is the...
-
You have three 12 F capacitors. Draw diagrams showing how you could arrange all three so that their equivalent capacitance is (a) 4.0 F, (b) 8.0 F, (c) 18 F, (d) 36 F.
-
What is the direction of the induced current in FIGURE Q30.1? FIGURE Q30.1
-
a. Complete the motion diagram by adding acceleration vectors. b. Write a physics problem for which this is the correct motion diagram. Be imaginative! Dont forget to include enough information to...
-
A container of an organic liquid a $25^{\circ} \mathrm{C}$ has a mass of $1100 \mathrm{~kg}$ and a volume of $0.94 \mathrm{~m}^{3}$. Find the liquid's weight, its density, and its specific gravity.
-
What is the pressure one mile $(1.6 \mathrm{~km})$ beneath the ocean's surface?
-
A vertical, cylindrical tank with a diameter of $10 \mathrm{~m}$ and a depth of $4 \mathrm{~m}$ is filled to the top with water at $25^{\circ} \mathrm{C}$. If the water is heated to $60^{\circ}...
Study smarter with the SolutionInn App