1 函数
k是常数,Ma是变量
2应用程序
点击上方资源下载
3 计算
3.1 c语言
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <math.h>#define k 1.4 // k为常数// 定义的函数
double T(double Ma) {return pow((1 + (k - 1) / 2 * Ma * Ma), -1);
}double Pi(double Ma) {return pow((1 + (k - 1) / 2 * Ma * Ma), -k / (k - 1));
}double E(double Ma) {return pow((1 + (k - 1) / 2 * Ma * Ma), -1 / (k - 1));
}double lambda(double Ma) {return Ma * sqrt((k + 1) / (2 + (k - 1) * Ma * Ma));
}double q(double lambda) {return pow(((k + 1) / 2), 1 / (k - 1)) * lambda * pow((1 - (k - 1) / (k + 1) * lambda * lambda), 1 / (k - 1));
}double Y(double lambda_val) {return q(lambda_val) / Pi(lambda_val);
}double Z(double lambda) {return lambda + 1 / lambda;
}double f(double lambda) {return pow((2 / (k + 1)), 1 / (k - 1)) * q(lambda) * Z(lambda);
}double R(double lambda) {return Pi(lambda) / f(lambda);
}int main() {double Ma;printf("请输入Ma值: ");scanf("%lf", &Ma);printf("\nT(Ma) = %f\n", T(Ma));printf("Π(Ma) = %f\n", Pi(Ma));printf("E(Ma) = %f\n", E(Ma));double lambda_val = lambda(Ma);printf("λ = %f\n", lambda_val);printf("q(λ) = %f\n", q(lambda_val));printf("Y(λ) = %f\n", Y(lambda_val));printf("Z(λ) = %f\n", Z(lambda_val));printf("f(λ) = %f\n", f(lambda_val));printf("R(λ) = %f\n", R(lambda_val));return 0;
}