MATLAB QUESTION (PLEASE show all steps) Write a function named r_series_max_powe
ID: 2248469 • Letter: M
Question
MATLAB QUESTION (PLEASE show all steps)
Write a function named r_series_max_power which computes the equivalent resistance and maximum power rating of a network of resistors in series. The function arguments are two-row vectors (of equal length, length1), the first containing resistance values and the second containing the corresponding power ratings. The function returns two values, equivalent resistance, and maximum power rating. Note that the maximum power rating of the network occurs when at least one resistor is operating at its maximum power rating and no resistors are operating above their maximum power rating. Test the function on the following two examples and show the results (your output format may be slightly different than shown in the example).
Explanation / Answer
Ans)
========MATLAB code with explanations============
function [ r_eq, max_power ] = r_series_max_power( R_vector,P_vector )
%R_SERIES_MAX_POWER Summary of this function goes here
% Detailed explanation goes here
r_eq=sum(R_vector);%series equivalent resistance is sum of all resistors in series
%let us find individual current ratings of each resistor in vector 'I'
I=sqrt(P_vector./R_vector);%current vector I=sqrt(P/R) as P=I^2 *R
%To find maximum power of network ,we should take minimum current rating
%otherwise other resistors overloaded i.e more power than its rating ,so to
%find we found minimum of all 3 current ratings by using 'min' function
P_max=(min(I)).^2*R_vector;%power vector has power dissipated in all 3 resistors for the
% minimum current found above
max_power=sum(P_max); %to get total power rating of network add all powers dissipated
%in all three resistors
end
=======================
Result in command window
>> [req, maxpower]=r_series_max_power([10 10 10],[5 5 5])
req =
30
maxpower =
15.0000
>>
=========
>> [req, maxpower]=r_series_max_power([10 20 20],[5 4 3])
req =
50
maxpower =
7.5000
================
The second test case where R=[10 20 20] and P=[5 4 3] the total resistance is 10+20+20=50 ohms
where as max power rating of network is when 20 ohms 3 watts resistor is fully loaded because it gives less current than others so I^2=3/20=0.15 ,the same current flows through other resistors as they are in series ,so
10 ohm power =10*0.15=1.5 W
20 ohm= 20*0.15=3 W
20 ohm=20*0.15=3 W
Total power Pmax=1.5+3+3=7.5 W which is same as obtained by matlab code above ,I gave the explanation because your answer of 42 W shown in question is wrong
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.