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.
引用格式
Miguel (2024). Coulomb Forces from Point Charges in a data file setup. (https://www.mathworks.com/matlabcentral/fileexchange/69825-coulomb-forces-from-point-charges-in-a-data-file-setup), MATLAB Central File Exchange. 检索来源 .
MATLAB 版本兼容性
平台兼容性
Windows macOS Linux类别
标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!版本 | 已发布 | 发行说明 | |
---|---|---|---|
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 |