Question
MATLAB CODE: A circuit consists of a Thvenin equivalent source (V th and R th ) and a resistive load (R load ). Write a
MATLAB CODE:
A circuit consists of a Thvenin equivalent source (Vth and Rth) and a resistive load (Rload). Write a script which prompts the user to enter values for Vth and Rth, then computes and plots both power delivered to the load and efficiency as a function of the load resistance. The efficiency is defined as power delivered to the load divided by power supplied by the voltage source (power dissipated by Rth is considered "lost" power). Plot both results on the same plot using yyaxis to get independent y-axes. Add a legend to identify each result. Use a linear x-axis for the load resistance value and choose the range of x-axis values so that the maximum power point is always shown. (Hint: the range of x-axis values will need to depend on the value of Rth, and we know (or should know) from circuits class that the maximum will occur when the resistance values are equal.) Include the values of Vth and Rth in the plot title (one way to do this is to create a string, using sprintf() or alternatively a combination of num2str() and '[ ]', then pass that string to title()). Test your script with the the following input values: (a) 15 V and 33 ?, (b) 120 V and 8.2 k?, and (c) one set of values which you choose. As always, title the plot, label the axes, and include units.
Repeat the above except use a logarithmic x-axis. Choose beginning and ending values to go from approximately one decade below to approximately one decade above the maximum power point. For the lower limit this can be accomplished by taking the log of the resistance, subtracting a number slightly less than one, rounding down to the nearest integer value, and using that as an argument to logspace(), e.g. r = logspace ( floor(log10(Rth)-0.8) , ... ) ; a similar method can be used to obtain the upper limit. Interpret "approximately" loosely and experiment with variations of this to find a function that produces reasonable x-axis values regardless of the Thvenin resistance.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started