java计算平均温度,Java MKT(平均动力学温度)值计算

公式这里找的   https://wenku.baidu.com/view/4293062b2f60ddccda38a0ce.html

32d877073e7ddfda0a3ec9ceabdf0f35.png

a8d71832a8468e09337810669f13746a.png    (开尔文和摄氏度的关系)

07243326b97044937cad3eb533efc6bf.png

3e29c41de6c4f9e59e1e35979c4a6c04.png

n 表示记录温度的总次数

过程

假设有2个温度平均值( 23°C 、25°C ),即 n = 2

先列一下  各项的值(先列表,再把公式上的用表的数据代替  最后才计算)

048747e69d430f326a7b597589d6a99c.png

(好吧。。。 不会用word画公式)

-10000K

ln( (e的-33.772 次方 + e的-33.546 次方)除以2  )

用我大PS之术

55abfb1861552a81a4b80330b41468a7.png

5d56df9aff76b99a02261e1ec5d104fb.png

// 两个温湿度平均值参与计算

double temp1 = 23.0;

double temp2 = 25.0;

int n = 2;

double t1 = -(10000/(temp1+273.1));//t1值为 ΔH/RT , 根据公式: H/R=10000K K = 273.1 + 温度 所以 10000除以K 等于 t1

double t2 = -(10000/(temp2+273.1));

double e1 = Math.exp(t1);//求e的t1次方的值 //Math.exp(x) e的x次方

double e2 = Math.exp(t2);//-33.546

double result = Math.log((e1+e2)/n); //Math.log 对数计算(以e为底的log对数计算)

System.out.println("ΔH/RT1: "+t1);

System.out.println("ΔH/RT2: "+t2 +"\n ---------------------------- \n");

System.out.printf("e 的值为 %.4f%n", Math.E);

System.out.println("e1: "+e1);

System.out.println("e2: "+e2+"\n ---------------------------- \n");

System.out.println("ln结果: "+result);

System.out.println("结果K =:"+ (-10000/result) );

System.out.println("最后结果: "+ ((-10000/result)-273.1) + "\n\t也就是说MKT(平均动力学温度)为"+ String.format("%.2f", ((-10000/result)-273.1)) );

结果

ΔH/RT1: -33.77237419790611

ΔH/RT2: -33.545790003354576

----------------------------

e 的值为 2.7183

e1: 2.1520098017475617E-15

e2: 2.699283565142198E-15

----------------------------

ln结果: -33.6526782324868

结果K =:297.15316953128695

最后结果: 24.053169531286926

也就是说MKT(平均动力学温度)为24.05

最终结果

public static void main(String[] args) {

// 两个温湿度平均值参与计算

double temp1 = 23.0;

double temp2 = 25.0;

Listlist = new ArrayList();

list.add(temp1);

list.add(temp2);

int n = list.size();

double temp = 0;

for (int i = 0; i < n; i++) {

double e = Math.exp(-10000/(list.get(i)+273.1));

temp = temp + e;

}

double result = (-10000/Math.log(temp/n))-273.1;

System.out.println("MKT(平均动力学温度)为"+ String.format("%.2f", result ));

}

同事采用C语言计算  但是没有计算对数的库,采取先计算对数的方式,     我未经许可   不敢擅自添加到博客上

-- 2020-07-31  他发博客了

https://blog.csdn.net/weixin_38343172/article/details/104537767

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值