calp.cpp 720 B

1234567891011121314151617181920
  1. ///////////////////////////// 计算发动机比冲 //////////////////////////////
  2. #include <iostream>
  3. #include <armadillo>
  4. #include <time.h>
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7. #include "GPM.h"
  8. using namespace std;
  9. using namespace arma;
  10. /////////////////////////////// 计算发动机比冲 //////////////////////////////
  11. int calp(vec Ma, vec phit,vec alpha, vec * CT, vec * IspDim)
  12. {
  13. int n = size(Ma)(0);
  14. vec Alpha = alpha / datum::pi * 180;
  15. *IspDim = 983.5 + 2187 * phit + 25.14*Ma - 35.11*phit%Ma - 562.5*phit%phit - 4.84*Ma%Ma - 6.782*phit%Ma%Ma + 31.55*phit%phit%Ma;;
  16. *CT = -0.3889 + 0.004263*Alpha + 0.3786*Ma + 0.005587*Alpha%Ma - 7.816e-9*Alpha%Alpha - 0.008242*Ma%Ma - 2.86e-11*Alpha%Alpha%Ma;
  17. return 1;
  18. }