Coulomb Forces from Point Charges in a data file setup.

This program computes Coulomb Forces from a data file that contains POSITION, and CHARGE values in simple vector form, vs a defined charge.

Ahora está siguiendo esta publicación

Files in zip: coulomb_forces_001.m

%%%%%%%%%%%%%%%%%%%%%%%%
Attention: you have to create a data file with your point charges around your test point charge, with the filename "data_coulomb_001.dat" in this format:
x1 y1 z1 charge1
x2 y2 z2 charge 2
... ... ... ...
xn yn zn charge n

This is the file to be opened in the program.
%%%%%%%%%%%%%%%%%%%%%%%%

Start by defining the point at which you want to place your charge to be computed against a set of charges written in the data file.

p_001 is defined as the example test point charge, in this case at [ 0 0 0 ] with charge = 1. This information is contained in the format [ x y z "CHARGE VALUE" ].

This means p_001 = [ 0 0 0 1 ].

The data in the data file also has this format. 4th column is the CHARGE VALUE.

All you have to do is modify the values in the data file, increase or decrease the number of point charges you want, and the result is a well defined matrix "F".

Matrix "F" has the following format:

[ FORCE IN X FORCE IN Y FORCE IN Z MAGNITUDE OF TOTAL FORCE ]

Each line is the force exerted on your "test p_001" charge by each point charge.

End of description.

Citar como

Miguel (2026). Coulomb Forces from Point Charges in a data file setup. (https://la.mathworks.com/matlabcentral/fileexchange/69825-coulomb-forces-from-point-charges-in-a-data-file-setup), MATLAB Central File Exchange. Recuperado .

Categorías

Más información sobre Weather and Atmospheric Science en Help Center y MATLAB Answers.

Información general

Compatibilidad con la versión de MATLAB

  • Compatible con cualquier versión

Compatibilidad con las plataformas

  • Windows
  • macOS
  • Linux
Versión Publicado Notas de la versión Action
4.0.0

This latest version adds the "data_coulomb_001.dat" data file so that you do not have to create it on your own.

After you test this program with those 2 files in the same folder, you can change the values of the parameters in "data_coulomb_001.dat"

3.0.0

Simply updated the correct value for the TOTAL magnitude of "FT".

2.0.0

I added the vector FT that holds the sum of all forces for each coordinate, plus the total force on your test point charge p_001.

1.0.0