MATLAB ONLY (2 questions using matlab) ONLY PROBLEM 2 & 3!! *Please refer to the
ID: 2248495 • 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
Solution for problem 2:
Finding equivalent resistance:
>> r1 = findEquiv([20 50],'S','R')
r1 =
70
>> r2 = findEquiv([r1 10],'P','R')
r2 =
8.7500
>> r3 = findEquiv([r2 100 10],'S','R')
r3 =
118.7500
>> r4 = findEquiv([r3 25],'P','R')
r4 =
20.6522
>> r5 = findEquiv([r4 75 10],'S','R')
r5 =
105.6522
Finding equivalent capacitance:
>> c1 = findEquiv([1 4 0.5]*10^-6,'S','C')
c1 =
3.0769e-007
>> c2 = findEquiv([c1 5*10^-6],'P','C')
c2 =
5.3077e-006
>> c3 = findEquiv([c2 10*10^-6],'S','C')
c3 =
3.4673e-006
>> c4 = findEquiv([c3 1*10^-6],'P','C')
c4 =
4.4673e-006
>> c5 = findEquiv([2*10^-6 0.1*10^-6],'P','C')
c5 =
2.1000e-006
>> c6 = findEquiv([c4 c5],'S','C')
c6 =
1.4285e-006
Find equivalent inductance:
>> l1 = findEquiv([1*10^-3 0.5*10^-3],'P','L')
l1 =
3.3333e-004
>> l2 = findEquiv([0.2*10^-3 0.5*10^-3 l1],'S','L')
l2 =
0.0010
>> l3 = findEquiv([0.25*10^-3 l2],'P','L')
l3 =
2.0130e-004
>> l4 = findEquiv([0.8*10^-3 l3],'S','L')
l4 =
0.0010
>> l5 = findEquiv([2*10^-3 l4],'P','L')
l5 =
6.6724e-004
>> l6 = findEquiv([0.1*10^-3 l5],'S','L')
l6 =
7.6724e-004
>>
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.