Info
This question is closed. Reopen it to edit or answer.
How to find the arcing period on the inrush current waveform after energization of capacitor bank? Starting time and ending time of arcing ? matfile and code is attached below
    1 view (last 30 days)
  
       Show older comments
    
% SIMULATION OF INRUSH CURRENT IN LC CIRCUIT
% VALUES OF CIRCUIT COMPONENTS ARE PRESENTED IN MFILE
%Clear Workspace.
clear all;
close all;
clc;
%Time vector.
t=0:1.2/14030:1.2;                          %Time vector t [s].
%LC circuit components parameters.
Us=35000                                    %Circuit power source [V]
L=0.00041;                                 %Circuit inductance [Henry].
C=10e6                                      %Circuit capacitance [Mvar].
w=1/sqrt(L/C);                              %Angular frequency [kHz].
f=50                                        %Generator frequency [Hz].
f0=w/(2.*pi);                               %Frequency of transient[kHz]. 
alpha=0                                   %Switching angle 0 degrees upto 360 degrees
simout =sim('Inrushcurrent');               %Simout shows the Inrush current output.
t=Inrushcurrent.Time ;
Inrushcurrent = Inrushcurrent.Data ;
%Plot inrush current.
figure(1)
plot(t,Inrushcurrent)                      %Inrush current waveform.
title('Inrush current at 0 degrees switching angle')
ylabel('Inrush current [A]')
xlabel('Time [s]')
grid on 
hold on 
%Finding the peak values of inrush current
%Finding the peak (max of absolute value) values of inrush current (positive or negative)
Inpeak=max(max(Inrushcurrent))                %peak inrushcurrent value[A]
%After finding the peak inrush current for all angles from 0degrees to 360degrees(30deg_diff)
%The rated current is found from the last part of the waveform (beyond settling time)
%Rated inrush current is found to be 233.3 and +-2% is used to identify the settling time
figure(1)
plot([0 1.2],[233 233],'r--','LineWidth',0.03)
Rated_current = 233;
plot(Rated_current)
hold on 
%Finding the peak (max of absolute value) values of inrush current (positive or negative)
[~,locs] = max(abs(Inrushcurrent));
t_peak = t(locs);
Inrushcurrent_peak = Inrushcurrent(locs);
plot(t_peak,Inrushcurrent_peak,'dr');
text(t_peak+0.05,Inrushcurrent_peak,['Inrush current = ' num2str(Inrushcurrent_peak) ' A']);
%Finding the peak (max of absolute value) values of inrush current (positive or negative)
figure(1)
title('Inrush current at 0 degrees switching angle')
for ci = 1:phases
    [~,locs] = max(abs(Inrushcurrent(:,ci)));
    t_peak(ci) = t(locs);
    Inrushcurrent_peak(ci) = round(Inrushcurrent(locs,ci));
    subplot(phases,1,ci),plot(t,Inrushcurrent(:,ci),t_peak,Inrushcurrent_peak(ci),'dr');
    text(t_peak(ci)*1.05,0.85*Inrushcurrent_peak(ci),['Inrush current = ' num2str(Inrushcurrent_peak(ci)) ' A']);
end
ylabel('Inrush current [A]')
xlabel('Time [s]')
load('all_components_values_matlab.mat');
[samples,phases] = size(Inrushcurrent);
%Finding the peak (max of absolute value) values of inrush current (positive or negative)
figure(1)
title('Inrush current at 0 degrees switching angle')
for ci = 1:phases
    [~,locs] = max(abs(Inrushcurrent(:,ci)));
    t_peak(ci) = t(locs);
    Inrushcurrent_peak(ci) = round(Inrushcurrent(locs,ci));
    % create envelope signal for decay porting
    ind = find(t>=t_peak(ci));
    t_decay = t(ind);
    Inrush_decay = Inrushcurrent(ind,ci);
    % envelope
    N = 500;
    [YUPPER,YLOWER] = envelope(Inrush_decay,N,'peak');
    if abs(Inrushcurrent_peak(ci)) > 5000 % decay time computed only for Inrush current exceeding this threshold
        flag(ci) = 1;
        if sign(Inrushcurrent_peak(ci))>0
            envel = YUPPER;
        else
            envel = YLOWER;
        end
        ind = find(envel>1.05*envel(end));
        t_end_of_peak(ci) = t(ind(1));
        Inrushcurrent_end_of_peak(ci) = round(Inrushcurrent(ind(1),ci));
    else
        flag(ci) = 0;
        t_end_of_peak(ci) = t_peak(ci);
        Inrushcurrent_end_of_peak(ci) = Inrushcurrent_peak(ci);
    end
    decay_duration(ci) = - t_peak(ci) + t_end_of_peak(ci);
    if flag(ci) == 1
        subplot(phases,1,ci),plot(t,Inrushcurrent(:,ci),t_peak,Inrushcurrent_peak(ci),'dr',t_decay,Inrush_decay,...
            t_decay,YUPPER,t_decay,YLOWER,t_end_of_peak(ci),Inrushcurrent_end_of_peak(ci),'dk');
        text(t_peak(ci)*1.05,0.85*Inrushcurrent_peak(ci),['Inrush current = ' num2str(Inrushcurrent_peak(ci)) ' A']);
        text(t_end_of_peak(ci)*1.01,0.15*Inrushcurrent_peak(ci),['Decay Duration = ' num2str(decay_duration(ci)) ' s']);
    else
        subplot(phases,1,ci),plot(t,Inrushcurrent(:,ci),t_peak,Inrushcurrent_peak(ci),'dr',t_decay,Inrush_decay);
        text(t_peak(ci)*1.05,0.85*Inrushcurrent_peak(ci),['Inrush current = ' num2str(Inrushcurrent_peak(ci)) ' A']);        
    end
end
ylabel('Inrush current [A]')
xlabel('Time [s]')
0 Comments
Answers (0)
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!