You are on page 1of 1

% Matlab code

% 4/21/2011 @9:58p.m.
% change figure units to Hz for both bode plots
% By:
% Eric Krage & Emily Neeley
clc;
clear all;
%Parameters From begining
RS = 50;
R0 = input('Please Enter Value Of R0 From part 1 solution in Ohms');
m = 1*10^(-3);
P = 1*10^(-12);
L = input('Please Input inductor Value From Part 1 in mH');
C = input('Please Input Corresponding Capacitor Value in pF');
a = 0; % from ideal table 16.1
BW = (RS+R0)/L;
K = R0/L;
W0 = 1/sqrt(L*C);
K0 = 1; % from ideal table 16.1

n = (K*[1 a]);
d = [1 BW (W0)^2];
h = tf(n,d)
figure;
bode(h)
legend('Ideal')
grid
% parasitic effects analysis
RL = input('Please Input Inductor Parasitic Resistance in Ohms'); %0.5
RP = input('Please Input Parallel Capcitor Parasitic in Ohms');%5*10^6
RC = input('Please Input Series Parasitic in Capacitor in ohms');%0.1
Req = RS+RL+R0;
L1 = ((L)*0.7);
a1 = 1/(C*(RP+RC)); % from ideal table
BW1 = (RS+R0)/L1;
K1 = R0/L1;
W01 = 1/sqrt(L1*C);
K01 = (Req+RP)/(RC+RP); % from ideal table

n1 = (K1*[1 a1]);
d1 = [1 BW1 (W01)^2*K01];
g = tf(n1,d1)
Ideal = (h);
Parasitic = (g);
figure;
bode(Ideal, 'r', Parasitic, 'g') % r & g represent graph color for data sets
legend('Ideal', 'Parasitic')
grid

You might also like