function v=research_vessel(V,Pmax,rhoH,S) % Spherical research vessel, no commercial miniaturization claim. % L05 allowable Al stress/weld/min thickness; spherical topology is R3 scenario. if nargin<4,S=121e6;end weld=.9;rhoAl=2700;tmin=.00127;gap=.02;touter=.0012; r=(3*V/(4*pi))^(1/3);t=max(tmin,r*(exp(.5*Pmax/(S*weld))-1)); rmetal=r+t;rVac=rmetal+gap;rOuter=rVac+touter; inner=4*pi/3*(rmetal^3-r^3)*rhoAl; outer=4*pi/3*(rOuter^3-rVac^3)*rhoAl; area=4*pi*rmetal^2; insulationBudget=.172*(V/.020)^(2/3); % L05 external insulation; area scaling is R3 assumption MLI_areal_kg_m2=.30;MLI=MLI_areal_kg_m2*area; % independent internal blanket budget, not L05 172g support=.10;mount=.10;HX=.30;heater=.05;valves=.20;warmReg=.08;sensors=.05; interfaces=valves+warmReg+HX+sensors+mount+support+heater; massMap=struct('component_id',{'C01','C02','C03','C04','C05','C06','C07','C08'}, ... 'scope',{'pressure inner shell','vacuum outer shell','external insulation plus independent internal MLI', ... 'incremental internal low-conduction supports plus external mounts','warming/vaporization HX', ... 'resistive heater hardware; power limit separately 25W','cryo fill/valves/PRD plus new warm low-pressure regulation','pressure/temperature/vacuum sensing and control'}, ... 'mass_kg',{inner,outer,insulationBudget+MLI,support+mount,HX,heater,valves+warmReg,sensors}, ... 'identity',{'L05 hemisphere formula extended to sphere','R3 uniform outer shell budget','L05 external-insulation datum plus R3 area scaling and MLI areal budget', ... 'R3 new budgets; common B09 cradle remains in baseline once','R3 hardware budget','R3 hardware budget, not massless electrical power', ... 'R3 new cryogenic and warm-regulation budgets; retained B19 mass does not qualify old HFLW for low-pressure use','R3 hardware budget; 5W additional control load separate'}); dry=inner+outer+insulationBudget+MLI+interfaces; assert(abs(sum([massMap.mass_kg])-dry)<1e-12,'C01-C08 dry-mass accounting must close.'); v=struct('V_inner_m3',V,'V_outer_m3',4*pi*rOuter^3/3+.002,'outer_shell_envelope_m3',4*pi*rOuter^3/3, ... 'external_interface_volume_budget_m3',.002,'inner_radius_m',r,'inner_wall_m',t, ... 'Al_inner_kg',inner,'vacuum_outer_kg',outer,'external_insulation_budget_kg',insulationBudget, ... 'internal_MLI_area_m2',area,'internal_MLI_areal_budget_kg_m2',MLI_areal_kg_m2,'internal_MLI_areal_range_kg_m2',[.15 .60], ... 'internal_MLI_kg',MLI,'low_conduction_support_budget_kg',support,'low_conduction_support_range_kg',[.05 .20], ... 'additional_external_mount_budget_kg',mount,'additional_external_mount_range_kg',[.05 .20], ... 'warming_HX_budget_kg',HX,'warming_HX_range_kg',[.15 .60],'heater_hardware_budget_kg',heater,'heater_hardware_range_kg',[.025 .10], ... 'cryo_valve_fill_PRD_budget_kg',valves,'cryo_valve_fill_PRD_range_kg',[.10 .40], ... 'warm_pressure_regulation_budget_kg',warmReg,'warm_pressure_regulation_range_kg',[.04 .16], ... 'state_sensing_control_budget_kg',sensors,'state_sensing_control_range_kg',[.025 .10], ... 'new_cryo_interfaces_kg',interfaces,'C01_C08_mass_map',massMap,'dry_mass_accounting_residual_kg',sum([massMap.mass_kg])-dry, ... 'dry_storage_kg',dry,'H2_initial_kg',rhoH*V,'Qleak_W',9.15*area, ... 'allowable_stress_Pa',S,'weld_efficiency',weld,'Al_density_kg_m3',rhoAl,'minimum_wall_m',tmin, ... 'vacuum_gap_m',gap,'outer_wall_m',touter,'pressure_limit_Pa',Pmax, ... 'identity','explicit research geometry/budgets, L05 material formula; no commercial or safety qualification', ... 'budget_revision','CRYO-BUDGET-1.2.0: separate internalMLI, supports, heater and new warm regulation; no commercial qualification', ... 'feed_interface_identity','Thermodynamic 200kPa feed threshold plus new warm low-pressure regulation scenario; common B19 HFLW mass conservatively retained, not assumed functional on low-pressure cryogenic path; OEM 0.9+/-0.1barg and pressure-drop/flow need qualification', ... 'insulation_identity','172g is L05 external insulation only; area scaling and independent 0.30kg/m2 internalMLI are R3 assumptions', ... 'budget_range_identity','declared engineering exploration ranges, not confidence intervals or manufacturer data; current cases use nominal values', ... 'thermal_budget_identity','9.15W/m2 total heat-flux transfer retained; support/MLI detailed conduction and vessel heat capacity unresolved', ... 'unverified','vacuum buckling, fatigue, joints, impact, MLI/support heat bridges, HX thermal/flow interface, normal-to-para conversion'); end