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

MATLAB ONLY (2 questions using matlab) ONLY PROBLEM 2 & 3!! *Please refer to the

ID: 3872413 • Letter: M

Question

MATLAB ONLY (2 questions using matlab) ONLY PROBLEM 2 & 3!!

*Please refer to the link below that has the image for problems 2 and 3*

http://img.pixady.com/2017/09/920464_matlabquestion.jpg

Problem 1(DO NOT DO!! ONLY PROBLEMS TWO AND THREE)

Write a Matlab function findEquiv such that

•findEquiv(Values, 'S', 'R') returns the equivalent resistance of any number of resistors in series (the second argument 'S' stands for “series”), the values of which are saved in the onedimensional array Values

•findEquiv(Values, 'P', 'R') returns the equivalent resistance of any number of resistors in parallel ('P' stands for “parallel”) •findEquiv(Values, 'S', 'C') and findEquiv(Values, 'P', 'C') perform the same for capacitors findEquiv(Values, 'S', 'L') and •findEquiv(Values, 'P', 'L') perform the same for inductors (i.e. the third arguments 'C' and 'L' stand for capacitors and inductors, respectively) Include this code with your report.

Problem 2

•Next you will check whether your function works properly by applying it to different resistive, capacitive and inductive networks. For example, your function should return Rab = 4.1481 (resistors and inductors in series are just the sum of the example: Req = R1 + R2 + R3.... and add inversely when they are in parallel example: 1/Req = 1/R1 + 1/R2 + 1/R3....Capacitors in series add inversely example: 1/Ceq = 1/C1 + 1/C2 + 1/C3 and in parallel are just the sum of them example: Ceq = C1 + C2) For the circuit shown on the right when you type the following in your command prompt:

Rab = findEquiv( [16 findEquiv([4 1.6], 'S', 'R')], 'P', 'R')

Or,

r1 = findEquiv( [4 1.6], 'S', 'R'); Rab = findEquiv( [16 r1], 'P', 'R')

Write expressions similar to the ones above for each of the following circuits (Figures 1-3). Include these expressions and the results with your report.

Problem 3

•For Figures 1 to 3, use a standard circuit simulation program to find the equivalent resistance, capacitance, or inductance. If the simulation program cannot directly measure any of the quantities above (e.g. if it doesn’t have an ohmmeter, it can’t measure Req), think of an indirect way of measuring it (Hint: Consider measuring the time constant of the original circuit and the equivalent circuit). Include screenshots of your simulated circuits showing the quantities of interest, and state how you measured them. Check the results against those obtained in Problem 2.

Explanation / Answer

Answer::

request = input('Enter the value of the resistance connected in Series: ');
sum = 0;
while request~=0
sum = sum + (1/request);
request = input('Enter any value of the resistance. Enter 0 to exit');
end
fprintf('The equivalent resistance is %s ',num2str(1/sum));