Question
I have to solve this problem on MATLAB and I'm not sure how. What are the (a) magnitude and (b) direction of the net electrostatic
I have to solve this problem on MATLAB and I'm not sure how.
What are the (a) magnitude and (b) direction of the net electrostatic force on particle 4 due to the other three particles? All four particles are fixed in the xy plane, and q1 = 3.20 1019 C, q2 = +3.20 1019 C, q3 = +6.40 1019 C, q4 = +3.20 1019 C, 1 = 35.0, d1 = 3.00 cm, and d2 = d3 = 2.00 cm.
k=8.99E9; %Constant
% charge experiencing the force
q(1,1)=4E-6;
x(1,1)=0;
y(1,1)=0;
% surrounding charges
q(2,1)=-6.0E-6;
r(2,1)=0.15;
x(2,1)= r(2,1).*cosd(73);
y(2,1)= r(2,1).*sind(73);
q(3,1)=-5.0E-6;
r(3,1)=0.1;
x(3,1)=r(3,1).*cosd(0);
y(3,1)=r(3,1).*cosd(0);
for i=2:3;
% displacement between charges
A=x(i,1)-x(1,1); % x displacement
O=y(i,1)-y(1,1); % y displacement
angle=atan(O/A); % angle with respect to +x axis *
% if statement below corrects angle for indiscernible quadrants
if (O/A)>0 & A<0;
angle=angle+pi();
elseif (O/A)<0 & A<0;
angle=angle+pi();
end
% calculates Coulomb's force
F1i(i-1,1)=k*abs(q(1,1))*abs(q(i,1))/(r(i,1).^2);
F1iX(i-1,1)=F1i(i-1,1)*cos(angle);
F1iY(i-1,1)=F1i(i-1,1)*sin(angle);
% if statement corrects for repulsive forces
if q(1,1)*q(i,1)>0;
F1iX(i-1,1)=-1*F1iX(i-1,1);
F1iY(i-1,1)=-1*F1iY(i-1,1);
end
end
%Results
FX=sum(F1iX) %sum of x components
FY=sum(F1iY) %sum of y components
F=sqrt(FX^2+FY^2) %magnitude of vector sum
Th=atand(FY/FX); %angle in degrees from positive x axis*
if (FY/FX)>0 & FX<0; %corrects for quadrant issue
Th=Th+180;
elseif (FY/FX)<0 & FX<0;
Th=Th+180;
end
Th %corrected angle in degrees
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started