update
This commit is contained in:
Binary file not shown.
@@ -100,66 +100,74 @@ def cal_dv_step_by_step_fusion(reactor_efficiency, engine_efficiency, thrust, dr
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
merlin_fuel_burned = cal_fuel_burned(314.3, 931, 1)
|
print(0.000005 * HYDROGEN_FUSION_EFFICIENCY * Vc * Vc / 3600/500)
|
||||||
merlin_kinetic_energy = cal_kinetic_energy(314.3, 931, 1, 1)
|
|
||||||
theoretical_kerosene_burn_heat = 0.27785743459149853 * merlin_fuel_burned * 43.11 * 1000000
|
|
||||||
|
|
||||||
raptor_fuel_burned = cal_fuel_burned(355, 2450, 1)
|
light_speed_engine_power_requirement = cal_kinetic_energy(3000000, 4800, 1, 1)
|
||||||
raptor_kinetic_energy = cal_kinetic_energy(355, 2450, 1, 1)
|
# arc_reactor_power_output = 0.5*0.01*Vc*Vc
|
||||||
theoretical_methane_burn_heat = 0.20836197008574792 * raptor_fuel_burned * 55 * 1000000
|
new_element_arc_output = 1*10**9
|
||||||
|
ratio = 1072*new_element_arc_output / light_speed_engine_power_requirement
|
||||||
|
print('111')
|
||||||
|
|
||||||
|
# merlin_fuel_burned = cal_fuel_burned(314.3, 931, 1)
|
||||||
# first_stage_fuel = cal_fuel_burned(328, 812.05*4, 148)
|
# merlin_kinetic_energy = cal_kinetic_energy(314.3, 931, 1, 1)
|
||||||
# x = cal_fuel_burned(333, 80, 610) + cal_fuel_burned(350, 823.2, 148)
|
# theoretical_kerosene_burn_heat = 0.27785743459149853 * merlin_fuel_burned * 43.11 * 1000000
|
||||||
# x = cal_dv(338.2, 55000, 70000)
|
#
|
||||||
# xx = cal_fuel_burned(21000, 400, 1)
|
# raptor_fuel_burned = cal_fuel_burned(355, 2450, 1)
|
||||||
|
# raptor_kinetic_energy = cal_kinetic_energy(355, 2450, 1, 1)
|
||||||
# payload_mass = 30
|
# theoretical_methane_burn_heat = 0.20836197008574792 * raptor_fuel_burned * 55 * 1000000
|
||||||
# structural_mass = 8
|
#
|
||||||
# return_fuel_mass = 8
|
#
|
||||||
# outbound_fuel_mass = 47
|
# # first_stage_fuel = cal_fuel_burned(328, 812.05*4, 148)
|
||||||
# return_dv = cal_dv(475, structural_mass, return_fuel_mass)
|
# # x = cal_fuel_burned(333, 80, 610) + cal_fuel_burned(350, 823.2, 148)
|
||||||
# out_bound_dv = cal_dv(475, payload_mass+structural_mass+return_fuel_mass, outbound_fuel_mass)
|
# # x = cal_dv(338.2, 55000, 70000)
|
||||||
# total_mass = payload_mass + structural_mass + return_fuel_mass + outbound_fuel_mass
|
# # xx = cal_fuel_burned(21000, 400, 1)
|
||||||
|
#
|
||||||
payload_mass = 45
|
# # payload_mass = 30
|
||||||
structural_mass = 10
|
# # structural_mass = 8
|
||||||
return_fuel_mass = 10
|
# # return_fuel_mass = 8
|
||||||
outbound_fuel_mass = 65
|
# # outbound_fuel_mass = 47
|
||||||
return_dv = cal_dv(475, structural_mass, return_fuel_mass)
|
# # return_dv = cal_dv(475, structural_mass, return_fuel_mass)
|
||||||
out_bound_dv = cal_dv(475, payload_mass + structural_mass + return_fuel_mass, outbound_fuel_mass)
|
# # out_bound_dv = cal_dv(475, payload_mass+structural_mass+return_fuel_mass, outbound_fuel_mass)
|
||||||
total_mass = payload_mass + structural_mass + return_fuel_mass + outbound_fuel_mass
|
# # total_mass = payload_mass + structural_mass + return_fuel_mass + outbound_fuel_mass
|
||||||
|
#
|
||||||
# payload_mass = 30
|
# payload_mass = 45
|
||||||
# structural_mass = 10
|
# structural_mass = 10
|
||||||
# return_fuel_mass = 14
|
# return_fuel_mass = 10
|
||||||
# outbound_fuel_mass = 71
|
# outbound_fuel_mass = 65
|
||||||
# return_dv = cal_dv(382, structural_mass, return_fuel_mass)
|
# return_dv = cal_dv(475, structural_mass, return_fuel_mass)
|
||||||
# out_bound_dv = cal_dv(382, payload_mass + structural_mass + return_fuel_mass, outbound_fuel_mass)
|
# out_bound_dv = cal_dv(475, payload_mass + structural_mass + return_fuel_mass, outbound_fuel_mass)
|
||||||
# total_mass = payload_mass + structural_mass + return_fuel_mass + outbound_fuel_mass
|
# total_mass = payload_mass + structural_mass + return_fuel_mass + outbound_fuel_mass
|
||||||
|
#
|
||||||
tank_mass = 0.000001 * 179380.1868 + 0.00003 * 41395.42773
|
# # payload_mass = 30
|
||||||
|
# # structural_mass = 10
|
||||||
x = cal_kinetic_energy(350, 2450, 1, 1)
|
# # return_fuel_mass = 14
|
||||||
# x = cal_kinetic_energy(314.3, 931, 1, 1)
|
# # outbound_fuel_mass = 71
|
||||||
y = cal_kinetic_energy(21000, 800, 1, 1)
|
# # return_dv = cal_dv(382, structural_mass, return_fuel_mass)
|
||||||
print(y / x)
|
# # out_bound_dv = cal_dv(382, payload_mass + structural_mass + return_fuel_mass, outbound_fuel_mass)
|
||||||
y = cal_fusion_input_mass(HYDROGEN_FUSION_EFFICIENCY * 0.1, x)
|
# # total_mass = payload_mass + structural_mass + return_fuel_mass + outbound_fuel_mass
|
||||||
|
#
|
||||||
test = cal_burn_time(310, 1.95, 3)
|
# tank_mass = 0.000001 * 179380.1868 + 0.00003 * 41395.42773
|
||||||
ship_dry_mass = 2000*1000 # 2000t
|
#
|
||||||
ship_fuel_mass = 500*1000 # 500t
|
# x = cal_kinetic_energy(350, 2450, 1, 1)
|
||||||
main_engine_thrust = 10000 # 10000KN
|
# # x = cal_kinetic_energy(314.3, 931, 1, 1)
|
||||||
ship_isp, flow_rate = cal_best_isp_relativity_speed(reactor_efficiency=0.45, engine_efficiency=0.8,
|
# y = cal_kinetic_energy(21000, 800, 1, 1)
|
||||||
thrust=main_engine_thrust)
|
# print(y / x)
|
||||||
exhaust_velocity = ship_isp * Ga / Vc
|
# y = cal_fusion_input_mass(HYDROGEN_FUSION_EFFICIENCY * 0.1, x)
|
||||||
dv = cal_dv(ship_isp, ship_dry_mass + ship_fuel_mass / 2, ship_fuel_mass / 2)
|
#
|
||||||
dv2 = cal_dv_step_by_step_fusion(reactor_efficiency=0.45, engine_efficiency=0.8, thrust=main_engine_thrust,
|
# test = cal_burn_time(310, 1.95, 3)
|
||||||
dry_mass=ship_dry_mass, fuel_mass=ship_fuel_mass, interval=1)
|
# ship_dry_mass = 2000*1000 # 2000t
|
||||||
burn_time = ship_fuel_mass / flow_rate / 86400
|
# ship_fuel_mass = 500*1000 # 500t
|
||||||
x = 27632994.05705879
|
# main_engine_thrust = 10000 # 10000KN
|
||||||
|
# ship_isp, flow_rate = cal_best_isp_relativity_speed(reactor_efficiency=0.45, engine_efficiency=0.8,
|
||||||
xxx = cal_fuel_burned(335.1, 1339.48, 174)
|
# thrust=main_engine_thrust)
|
||||||
|
# exhaust_velocity = ship_isp * Ga / Vc
|
||||||
|
# dv = cal_dv(ship_isp, ship_dry_mass + ship_fuel_mass / 2, ship_fuel_mass / 2)
|
||||||
|
# dv2 = cal_dv_step_by_step_fusion(reactor_efficiency=0.45, engine_efficiency=0.8, thrust=main_engine_thrust,
|
||||||
|
# dry_mass=ship_dry_mass, fuel_mass=ship_fuel_mass, interval=1)
|
||||||
|
# burn_time = ship_fuel_mass / flow_rate / 86400
|
||||||
|
# x = 27632994.05705879
|
||||||
|
#
|
||||||
|
# xxx = cal_fuel_burned(335.1, 1339.48, 174)
|
||||||
print('done')
|
print('done')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import time
|
|||||||
from matplotlib import pyplot as plt
|
from matplotlib import pyplot as plt
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
|
|
||||||
|
from calculator_dv import cal_dv
|
||||||
|
|
||||||
Vc = 299792458
|
Vc = 299792458
|
||||||
Ga = 9.80665
|
Ga = 9.80665
|
||||||
|
|
||||||
@@ -257,6 +259,7 @@ if __name__ == '__main__':
|
|||||||
176: 0.9, 177: 1, 180: 1, 190: 1},
|
176: 0.9, 177: 1, 180: 1, 190: 1},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# # CBC: 173s S1: 227s S2: 212s S3: 800s
|
# # CBC: 173s S1: 227s S2: 212s S3: 800s
|
||||||
# cbc_fuel_mass = 510000
|
# cbc_fuel_mass = 510000
|
||||||
# cbc_dry_mass = 50000
|
# cbc_dry_mass = 50000
|
||||||
@@ -300,9 +303,16 @@ if __name__ == '__main__':
|
|||||||
# Lanyue = Vessel([[S1], [S2]], name='Lanyue', payload=200, duration=0.05)
|
# Lanyue = Vessel([[S1], [S2]], name='Lanyue', payload=200, duration=0.05)
|
||||||
# Lanyue.run_sim_new()
|
# Lanyue.run_sim_new()
|
||||||
|
|
||||||
booster = Stage(163560, 16000, 4740, 285, 'solid', 'SRB')
|
# booster = Stage(163560, 16000, 4740, 285, 'solid', 'SRB')
|
||||||
S1 = Stage(350000, 25000, 3500, 456.5, 'hydrolox', 'Hydrolox Core Stage')
|
# S1 = Stage(350000, 25000, 3500, 456.5, 'hydrolox', 'Hydrolox Core Stage')
|
||||||
S2 = Stage(54000, 5000, 392, 450, 'hydrolox', 'Upper Stage')
|
# S2 = Stage(54000, 5000, 392, 450, 'hydrolox', 'Upper Stage')
|
||||||
SMART_LV = Vessel([[booster, S1], [S2]], name='SMART_LV', payload=20000, duration=0.05)
|
# SMART_LV = Vessel([[booster, S1], [S2]], name='SMART_LV', payload=20000, duration=0.05)
|
||||||
|
# SMART_LV.run_sim_new()
|
||||||
|
|
||||||
|
S1 = Stage(1200000, 300000, 1860*12, 452, 'hydrolox', 'Hydrolox Core Stage')
|
||||||
|
# S2 = Stage(200000, 20000, 1307, 448, 'hydrolox', 'J-2X Upper Stage')
|
||||||
|
S2 = Stage(250000, 20000, 2093, 460, 'hydrolox', 'RS-25-150 Upper Stage')
|
||||||
|
SMART_LV = Vessel([[S1], [S2]], name='SMART_LV', payload=30000, duration=0.05)
|
||||||
SMART_LV.run_sim_new()
|
SMART_LV.run_sim_new()
|
||||||
|
print('Stage 0 return dv:', cal_dv(452, 100000, 200000))
|
||||||
print('done')
|
print('done')
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
import json
|
||||||
|
import os
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
from langchain_openai import ChatOpenAI
|
||||||
|
from pydantic import SecretStr
|
||||||
|
|
||||||
|
|
||||||
|
PROJECT_PATH = Path(__file__).parent.parent.parent.absolute()
|
||||||
|
|
||||||
|
if os.path.exists(os.path.join(PROJECT_PATH, "config", "config_local.json")):
|
||||||
|
CONFIG_PATH = os.path.join(PROJECT_PATH, "config", "config_local.json")
|
||||||
|
elif os.path.exists(os.path.join(PROJECT_PATH, "config", "config.json")):
|
||||||
|
CONFIG_PATH = os.path.join(PROJECT_PATH, "config", "config.json")
|
||||||
|
else:
|
||||||
|
raise FileNotFoundError('Unable to locate config file, check src/config/config.json')
|
||||||
|
|
||||||
|
|
||||||
|
with open(CONFIG_PATH, 'r', encoding='utf-8') as config_file:
|
||||||
|
project_config = json.load(config_file)
|
||||||
|
|
||||||
|
|
||||||
|
LLM = ChatOpenAI(model=project_config['llm_model_name'], api_key= SecretStr(project_config['llm_secret_key']),
|
||||||
|
base_url=project_config['llm_base_url'], temperature=0.01)
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
PROJECT_PATH = Path(__file__).resolve().parent.parent.parent.absolute()
|
||||||
|
DATA_PATH = os.path.join(PROJECT_PATH, 'data')
|
||||||
|
|
||||||
|
def split_string(text, max_length):
|
||||||
|
"""Splits a string into chunks, each with a maximum length.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
text (str): The string to split.
|
||||||
|
max_length (int): The maximum length of each chunk.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
list: A list of strings, each with a length no more than max_length.
|
||||||
|
"""
|
||||||
|
result = []
|
||||||
|
start = 0
|
||||||
|
while start < len(text):
|
||||||
|
end = min(start + max_length, len(text))
|
||||||
|
result.append(text[start:end])
|
||||||
|
start = end
|
||||||
|
return result
|
||||||
|
|
||||||
|
novel_path = os.path.join(DATA_PATH, '如果,宅.txt')
|
||||||
|
|
||||||
|
with open(novel_path, 'r', encoding='ANSI') as f:
|
||||||
|
novel = f.readlines()
|
||||||
|
|
||||||
|
new_novel = ''
|
||||||
|
for novel_line in novel:
|
||||||
|
line_list = split_string(novel_line, 30)
|
||||||
|
new_novel += '\n'.join(line_list)
|
||||||
|
new_novel += '\n'
|
||||||
|
|
||||||
|
with open(os.path.join(DATA_PATH, 'target.txt'), 'w', encoding='utf-8') as f:
|
||||||
|
f.write(new_novel)
|
||||||
|
|
||||||
|
|
||||||
|
print('done')
|
||||||
Reference in New Issue
Block a user