필터 지우기
필터 지우기

Trying to find out absolute potential due to a point charge

조회 수: 1 (최근 30일)
ImageMan
ImageMan 2014년 10월 14일
I have an vector that hold the position of an observer as well as an excel file that hold values for Q charge and x y z coordinates of a point charge. I have to use this equation V=Q/4*pi*epsilon[norm(observer-pointchargelocation)] for all of the elements in the excel file. I know how to do this one at a time but I was hoping someone could point me in the direction of a quicker way to isolate the xyz position of each row and find the magnitude. My test code so far to find one potential is this
observer_Test=[1 -3 4];
pointCharge=[3 -5 3];
epsilon=8.85e-12;
distance=observer_Test-pointCharge;
q=3;
magnitude=norm(distance);
v=q/(4*pi*epsilon*magnitude)
however I would like to extract the magnitude for each point charge position rather than do them one by one. Also I know to extract each charge from the charge column of the excel I would do something like
for i=numel(Q)
charge=Q(i)
end
However I dont know how to extract the rows of each position x,y,z and norm them and then apply the above equation to each charge to get the potential then sum all the potentials up.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by