diff --git a/bodies/__init__.py b/bodies/__init__.py index d2aa78e8019364c99962a1d8327de8dfd466551b..68e0d9b8575eaa9b6b3c6ad44e1e75cd349dc874 100644 --- a/bodies/__init__.py +++ b/bodies/__init__.py @@ -26,3 +26,7 @@ from bodies.fixed_stars.alcyone import Alcyone from bodies.fixed_stars.antares import Antares from bodies.fixed_stars.arcturus import Arcturus from bodies.fixed_stars.betelgeuse import Betelgeuse +from bodies.fixed_stars.bellatrix import Bellatrix +from bodies.fixed_stars.aldebaran import Aldebaran +from bodies.fixed_stars.vy_canis_majoris import VYCanisMajoris +from bodies.fixed_stars.uy_scuti import UYScuti \ No newline at end of file diff --git a/bodies/fixed_stars/alcyone.py b/bodies/fixed_stars/alcyone.py index a3c2fac4789f53a827c93b5ad87909084693dc81..37fd2de2d3afc5c9605d85cb0a65366a1f368d2f 100644 --- a/bodies/fixed_stars/alcyone.py +++ b/bodies/fixed_stars/alcyone.py @@ -47,7 +47,7 @@ class Alcyone(FixedStar): "mass": mass, "init_position": init_position, "init_velocity": init_velocity, - "density": 9.854, # 10.000676498446115 + "density": 9.856, "color": color, "texture": texture, "size_scale": size_scale, @@ -60,8 +60,12 @@ class Alcyone(FixedStar): if __name__ == '__main__': from bodies import Sun + import math + fixed_star = Alcyone() sun = Sun() print(fixed_star) print("质量倍数", fixed_star.mass / sun.mass) print("半径倍数", fixed_star.raduis / sun.raduis) + r = 10 + print("密度換算", fixed_star.mass / 1e9 / (4 / 3 * math.pi * pow(r * sun.raduis, 3))) \ No newline at end of file diff --git a/bodies/fixed_stars/aldebaran.py b/bodies/fixed_stars/aldebaran.py new file mode 100644 index 0000000000000000000000000000000000000000..ef60da021d12243bdebde93cfc7eada817850be8 --- /dev/null +++ b/bodies/fixed_stars/aldebaran.py @@ -0,0 +1,73 @@ +# -*- coding:utf-8 -*- +# title :大角星 +# description :大角星 +# author :Python超人 +# date :2023-02-11 +# link :https://gitcode.net/pythoncr/ +# python_version :3.8 +# ============================================================================== +from bodies import FixedStar +from common.consts import MO + + +class Aldebaran(FixedStar): + """ + 毕宿五 (Aldebaran) + 质量:太阳质量 + 颜色值:#FF9100 + 直径:44.13倍太阳直径 + +中文名毕宿五 +外文名Aldebaran +别 名金牛座α +分 类红巨星 +质 量约 1.16 M⊙ +表面温度约 3900 K +视星等0.85 等 +绝对星等约 -0.641 等 +自转周期~520 d +赤 经4时35分55.24秒 +赤 纬+16°30′33.49″ +距地距离约 65.3 光年 +半 径44.13±0.84 R☉ +光谱类型K5+III变星类型慢不规则变星径向速度54.26±0.03 km/s视 差49.97±0.75 mas表面重力1.45±0.3光 度439±17 L☉金属量-0.33±0.1 dex自转速度3.5±1.5 km/sU−B 色指数1.92B−V 色指数1.44年 龄6.4 Gyr + + ------------------------ + == 太阳参数 == + 自转周期: 24.47 地球日,自转角速度约为 0.6130 度/小时 = 360/(24.47*24) + 天体质量: 1.9891×10³⁰ kg + 平均密度: 1.408×10³ kg/m³ + """ + + def __init__(self, name="毕宿五", mass=1.16 * MO, + init_position=[0, 0, 0], + init_velocity=[0, 0, 0], + color=(250, 195, 47), + texture="fixed_star.png", size_scale=1.0, distance_scale=1.0, + rotation_speed=0.1, ignore_mass=False): + params = { + "name": name, + "mass": mass, + "init_position": init_position, + "init_velocity": init_velocity, + "density": 0.019, + "color": color, + "texture": texture, + "size_scale": size_scale, + "distance_scale": distance_scale, + "rotation_speed": rotation_speed, + "ignore_mass": ignore_mass + } + super().__init__(**params) + + +if __name__ == '__main__': + from bodies import Sun + import math + fixed_star = Aldebaran() + sun = Sun() + print(fixed_star) + print("质量倍数", fixed_star.mass / sun.mass) + print("半径倍数", fixed_star.raduis / sun.raduis) + r = 44.13 + print("密度換算", fixed_star.mass / 1e9 / (4 / 3 * math.pi * pow(r * sun.raduis, 3))) diff --git a/bodies/fixed_stars/arcturus.py b/bodies/fixed_stars/arcturus.py index 27053b709c32b54f546ab0ae861dcbf11a03634b..6ae25102ab2acff9e973cb464b11cb493a79d35c 100644 --- a/bodies/fixed_stars/arcturus.py +++ b/bodies/fixed_stars/arcturus.py @@ -16,7 +16,7 @@ class Arcturus(FixedStar): 质量:太阳质量 密度:1.16×10⁻⁴ g/cm³ 颜色值:#FF9100 - 直径:1,180倍太阳直径 + 直径:25.4倍太阳直径 中文名大角星 diff --git a/bodies/fixed_stars/bellatrix.py b/bodies/fixed_stars/bellatrix.py new file mode 100644 index 0000000000000000000000000000000000000000..199d36ddea54098d11a911a5c4627e35d556aa2d --- /dev/null +++ b/bodies/fixed_stars/bellatrix.py @@ -0,0 +1,78 @@ +# -*- coding:utf-8 -*- +# title :大角星 +# description :大角星 +# author :Python超人 +# date :2023-02-11 +# link :https://gitcode.net/pythoncr/ +# python_version :3.8 +# ============================================================================== +from bodies import FixedStar +from common.consts import MO + + +class Bellatrix(FixedStar): + """ + TODO: 参宿五 (Bellatrix) + 质量:8.6太阳质量 + 密度:1.16×10⁻⁴ g/cm³ + 颜色值:#FF9100 + 直径:5.75倍太阳直径 + + 中文名参宿五 + 外文名Bellatrix别 名猎户座γ + 分 类恒星 + 质 量8.6 M⊙ + 表面温度22000 K + 视星等1.64 等 + 绝对星等-2.78 等 + 赤 经5时25分07.9秒 + 赤 纬+6°20′58.93″ + 距地距离约 250 光年 + 光谱类型B2 III + 径向速度18.2 km/s + 视 差12.92±0.52 mas + 半 径5.75 R☉ + 表面重力3.6 cgs + 光 度9,211 L☉ + 金属量–0.07 dex + 自转速度46±8 km/s + U−B 色指数-0.86 + B−V 色指数-0.21 + 年 龄25.2 Myr + ------------------------ + == 太阳参数 == + 自转周期: 24.47 地球日,自转角速度约为 0.6130 度/小时 = 360/(24.47*24) + 天体质量: 1.9891×10³⁰ kg + 平均密度: 1.408×10³ kg/m³ + """ + + def __init__(self, name="参宿五", mass=8.6 * MO, + init_position=[0, 0, 0], + init_velocity=[0, 0, 0], + color=(122, 187, 255), + texture="fixed_star.png", size_scale=1.0, distance_scale=1.0, + rotation_speed=0.1, ignore_mass=False): + params = { + "name": name, + "mass": mass, + "init_position": init_position, + "init_velocity": init_velocity, + "density": 63.69, + "color": color, + "texture": texture, + "size_scale": size_scale, + "distance_scale": distance_scale, + "rotation_speed": rotation_speed, + "ignore_mass": ignore_mass + } + super().__init__(**params) + + +if __name__ == '__main__': + from bodies import Sun + + fixed_star = Bellatrix() + sun = Sun() + print(fixed_star) + print("质量倍数", fixed_star.mass / sun.mass) + print("半径倍数", fixed_star.raduis / sun.raduis) diff --git a/bodies/fixed_stars/canis_majoris_vy.py b/bodies/fixed_stars/canis_majoris_vy.py deleted file mode 100644 index e93040635608948590003a3cf0e684c59be9ae52..0000000000000000000000000000000000000000 --- a/bodies/fixed_stars/canis_majoris_vy.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding:utf-8 -*- -# title :大犬座VY -# description :大犬座VY -# author :Python超人 -# date :2023-02-11 -# link :https://gitcode.net/pythoncr/ -# python_version :3.8 -# ============================================================================== -from bodies import FixedStar -from common.consts import MO - - -class CanisMajorisVY(FixedStar): - """ - TODO: 大犬座VY(VY Canis Majoris) - 质量:30.0 太阳质量 - 大小:1420 太阳半径 - 颜色:0xFF, 0x8D, 0x29 - 密度:0.0004 g/cm³ - - 平均密度5.33✕10-3 至 8.38✕10-3 g/m³ 0.00533 - 恒星质量17±8 M☉ [1] - 半 径2,069 R☉ [1] [12-13] - - 中文名大犬座VY外文名VY Canis Majoris别 名VY CMa分 - 类红特超巨星发现者杰罗姆·拉朗德发现时间1801年3月7日平均密度5.33✕10-3 至 8.38✕10-3 g/m³ - 表面温度3490 K(±90)视星等6.5 至 9.6 等赤 经07时22分58.33秒赤 纬-25°46′03.24″ - 距地距离3820 光年(+260 −230)光谱型M3-M4.5(M2.5-M5e Ia) [1-3] - 视星等(U)12.01 [4] 视星等(B)10.19 [4] 视星等(V)7.95 [4] 视星等(J)1.98 [4] - 视星等(H)0.44 [4] 视星等(K)8.1 [5] U-B色指数+2.32 [6] B-V色指数+2.057 [7] V-R色指数+2.20 [6] - 变星类型SRc或Lc [8-9] 径向速度41 km/s [10] 自 - 行赤经:9.84 mas/yr 赤纬:0.75 mas/yr [7] 视 差0.83±0.08 mas [11] - 距 离1,170(+80或-70)pc,3,820(+260或-230)ly [1] 绝对热星等-9.4 - - - 热光度270,000±40,000,178,000(+40,900或-29,900)L☉ [12-14] - 表面重力-0.6±0.4 cgs [1] 有效温度3,940±90 K [1] 金属丰度[Fe/H]-0.3 dex [15] 自转速度300 km/s [11] - 年 龄8.2 Myr [11] - ------------------------ - == 太阳参数 == - 自转周期: 24.47 地球日,自转角速度约为 0.6130 度/小时 = 360/(24.47*24) - 天体质量: 1.9891×10³⁰ kg - 平均密度: 1.408×10³ kg/m³ - """ - - def __init__(self, name="大犬座VY", mass=30 * MO, - init_position=[0, 0, 0], - init_velocity=[0, 0, 0], - color=(0xFF, 0x5B, 0x5B), - texture="fixed_star.png", size_scale=1.0, distance_scale=1.0, - rotation_speed=0.1, ignore_mass=False): - params = { - "name": name, - "mass": mass, - "init_position": init_position, - "init_velocity": init_velocity, - "density": 1.408e3, - "color": color, - "texture": texture, - "size_scale": size_scale, - "distance_scale": distance_scale, - "rotation_speed": rotation_speed, - "ignore_mass": ignore_mass - } - super().__init__(**params) - - -if __name__ == '__main__': - from bodies import Sun - fixed_star = CanisMajorisVY() - sun = Sun() - print(fixed_star) - print("质量倍数", fixed_star.mass / sun.mass) - print("半径倍数", fixed_star.raduis / sun.raduis) \ No newline at end of file diff --git a/bodies/fixed_stars/stephenson_2_18.py b/bodies/fixed_stars/stephenson_2_18.py index d48ee4467243ae297f8d1292469fcfdf9d310a35..1f85c0682004958a4d649c20886863416dea32e9 100644 --- a/bodies/fixed_stars/stephenson_2_18.py +++ b/bodies/fixed_stars/stephenson_2_18.py @@ -45,7 +45,7 @@ class Stephenson_2_18(FixedStar): 平均密度: 1.408×10³ kg/m³ """ - def __init__(self, name="史蒂文森2-18", mass=14.28e5 * MO, + def __init__(self, name="史蒂文森2-18", mass=40.0 * MO, init_position=[0, 0, 0], init_velocity=[0, 0, 0], color=(198, 29, 3), @@ -56,7 +56,7 @@ class Stephenson_2_18(FixedStar): "mass": mass, "init_position": init_position, "init_velocity": init_velocity, - "density": 0.0002e3, + "density": 5.60e-06, "color": color, "texture": texture, "size_scale": size_scale, @@ -72,9 +72,11 @@ class Stephenson_2_18(FixedStar): if __name__ == '__main__': from bodies import Sun - + import math fixed_star = Stephenson_2_18() sun = Sun() print(fixed_star) print("质量倍数", fixed_star.mass / sun.mass) print("半径倍数", fixed_star.raduis / sun.raduis) + r = 2158 + print("密度換算", fixed_star.mass / 1e9 / (4 / 3 * math.pi * pow(r * sun.raduis, 3))) diff --git a/bodies/fixed_stars/uy_scuti.py b/bodies/fixed_stars/uy_scuti.py new file mode 100644 index 0000000000000000000000000000000000000000..bf6ff0702a661310fd4212d5a5efa009a94ff93c --- /dev/null +++ b/bodies/fixed_stars/uy_scuti.py @@ -0,0 +1,68 @@ +# -*- coding:utf-8 -*- +# title :参宿七 +# description :参宿七 +# author :Python超人 +# date :2023-02-11 +# link :https://gitcode.net/pythoncr/ +# python_version :3.8 +# ============================================================================== +from bodies import FixedStar +from common.consts import MO + + +class UYScuti(FixedStar): + """ + 盾牌座 UY (UY Scuti) + 质量:10个太阳质量 + 密度:不详 + 颜色值:#EFF6FF + 直径:为1708±192倍太阳直径 + +中文名盾牌座 UY外文名UY Scuti +别 名UY Sct、BD−12°5055、IRC−10422、RAFGL 2162、HV 3805 +分 类红超巨星发现时间1860年 +质 量7 至 10 M⊙(有争议) +直 径2.376✕109 km(±0.268)表面温度3365 K(±134)视星等+8.29 ~ +10.56绝对星等-6.2 等 [1] 赤 经18时27分36.53秒赤 纬-12°27′58.86″距地距离9500 光年(±1030, 有争议) [1] 光谱类别M2-M4Ia-IabU-B 色指数+3.29 [2] B-V 色指数+3.00 [3] 变星类型SRc(半规则) [4] 光 度约340000 L⊙(有争议)半 径1708±192 R☉(有争议)表面重力加速度0.008 m/s²表面重力-0.5 cgs [2] 赤道自转线速度约1.95 km/s径向速度18.33±0.82 km/s [5] 视 差0.6433±0.1059 mas(有争议) [5] 自 行赤经: 1.3 mas/yr; 赤纬: −1.6 mas/yr + + ------------------------ + == 太阳参数 == + 自转周期: 24.47 地球日,自转角速度约为 0.6130 度/小时 = 360/(24.47*24) + 天体质量: 1.9891×10³⁰ kg + 平均密度: 1.408×10³ kg/m³ + """ + + def __init__(self, name="盾牌座UY", mass=10 * MO, + init_position=[0, 0, 0], + init_velocity=[0, 0, 0], + color=(255,116,0), + texture="fixed_star.png", size_scale=1.0, distance_scale=1.0, + rotation_speed=0.1, ignore_mass=False): + params = { + "name": name, + "mass": mass, + "init_position": init_position, + "init_velocity": init_velocity, + "density": 2.832e-06, + "color": color, + "texture": texture, + "size_scale": size_scale, + "distance_scale": distance_scale, + "rotation_speed": rotation_speed, + "ignore_mass": ignore_mass + } + super().__init__(**params) + + +if __name__ == '__main__': + from bodies import Sun + import math + + fixed_star = UYScuti() + sun = Sun() + print(fixed_star) + print("质量倍数", fixed_star.mass / sun.mass) + print("半径倍数", fixed_star.raduis / sun.raduis) + r = 1708 + print("密度換算", fixed_star.mass / 1e9 / (4 / 3 * math.pi * pow(r * sun.raduis, 3))) + + # print( "%s" % (2.376e9 / (sun.raduis*2))) \ No newline at end of file diff --git a/bodies/fixed_stars/vy_canis_majoris.py b/bodies/fixed_stars/vy_canis_majoris.py new file mode 100644 index 0000000000000000000000000000000000000000..486287e1e3febf912228a04fbbadc7a3afe8653a --- /dev/null +++ b/bodies/fixed_stars/vy_canis_majoris.py @@ -0,0 +1,79 @@ +# -*- coding:utf-8 -*- +# title :大犬座VY +# description :大犬座VY +# author :Python超人 +# date :2023-02-11 +# link :https://gitcode.net/pythoncr/ +# python_version :3.8 +# ============================================================================== +from bodies import FixedStar +from common.consts import MO + + +class VYCanisMajoris(FixedStar): + """ + TODO: 大犬座VY(VY Canis Majoris) + 质量:17±8 太阳质量 + 大小:1420-2100 太阳半径 + 颜色:234,90,65 + 密度:0.0004 g/cm³ + + 中文名大犬座VY外文名VY Canis Majoris + 别 名VY CMa + 分 类红特超巨星 + 发现者杰罗姆·拉朗德发现时间1801年3月7日 + 平均密度5.33✕10-3 至 8.38✕10-3 g/m³表 + 面温度3490 K(±90) + 视星等6.5 至 9.6 等 + 赤 经07时22分58.33秒 + 赤 纬-25°46′03.24″ + 距地距离3820 光年(+260 −230) + 光谱型M3-M4.5(M2.5-M5e Ia) [1-3] + 视星等(U)12.01 [4] 视星等(B)10.19 [4] 视星等(V)7.95 [4] + 视星等(J)1.98 [4] 视星等(H)0.44 [4] 视星等(K)8.1 [5] + U-B色指数+2.32 [6] B-V色指数+2.057 [7] V-R色指数+2.20 [6] + 变星类型SRc或Lc [8-9] 径向速度41 km/s [10] 自 行赤 + 经:9.84 mas/yr 赤纬:0.75 mas/yr [7] + 视 差0.83±0.08 mas [11] 距 离1,170(+80或-70)pc,3,820(+260或-230)ly [1] 绝对热星等-9.4 + 恒星质量17±8 M☉ [1] + 半 径2,069 R☉ [1] [12-13] + 热光度270,000±40,000,178,000(+40,900或-29,900)L☉ [12-14] 表面重力-0.6±0.4 cgs [1] 有效温度3,940±90 K [1] 金属丰度[Fe/H]-0.3 dex [15] 自转速度300 km/s [11] 年 龄8.2 Myr [11] + ------------------------ + == 太阳参数 == + 自转周期: 24.47 地球日,自转角速度约为 0.6130 度/小时 = 360/(24.47*24) + 天体质量: 1.9891×10³⁰ kg + 平均密度: 1.408×10³ kg/m³ + """ + + def __init__(self, name="大犬座VY", mass=25 * MO, + init_position=[0, 0, 0], + init_velocity=[0, 0, 0], + color=(234,90,65), + texture="fixed_star.png", size_scale=1.0, distance_scale=1.0, + rotation_speed=0.1, ignore_mass=False): + params = { + "name": name, + "mass": mass, + "init_position": init_position, + "init_velocity": init_velocity, + "density": 1.23e-05, + "color": color, + "texture": texture, + "size_scale": size_scale, + "distance_scale": distance_scale, + "rotation_speed": rotation_speed, + "ignore_mass": ignore_mass + } + super().__init__(**params) + + +if __name__ == '__main__': + from bodies import Sun + import math + fixed_star = VYCanisMajoris() + sun = Sun() + print(fixed_star) + print("质量倍数", fixed_star.mass / sun.mass) + print("半径倍数", fixed_star.raduis / sun.raduis) + r = 1420 + print("密度換算", fixed_star.mass / 1e9 / (4 / 3 * math.pi * pow(r * sun.raduis, 3))) \ No newline at end of file diff --git a/scenes/fixed_stars.py b/scenes/fixed_stars.py index f1ec440abe63489341d64f03ce26567c460cc131..d540fff56fbee2468c9f661ee38a1a1400dfa241 100644 --- a/scenes/fixed_stars.py +++ b/scenes/fixed_stars.py @@ -6,7 +6,8 @@ # link :https://gitcode.net/pythoncr/ # python_version :3.8 # ============================================================================== -from bodies import Sun, Earth, Sirius, Rigel, Alcyone, Antares, Arcturus, Betelgeuse, Stephenson_2_18 +from bodies import Sun, Earth, Sirius, Rigel, Bellatrix, Alcyone, Antares, Arcturus, Aldebaran, Betelgeuse +from bodies import VYCanisMajoris, UYScuti, Stephenson_2_18 from common.consts import SECONDS_PER_WEEK, SECONDS_PER_MONTH, SECONDS_PER_YEAR, SECONDS_PER_DAY from scenes.func import mayavi_run, mpl_run, ursina_run from bodies.body import Body, AU @@ -20,14 +21,18 @@ if __name__ == '__main__': SIZE_SCALE = 0.02 bodies = [ Earth(size_scale=1, init_velocity=[0, 29.79, 0], distance_scale=0.0006), - Sun(size_scale=SIZE_SCALE), - Sirius(size_scale=SIZE_SCALE, ignore_mass=True), - Alcyone(size_scale=SIZE_SCALE, ignore_mass=True), - Arcturus(size_scale=SIZE_SCALE, ignore_mass=True), - Rigel(size_scale=SIZE_SCALE, ignore_mass=True), - Antares(size_scale=SIZE_SCALE, ignore_mass=True), - # Betelgeuse(size_scale=SIZE_SCALE, ignore_mass=True), - Stephenson_2_18(size_scale=SIZE_SCALE, ignore_mass=True) + Sun(size_scale=SIZE_SCALE), # 太阳 + Sirius(size_scale=SIZE_SCALE, ignore_mass=True), # 天狼星A 质量倍数 2.06 半径倍数 1.71 + Bellatrix(size_scale=SIZE_SCALE, ignore_mass=True), # 参宿五 质量倍数 8.6 半径倍数 5.75 + Alcyone(size_scale=SIZE_SCALE, ignore_mass=True), # 昴宿六 质量倍数 7 半径倍数 10 + Arcturus(size_scale=SIZE_SCALE, ignore_mass=True), # 大角星 质量倍数 1.08 半径倍数 25.42 + Aldebaran(size_scale=SIZE_SCALE, ignore_mass=True), # 毕宿五 质量倍数 1.16 半径倍数 44.13 + Rigel(size_scale=SIZE_SCALE, ignore_mass=True), # 参宿七 质量倍数 21 半径倍数 78.9 + Antares(size_scale=SIZE_SCALE, ignore_mass=True), # 心宿二 质量倍数 12 半径倍数 770 + Betelgeuse(size_scale=SIZE_SCALE, ignore_mass=True), # 参宿四 质量倍数 11.6 半径倍数 887 + VYCanisMajoris(size_scale=SIZE_SCALE, ignore_mass=True), # 大犬座VY 质量倍数 25 半径倍数 1419.75 + UYScuti(size_scale=SIZE_SCALE, ignore_mass=True), # 盾牌座 UY 质量倍数 10.0 半径倍数 1706.7 + Stephenson_2_18(size_scale=SIZE_SCALE, ignore_mass=True) # 史蒂文森2-18 质量倍数 40.0 半径倍数 2158.5 ] distance_sum = 0 for idx, body in enumerate(bodies):