Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I wrote this matlab code but it is not working I need help with it .It is to sol

ID: 2073212 • Letter: I

Question

I wrote this matlab code but it is not working I need help with it .It is to solve a problem similar to the one in the pictures.



a=400; 

b=0;

i=75;

ra=0.26;

i2=154.5;

n=0;

while(Re[n]>0)

    

(Re[n]=(a-b)/i2-ra;

z=(a-b)/i;

Eb[n+1]=a-i*z;

n=n+1;

b=Eb[n+1];

end 

Number of stages=n;

Rs1 = Re[0]-Re[1];

Rs2 = Re[1]-Re[2];

Rs3 = Re[2]-Re[3];

Solution From Example 6.7, the full-load or rated armature current is a,rated 48 A The maximum value of starting current is limited to two times rated amature current; therefore, a start. a rated E (2)(48) 96 A. With the external resistance Re inserted in series with the armature, Kirchhof voltage law yields Eb (Ra Re) Therefore, Re (V Eb)/ Ia Ra V (R, Re) At starting, the counter emf Ebo 0. Thus, Reo (220-0)/96 0.2 2.292-0.2 2.092 n

Explanation / Answer

%I have modified variable names according to given problem

Vt=400;
Eb=0;
i=75;
Ra=0.26;
i2=154.5;
n=1;
Eb(n)=0;
Re(n)=((Vt-Eb(n))/i2)-Ra;
while(Re(n)>0)
Eb(n+1)=Vt-(i*(Re(n)+Ra));
n=n+1;
Re(n)=((Vt-Eb(n))/i2)-Ra;
end

number_of_stages = n-1;
Rs1 = Re(1)-Re(2);
Rs2 = Re(2)-Re(3);
Rs3 = Re(3)-Re(4);
Rs4 = Re(4);
fprintf('%d,%d,%d,%d',Rs1,Rs2,Rs3,Rs4);