Use your knowledge of Electric Circuits to write a script fi

Use your knowledge of Electric Circuits to write a script file (call it currents.m) that calculates values for all three currents (I1. I2, and I3) in the series-parallel circuit diagram shown below. Note that the voltage supplied by the Power Supply is +5.0 Volts. Use a for loop to repeat the following code 3 times. First, ask the user to enter values (in Ohms) for R1, R2, and R3. Calculate an equivalent value for the parallel combination of resistors R2 and R3 (call this R23). Then calculate the equivalent resistance for the entire circuit (call this Req). Use this information to calculate values for the currents I1, I2, and I3. Run and test the script with the resistor values shown: -R1 = 100, R2 = 200, and R3 = 300 Ohms for pass 1, -R1 = 300, R2 = 200, and R3 = 100 for pass 2 -R1 = 200, R2 = 300, and R3 = 100 for pass 3. Display three currents (I1, I2, and I3) with appropriate units for each case

Solution

Matlab Script current.m

V = 5; % supply voltage
for i = 1:3 % loop to run the test three times
R1 = input(\' Enter the value of R1: \'); % input R1
R2 = input(\' Enter the value of R2: \'); % input R2
R3 = input(\' Enter the value of R3: \'); %input R3
R23 = (R2*R3)/(R2+R3); % The value of R23
Req = R1+R23; % total tesistence
I1 = V/Req; % current I1
I2 = I1*R23/R2; % current I2
I3 = I1*R23/R3; % current I2
fprintf(\'I1 = %fA I2 = %fA I3 = %fA\ \',I1,I2,I3); % Results
end % end of loop

OUTPUT

>> current
Enter the value of R1: 100
Enter the value of R2: 200
Enter the value of R3: 300
I1 = 0.022727A I2 = 0.013636A I3 = 0.009091A
Enter the value of R1: 300
Enter the value of R2: 200
Enter the value of R3: 100
I1 = 0.013636A I2 = 0.004545A I3 = 0.009091A
Enter the value of R1: 200
Enter the value of R2: 300
Enter the value of R3: 100
I1 = 0.018182A I2 = 0.004545A I3 = 0.013636A

 Use your knowledge of Electric Circuits to write a script file (call it currents.m) that calculates values for all three currents (I1. I2, and I3) in the serie

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site