Pankaj(ADS)

Featured post

Python Codes for Electric Potential

Python Codes for Electric Potential Code:- import numpy as np import math import matplotlib.pyplot as plot ''' Calculating Elect...

Wednesday 21 April 2021

Matlab Codes (RC -Transients Circuits)

0 comments

 Matlab Codes (RC -Transients Circuits)

Plotting RC transient analysis of C = 10 μF, use MATLAB to plot the voltage across the capacitor if R is equal to (a) 1.0 kΩ, (b) 10 kΩ and (c) 0.1 kΩ (d) 0.01  

Circuit diagram








MatLab Code:-

c = 10e-6; 

r1 = 1e3;

pan1 = c*r1;

t = 0:0.002:0.05;

v1 = 10*(1-exp(-t/pan1));

r2 = 10e3;

pan2 = c*r2;

v2 = 10*(1-exp(-t/pan2));

r3 = .1e3;

pan3 = c*r3;

v3 = 10*(1-exp(-t/pan3));

r4 = 0.01e4;

pan4 = c*r4;

v4 = 10*(1-exp(-t/pan4));

plot(t,v1,'+',t,v2,'o', t,v3,'*',t,v4,'-')

axis([0 0.06 0 12])

title('Charging of a capacitor with Four time constants')

xlabel('Time, s') 

ylabel('Voltage across capacitor')

text(0.03, 5.0, '+ for R = 1 Kilohms')

text(0.03, 6.0, 'o for R = 10 Kilohms')

text(0.03, 7.0, '* for R = 0.1 Kilohms')

text(0.03, 8.0, '- for R = 0.01 Kilohms')

Output (Graph)



No comments:

Post a Comment