Use your knowledge of Electric Circuits to write a script file (call it currents
ID: 2079597 • Letter: U
Question
Use your knowledge of Electric Circuits to write a script file (call it currents. m) that calculates values for all three currents file (11, 12, and 13) in the series-parallel circuit diagram shown below. Note that the voltage the Power 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 RI, 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 11, 12, and 13. Run and test the script with the resistor values shown: -RI = 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 caseExplanation / Answer
clc;
clear;
V=5;
prompt1= 'enter the value of resistance1? '; %enter the value of first resistance R1%
prompt2= 'enter the value of resistance2? '; %enter the value of second resistance R2%
prompt3 = 'enter the value of resistance3? '; %enter the value of third resistance R3%
R1=input(prompt1);
R2=input(prompt2);
R3=input(prompt3);
R23=((R2*R3)/(R2+R3)); %calculating the parallel resistance%
Req=R1+R23; %calculating total resistance%
R23
Req
for n=1:3
I(1)=V/Req;
I(2)=I(1)*(R3/(R2+R3));
I(3)=I(1)*(R2/(R2+R3));
end
I
%if you are having any doubt regarding the coading comment in the comment box%
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.