⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 checkdata.m

📁 用MATLAB编写关于飞机设计的matlab程序
💻 M
字号:
      function [T,Fezro]=CHECKDATA(N,Z,Beta,X,T,rows,LDA,MPH,RPM,Acousvel, Rad,S28,cols,Jmin,Jmax,H)
        
%      F1,F2,F3是否可以去掉
%      Character S28*3
%      Real D1, D2, DR, Z(0:1,0:25,0:25), Beta(0:9), X(0:9), T(0:9)
%      Real P2, MPH, RPM, Acousvel,MF, Rad, C1, Jmin, Jmax
%      Integer N, rows, F1, F2, F3, Fzero, cols ,Ufixed
%      Common /logunits/imon,ikey
%
       global Fezro  



%	***  Compare J range with available data  ***
%
      DR = 3.14159/180.0;
      MF = 1.46667;
      P1 = 10.0;
      P2 = 100.0;
      C1 = 360.0;
      F1 = 0;
      F2 = 0;
      F3 = 0;
      FLAGJ=-1;
      while FLAGJ<=0    %1     continue
            fprintf('\n'); %c       Write(imon,*) 
            fprintf('***********Checking advance ratio range against available data.**********\n');             %c	Write(imon,*) 'Checking advance ratio range against available data. '
            for  I = 1:(N+1)  %Do 3 I = 0,N
                 D1 = 3.14159*X(I)*tan( (Beta(I) - 2.0*Z(1,rows,1) + Z(1,rows-1,1))*DR );%D1 = 3.14159*X(I)*TAN( (Beta(I) - 2.0*Z(0,rows,0) + 
                                                                                     %*     Z(0,rows-1,0))*DR )
                 if (Jmin<D1)
                     Jmin = D1;
                     F1 = 1;
                 end
                 D2 = 3.14159*X(I)*tan( (Beta(I)-2.0*Z(1,2,1) + Z(1,3,1))*DR );         %D2 = 3.14159*X(I)*TAN( (Beta(I)-2.0*Z(0,1,0) + Z(0,2,0))*DR )
                 if (Jmax>D2)  %If (Jmax.gt.D2) Then
                     Jmax = D2;%Jmax = D2
                     F2 = 1;   %F2 = 1
                 end           %Endif
            end                %3Continue
            if (Jmin>=Jmax) %If (Jmin.GE.Jmax) Then
                fprintf('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');           %Write(imon,*) '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
                fprintf('The available Cl and Cd data will not support ');         % Write(imon,*) 'The available Cl and Cd data will not support '
                fprintf('any calculations for the specified twist distribution! ');%Write(imon,*) 'any calculations for the specified twist distribut
                                                                                %*ion! '
                fprintf( '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!');% Write(imon,*) '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
            end             % Endif
            if (F1==1)      %If (F1.eq.1) Then
                fprintf('J min adjusted to: %10f ',Jmin);%c		Write(imon,101) Jmin
                                                      %101   FORMAT (1X,'J min adjusted to: ', F10.3)
            end             %      Endif
            if (F2==1)      %      If (F2.eq.1) Then
                fprintf('J max adjusted to: ',Jmax);     %c		Write(imon,102) Jmax
                                                      %102   FORMAT (1X,'J max adjusted to: ', F10.3)
            end%      Endif
%C
%C	***  Check limitation by MPH or RPM  ***
%C
           fprintf('*********Checking advance ratio range against tip speed limitation.********** ');%c	Write(imon,*) 'Checking advance ratio range against tip speed limitation. '
           F3 = 0;%F3 = 0
           if (abs(LDA)==1)%If (ABS(LDA).eq.1) Then
               break       %Goto 5
           end             %Endif
           if (LDA>0)%If (LDA.gt.0) Then,是MPH固定值
               D1 = 3.14159*sqrt(1.0 / ((0.9*Acousvel/MF/MPH)^2 - 1.0));%D1 = 3.14159*SQRT(1. / ((.9*Acousvel/MF/MPH)**2 - 1.0))
               if (Jmin<D1) %If (Jmin.lt.D1) Then
                   F3 = 1;  %F3 = 1
                   fprintf('\n');  %c	        	Write(imon,*)
                   fprintf('Range of calculations limited by selected MPH.\n');     %c	        	Write(imon,*) 'Range of calculations limited by selected MPH.'
                   printf('Minimum J increased from  %6f  to  %6f   \n',Jmin,D1);   %c	        	Write(imon,103) Jmin,D1
                                                                                    %c103   FORMAT(1x,'Minimum J increased from', f6.3, 'to', f6.3)
               end%Endif
           end%Endif
           if (LDA<0)%If (LDA.lt.0) Then是RPM固定值
               D1 = sqrt((324.0*Acousvel/RPM/Rad)^2 - 3.14159^2);%D1 = SQRT((324.*Acousvel/RPM/Rad)**2 - 3.14159**2)
               if (Jmax>D1)  %If (Jmax.gt.D1) Then 
                   F3 = 2;   %F3 = 2
                   fprintf('\n');%c	        	Write(imon,*)
                   fprintf('Range of calculations limited by selected RPM.\n');%c	Write(imon,*) 'Range of calculations limited by selected RPM. '
                   fprintf('Maximum J reduced from  %6f  to  %6f  \n',Jmax,D1);%c	Write(imon,104)Jmax,D1
                                                                               %c104	FORMAT(1X,'Maximum J reduced from', f6.3, 'to', f6.3)
               end           %Endif
           end       %Endif
           FLAGJ=1;
           if (((F3==1)&(D1>=JmaX))|((F3==2)&(D1<=Jmin)))%If (((F3.eq.1).and.(D1.ge.JmaX)).or.((F3.eq.2).and.(D1.le.Jmin)))
                                                         %*     Then
               fprintf('Selected MPH/RPM conflicts with J range.\n');%Write(imon,*) 'Selected MPH/RPM conflicts with J range.'
               fprintf('Select lower MPH or higher RPM.\n');%Write(imon,*) 'Select lower MPH or higher RPM.'
               [LDA, MPH, RPM, S28, Ufixed]=GETMPHRPM(C1,LDA, Acousvel, MF,  Rad, H);%ALL GETMPHRPM(C1,LDA, Acousvel, MF, S28, MPH, RPM, Rad, Ufixed,
               FLAGJ=-1;  %(计算未成功)                                        %*                H)
               continue%Goto 1
           end%Endif
           if (F3==1) %If (F3.eq.1) Then
               Jmin = D1;%Jmin = D1
           end        %Endif
           if (F3==2)%If (F3.eq.2) Then
               Jmax = D1;%Jmax = D1
           end%Endif
      end%5     Continue(和while相对应)
      
      F3 = 0;%F3 = 0
%
%	***  Check thickness against available data  ***
%
      fprintf('\n');         %	Write(imon,*) 
      fprintf('*********Checking thickness against available data.*********\n')%	Write(imon,*) 'Checking thickness against available data. '
      Fzero = 0;%Fzero = 0
      for  I = 1:(N+1)%Do 12 I = 0,N
           if(T(I)>Z(1,1,cols))%If(T(I).gt.Z(0,0,cols)) Then(% cols已经在其他地方增加1 )
              T(I)=Z(1,1,cols);%T(I) = Z(0,0,cols)
              Fzero = 1;%Fzero = 1
           end%Endif
      end%12    Continue
      if (Fzero==1)    %If (Fzero.eq.1) Then
          fprintf('\n');%c		Write(imon,*)
          fprintf('T values limited by available Cl and Cd data\n');%c		Write(imon,*) 'T values limited by available Cl and Cd data'
          fprintf('\n');%c		Write(imon,*) 'fprintf('\n');'
          fprintf('Thickness adjusted to a maximum of:%6f \n',Z(1,1,cols));%c		Write(imon,*) 'Thickness adjusted to a maximum of: ', Z(1,1,cols)
      end%Endif
      %Return
  
%C

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -