Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % Data from the lab
- % Gap distance
- d = (1e-3)*[2 3 4 5 6];
- % Negative DC BD volt
- Dc_neg = (1e3)*[6.4 9.5 12 13 14.5];
- % Positive DC BD volt
- Dc_pos = (1e3)*[7.6 10 14.5 15 17];
- % AC BD volt
- Ac = (1e3)*[5.5 7.4 8.8 10.1 11.8];
- %Using the poly fit function to get the approximated curves (polynomials)
- % I will take gap distances form (1mm) to (10mm) with step (1 micro m)
- d_fit = [0.001:0.00001:0.01];
- % Using the polyfit
- p_Dc_neg = polyfit(d,Dc_neg,1)
- p_Dc_pos = polyfit(d,Dc_pos,1)
- p_Ac = polyfit(d,Ac,1)
- % Getting the y axis values using the approximated polynomials
- Dc_neg_fit = polyval(p_Dc_neg,d_fit);
- Dc_pos_fit = polyval(p_Dc_pos,d_fit);
- Ac_fit = polyval(p_Ac,d_fit);
- % Plotting the curves and the practical points
- %Dc negative curve
- subplot(3,3,1);
- plot(d_fit,Dc_neg_fit,'--b',d,Dc_neg,'ob'),xlabel('Gap Distance'),ylabel('BreakDown Voltage');
- title('Negative DC BreakDown Voltage Vs. Gap Distance'),grid on,legend('DC Negative','DC Negative(practical)');
- %Dc positive curve
- subplot(3,3,2);
- plot(d_fit,Dc_pos_fit,'-r',d,Dc_pos,'or'),xlabel('Gap Distance'),ylabel('BreakDown Voltage');
- title('Positive DC BreakDown Voltage Vs. Gap Distance'),grid on,legend('DC Positive','DC Positive(practical)');
- %AC curve
- subplot(3,3,3);
- plot(d_fit,Ac_fit,'k',d,Ac,'ok'),xlabel('Gap Distance'),ylabel('BreakDown Voltage');
- title('AC BreakDown Voltage Vs. Gap Distance'),grid on,legend('AC','AC(practical)');
- % All
- subplot(3,3,4:9);
- plot(d_fit,Dc_neg_fit,'--b',d,Dc_neg,'ob',d_fit,Dc_pos_fit,'-r',d,Dc_pos,'or',d_fit,Ac_fit,'k',d,Ac,'ok');
- xlabel('Gap Distance'),ylabel('BreakDown Voltage')
- title('Positive,Negative DC and Ac BreakDown Voltage Vs. Gap Distance'),grid on;
- legend('DC Negative','DC Negative(practical)','DC Positive','DC Positive(practical)','AC','AC(practical)');
Advertisement
Add Comment
Please, Sign In to add comment