威望0
积分7946
贡献0
在线时间763 小时
UID1
注册时间2021-4-14
最后登录2024-11-21
管理员
- UID
- 1
- 威望
- 0
- 积分
- 7946
- 贡献
- 0
- 注册时间
- 2021-4-14
- 最后登录
- 2024-11-21
- 在线时间
- 763 小时
|
[mw_shl_code=applescript,true]clear all;
Pumps_Frequency=xlsread('D:\matlab\PUMP_HZ');
Pumps_Current=xlsread('D:\matlab\PUMP_Current');
Inlet_Flow_Level=xlsread('D:\matlab\FLOW_LEVEL');
Combination=cat(2,Pumps_Frequency,Pumps_Current,Inlet_Flow_Level);
%---Data process
Combination(any(isnan(Combination)'),=[];
%---[m,n]=size(Combination);
k1 = find(((~Combination(:,20))|(~Combination(:,21))));
Combination(k1, = [];
k2 = find((~Combination(:,16)));
Combination(k2, = [];
k3 = find((~Combination(:,9))&(~Combination(:,10))&(~Combination(:,11))&(~Combination(:,12))&(~Combination(:,13))&(~Combination(:,14)));
Combination(k3, = [];
Ave_L=(Combination(:,20)+Combination(:,21))/2;
P1_current=Combination(:,9);
P2_current=Combination(:,10);
P3_current=Combination(:,11);
P4_current=Combination(:,12);
P5_current=Combination(:,13);
P6_current=Combination(:,14);
Flowrate=Combination(:,16);
Net_input=[P1_current P2_current P3_current P4_current P5_current P6_current Ave_L];
for i=1:10
r_4(i)=0.0;q_4(i)=0.0;
r_4(i)=Combination(find(Combination(:,5)>(39+i) & Combination(:,5)<(39.4+i),1),5);
q_4(i)=Combination(find(Combination(:,5)>(39+i) & Combination(:,5)<(39.4+i),1),12);
end
[xData_4, yData_4] = prepareCurveData( r_4, q_4 );
ft_4 = fittype( 'poly3' );
[fitresult_4, gof_4] = fit( xData_4, yData_4, ft_4 );
figure( 'Name', 'Current_Frequency' );
h4 = plot( fitresult_4,'y', xData_4, yData_4 );
hold on;
legend( h4, 'A vs. HZ', 'Current_Frequency', 'Location', 'NorthEast', 'Interpreter', 'none' );
xlabel( 'HZ', 'Interpreter', 'none' );
ylabel( 'A', 'Interpreter', 'none' );
grid on
for i=1:10
r_1(i)=0.0;q_1(i)=0.0;
r_1(i)=Combination(find(Combination(:,2)>(39+i) & Combination(:,2)<(39.4+i),1),2);
q_1(i)=Combination(find(Combination(:,2)>(39+i) & Combination(:,2)<(39.4+i),1),9);
end
[xData_1, yData_1] = prepareCurveData( r_1, q_1 );
ft_1 = fittype( 'poly3' );
[fitresult_1, gof_1] = fit( xData_1, yData_1, ft_1 );
%figure( 'Name', 'Current_Frequency' );
h1 = plot( fitresult_1,'c',xData_1, yData_1 );
hold on;
for i=1:10
r_3(i)=0.0;q_3(i)=0.0;
r_3(i)=Combination(find(Combination(:,4)>(39+i) & Combination(:,4)<(39.4+i),1),4);
q_3(i)=Combination(find(Combination(:,4)>(39+i) & Combination(:,4)<(39.4+i),1),11);
end
[xData_3, yData_3] = prepareCurveData( r_3, q_3 );
ft_3 = fittype( 'poly3' );
[fitresult_3, gof_3] = fit( xData_3, yData_3, ft_3 );
h3 = plot( fitresult_3,'g',xData_3, yData_3 );
hold on;
for i=1:10
r_2(i)=0.0;q_2(i)=0.0;
r_2(i)=Combination(find(Combination(:,3)>(39+i) & Combination(:,3)<(39.4+i),1),3);
q_2(i)=Combination(find(Combination(:,3)>(39+i) & Combination(:,3)<(39.4+i),1),10);
end
[xData_2, yData_2] = prepareCurveData( r_2, q_2 );
ft_2 = fittype( 'poly3' );
[fitresult_2, gof_2] = fit( xData_2, yData_2, ft_2 );
h2 = plot( fitresult_2,'b',xData_2, yData_2 );
hold on;
for i=1:10
r_5(i)=0.0;q_5(i)=0.0;
r_5(i)=Combination(find(Combination(:,6)>(39+i) & Combination(:,6)<(39.4+i),1),6);
q_5(i)=Combination(find(Combination(:,6)>(39+i) & Combination(:,6)<(39.4+i),1),13);
end
[xData_5, yData_5] = prepareCurveData( r_5, q_5 );
ft_5 = fittype( 'poly3' );
[fitresult_5, gof_5] = fit( xData_5, yData_5, ft_5 );
h5 = plot( fitresult_5,'k',xData_5, yData_5 );
hold on;
for i=1:9
r_6(i)=0.0;q_6(i)=0.0;
r_6(i)=Combination(find(Combination(:,7)>(40+i) & Combination(:,7)<(40.4+i),1),7);
q_6(i)=Combination(find(Combination(:,7)>(40+i) & Combination(:,7)<(40.4+i),1),14);
end
[xData_6, yData_6] = prepareCurveData( r_6, q_6 );
ft_6 = fittype( 'poly3' );
[fitresult_6, gof_6] = fit( xData_6, yData_6, ft_6 );
h6 = plot( fitresult_6, xData_6, yData_6 );
hold on;
[/mw_shl_code] |
|