首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >利用星体大小和温度确定宜居带JS

利用星体大小和温度确定宜居带JS
EN

Stack Overflow用户
提问于 2022-10-07 21:51:43
回答 1查看 38关注 0票数 1

所以我上网了解如何根据行星体的大小和温度,以及它与恒星的距离来计算行星体的温度。它带来了这样的解决方案:

代码语言:javascript
复制
function calcBodyTempSolar(starTemp, starRadius, bodySemiMajorAxis) { //MAGIC math. Determines approx. body temp based on the body's distance from it's star.
return starTemp*Math.sqrt(starRadius/(2 * bodySemiMajorAxis)) * Math.pow(.7, 1/4)}

接下来我想,“如果我能知道一个行星在一定距离下会有多热,我能逆转它来确定”宜居区“吗?”

我颠倒了上面的公式,但我得到了错误的数字。

代码语言:javascript
复制
(Math.pow(starTemp/(254.58 * Math.pow(0.7, 1/4)), 2) * (starRadius/2))/AU

运行上述公式给出了错误的数字。我输入了地球的适当温度,但它并没有给我正确的答案。(应该是1,is 1.428.)

*如果地球没有大气层。

上面方程的来源是:https://www.astro.princeton.edu/~strauss/FRS113/writeup3/

我认为我只是把第一个方程颠倒错了。但我不确定。这里有数学人来称体重吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-10-07 22:33:48

根据源中的方程式,这应该是基于恒星、大小和距离的行星温度。(这部分你说得对)。相反的情况也很简单

代码语言:javascript
复制
function calcPlanetTemp(starTemp, starRadius, distance, absorbtion) {
  absorbtion = absorbtion || 0.7
  return starTemp * Math.sqrt(starRadius / (2 * distance)) * Math.pow(absorbtion, 1 / 4)
}

var AU = 150 * 1e6; // distance to sun = 1 astornomical unit


// for earth and sun:
var planetTemp = calcPlanetTemp(6000, 700000, AU)
console.log("earth temp (celsius): ", planetTemp - 273.15)
console.log("(that's minus the greenhouse effect)")
// 265.1027012854874
/*
function calcStarTemp(planetTemp, starRadius, distance, absorbtion) {
  absorbtion = absorbtion || 0.7
  return planetTemp / (Math.sqrt(starRadius / (2 * distance)) * Math.pow(absorbtion, 1 / 4))
}
console.log("sun temp: ", calcStarTemp(planetTemp, 700000, AU))
*/

function calcDistance(planetTemp, starTemp, starRadius, absorbtion) {
  absorbtion = absorbtion || 0.7
  return 1 / (Math.pow(planetTemp / starTemp / Math.pow(absorbtion, 1 / 4), 2) * 2 / starRadius)
}
console.log("distance from sun: ", calcDistance(planetTemp, 6000, 700000, 0.7))

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73992897

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档