Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1-Analyzing Resistive Circuits Using MATLAB The Computer program MATLAB is a tool for making mathematical calculations. In this section MATLAB is used to solve the

1-Analyzing Resistive Circuits Using MATLAB

The Computer program MATLAB is a tool for making mathematical calculations. In this section MATLAB is used to solve the equations encountered when analyzing a resistive circuit. Consider the resistive circuit shown in Figure 1a. The goal is to determine the value of the input voltage, Vs, required to cause the current i to be 1 A.

change R=1 to R=3 ohms.

.

. . .

Figure 1- (a) A resistive circuit and (b) an equivalent circuit.

Resistors R1, R2, and R3 are connected in series and can be replaced by an equivalent resistor, Rs, given by Rs=R1+R2+R3 ( .1.1)

Resistors R4, R5, and R6 are connected in parallel and can be replaced by an equivalent resistor, RP, given by

(1-2)

Figure 3.8-1b shows the circuit after R1, R2, and R3 are replaced by Rs and R4, R5, and R6 are replaced by RP. Applying voltage division to the circuit in Figure 1-b gives

(1-3)

where Vo is the voltage across RP in Figure 1-1b and is also the voltage across the parallel resistors in Figure 1-1a. Ohm's law indicates that the current in R6 is given by

(1-4)

Figure 1-2 Plot of I versus Vs for the circuit shown in Figure 1-1.

Figure 1-2 shows a plot of the output current I versus the input voltage Vs. This plot shows that I will be 1 A when Vs = 14 V.

Figure 1-3 shows the MATLAB input file that was used to obtain Figure 1-2. The MATLAB program first causes Vs to vary over a range of voltages. Next, MATLAB calculates the value of I corresponding to each value of Vs using Eqs. 1-1 through 1-4. Finally MATLAB plots the current I versus the voltage Vs.

% Analyzing Resistive Circuits Using MATLAB

%--------------------------------------------------------------

% Vary the input voltage from 8 to 16 volts in 0.1 volt steps.

%-------------------------------------------------------------- Vs = 8:0.1:16;

%--------------------------------------------------------------

% Enter values of the resistances.

%--------------------------------------------------------------

R1 = 1; R2 = 2; R3 = 3; % series resistors, ohms R4 = 6; R5 = 3; R6 = 2; % parallel resistors, ohms

%--------------------------------------------------------------

% Find the current, I,corresponding to each value of Vs.

%--------------------------------------------------------------

Rs = R1 + R2 + R3; % Equation 1-1 Rp = 1 / (1/R4 +1/R5 +1/R6); % Equation 1-2 for k=1:length(Vs)

VR(k) = Vs(k) * Rp / (Rp + Rs); % Equation 1-3 I(k) = VR(k) / R6; % Equation 1-4

end

%--------------------------------------------------------------

% Plot I versus Vs.

%--------------------------------------------------------------

plot(Vs, I) grid

xlabel('Vs, V'), ylabel('I, A') title('Current in R6')

Figure 1-3 MATLAB input file used to obtain the plot of I versus Vs shown in Figure 1-2.

--------------------------------------------------------------------------------

The command by command explanation of the code to create Figure 1-2

***Question: Using MatLab Consider the resistive circuit shown in Figure 1a. of the MATLAB folder electro mechanical.... The goal is to determine the value of the input voltage, Vs, required to cause the current i to be 1 A.. change R=1 to R=3 ohms. I need the graph and the code and all other works please.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions