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

📄 getmphrpm.m

📁 用MATLAB编写关于飞机设计的matlab程序
💻 M
字号:
function [LDA, MPH, RPM, S28, Ufixed]=GETMPHRPM(C1,LDA, Acousvel, MF,  Rad, H)
%      LDA,S28,MPH,RPM,Ufixed,是自己的内部变量
%      Character S28*3
%      Real MPH, RPM, Acousvel, Rad, D1, D2, MF, MPHMIN
%      Integer LDA, Ufixed
%      Common /logunits/imon,ikey
%cc    common /RPM/ RPM22
%      common /vel/ velosity
       
%       
        MPH=0.0;
        RPM=0.0; 
%
       MPHMIN=10.0;%(最小飞行速度)
       RPMMIN=100.0;%(最小转动速度)
%
      FLAGUfixed=0;
      while FLAGUfixed<=0
	        fprintf('*********************Select one of these alternates:*************************\n');
            fprintf('      1.) Airspeed FIXED at selected value \n');
            fprintf('      2.) Propeller RPM FIXED at selected value\n');
            fprintf('   (1 ~ 2)?\n ');
%	Read(ikey,*) Ufixed
            Ufixed = input('****************Input your selection!***************\n'); 
            
	        if (Ufixed==1)|(Ufixed==2)
               FLAGUfixed=1;   
            else   
               fprintf('******* Incorrect Entry.  Please Try Again. !!!***********************\n');
               FLAGUfixed=0;
            end
      end   
      if Ufixed==1           % Airspeed FIXED at selected value
               LDA = abs(LDA);
               S28 = 'RPM';           % S28标记未曾固定的方法
               D1 = Acousvel/MF;
               D2 = 0.75*D1;
               fprintf('\n'); 
               fprintf('\n');
               fprintf('**********The speed of sound is  %8f  MPH at an altitude of  %6f feet\n*********',D1, H);%     Write(imon,201) D1, H
                                                                                                      % 201   FORMAT(1X,'The speed of sound is ',f8.2,' MPH at an altitude of ',
                                                                                                      %     &   F5.1,' thousand ft.')
%---20头    Continue
               FLAGMPH=0;
               while FLAGMPH<=0
                     MPH=input('**************Input you FIXED Airspeed !*******************\n');                   %Read(ikey,*) MPH
                     if (MPH>=MPHMIN)|(MPH<=D2)
                         FLAGMPH=1;
                     else
                         FLAGMPH=0;
                         fprintf('**************Your input is out of range,try again!!!************\n');
                     end
               end
%---20尾    Goto 20
%      Endif
      else
               LDA = -abs(LDA);         %Propeller RPM FIXED at selected value
               S28 = 'MPH';
               D1 = C1*Acousvel/(3.14159*Rad);
               D2 = 0.85*D1;
               fprintf('**********Blade tip rotational speed is sonic at %8f  RPM.*********\n',D1);%Write(imon,*),Write(imon,203) D1
             %203   FORMAT(1X,'Blade tip rotational speed is sonic at ', F8.1, ' RPM.')
%---21头    Continue
               FLAGRPM=0;
               while FLAGRPM<=0
                     fprintf('*******Enter selected RPM in a range from  %8f  to  %8f  RPM **********\n', RPMMIN,D2);
                     %Write(*,204) RPMMIN,D2
                     %204   FORMAT(1X,'Enter selected RPM in a range from',f8.1,' to ',f8.1, ' RPM. ') 
                     %     write(*,*) 'RPM = ',RPM
                     %     read(*,*)
       
                     RPM=input('*********** Input your expexted RPM *************\n');   %     Write(imon,*) 'RPM?'
%     Read(ikey,*) RPM
%      RPM = RPM22
                     if (RPM>=RPMMIN)|(RPM<=D2)
                         FLAGRPM=1;
                     else
                         FLAGRPM=0;
                         fprintf('**************Your input is out of range,try again!!!************\n');
                     end
               end
%---21尾      Goto 21
%     stop '  RPM is out of range'
%     Endif
%     Endif
%     Continue
%     Return
      end

⌨️ 快捷键说明

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