Calculation of Electric Field for the given two point charges.

11 views (last 30 days)
There are two point charges 10nC at (1, 0, 2) and 5nC at (-2, 0, 3).
Calculate E at (1,3,2).
how to write matlab?
  1 Comment
Sam Chak
Sam Chak on 15 Mar 2022
Can you at least show the formula?
I think this has something to do with College Physics, and remember that it bears similarity to Newton's law of universal gravitation. If the unit C stands for Coulomb, then I think it is related to Coulomb's law.
If this is a problem in your coursework, I'd suggest you to plot the Electric Field to impress your Lecturer.
https://www.mathworks.com/help/matlab/ref/contour.html

Sign in to comment.

Answers (4)

Sam Chak
Sam Chak on 16 Mar 2022
Better ask a physics teacher or a physicist to check.
The electric field at for the first positive Charge
The electric field at for the second positive Charge
From the superposition principle, we can find the total electric field at , by adding the electric fields as vectors:
Basic MATLAB script:
Pa = [1, 0, 2];
Pb = [-2, 0, 3];
Pe = [1, 3, 2];
Rae = sqrt((Pa(1) - Pe(1))^2 + (Pa(2) - Pe(2))^2 + (Pa(3) - Pe(3))^2)
Rbe = sqrt((Pb(1) - Pe(1))^2 + (Pb(2) - Pe(2))^2 + (Pb(3) - Pe(3))^2)
epsilon = 8.85e-12;
k = 1/(4*pi*epsilon)
Qa = 10e-9;
Qb = 5e-9;
Eae = k*Qa/Rae^2
Ebe = k*Qb/Rbe^2

jonnadula
jonnadula on 4 Aug 2023
Calculate the electric field at each point on the grid due to four, point charges using Coulomb's law and the principle of superposition

Cuneyt
Cuneyt on 12 May 2024
Write a MATLAB script to calculate and plot the electric field magnitude around a single-point charge located at the origin.
Instructions:
1. Create a Grid: • Define a 2D grid of points extending from -0.1 m to 0.1 m in both the x and y directions using linspace and meshgrid.
2. Calculate the Electric Field: • Calculate the distance from each grid point to the charge. • Use Coulomb's Law to compute the electric field magnitude at each point: 𝐸=𝑘𝑄𝑟2E=r2kQ.
3. Handle Singularities: • Manage the singularity at the charge location by setting the electric field to NaN or by capping the field value.
4. Plot the Field: • Use imagesc or contourf to plot the electric field magnitude. Use a color bar to represent different magnitudes.

Vinay Gowda
Vinay Gowda on 1 Oct 2024
find the magnitude and direction at point (0,2,3) due to a charge Q 10nc at(1,0,1) matlab code display graph

Categories

Find more on Graphics in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!