Skip to content

1. Stage Calculation Functions

Henry Nachman edited this page Jul 28, 2025 · 1 revision

calculate_power_function

calculate_power_function(details, stage_temps, A_L = False) Description: Calculate the power function for a given component.

Arguments:

  • details (dict): The details of the component.
  • stage_temps (dict): The temperature details of the stage.
  • A_L (bool, optional): Whether to use the A/L value. Defaults to False.

Returns:

  • ppu (float): The calculated power per unit.

get_all_powers

get_all_powers(components, stage_details) Description: Calculate the total power for all components in each stage.

Arguments:

  • components (dict): The component details.
  • stage_details (dict): The stage temperature details.

Returns:

  • components (dict): The updated component details with power calculations.

calculate_coax_power

calculate_coax_power(details, stage_temp) Description: Calculate the power for coaxial components.

Arguments:

  • details (dict): The details of the coaxial component.
  • stage_temp (dict): The temperature details of the stage.

Returns:

  • power_per_part (float): The calculated power per part for the coaxial component.

get_sum_variance

get_sum_variance(output_data) Description: Calculate the sum variance for the output data.

Arguments:

  • output_data (dict): The output data containing stage details and total power.

Returns:

  • SumVariance: The calculated sum variance for each stage.
  • cooling_details_dict: A dictionary containing cooling details.

cooling_power

cooling_power(TempOut, TempIn, Power4k, Efficiency) Description: Calculate the cooling power based on the temperatures and efficiency. Arguments:

  • TempOut (float): The output temperature.
  • TempIn (float): The input temperature.
  • Power4k (float): The power at 4K.
  • Efficiency (float): The efficiency of the cooling system. Returns:
  • CoolingPower (float): The calculated cooling power.

optimize_tm

optimize_tm(components_input, stage_details_input, num_points=10) Description: Optimizes a VCS cooled thermal model. Takes in components dictionary and stage details dictionary Arguments:

  • components_input (dict): The input component details.
  • stage_details_input (dict): The input stage details.
  • num_points (int): The number of points to sample for VCS temperatures. Returns:
  • details (dict): The updated component details with power calculations.
  • output_data (dict): The output data containing stage details and total power.
  • grids (list): A list containing the VCS2 grid, VCS1 grid, and SumVarArr.

save_to_json_manual

save_to_json_manual(components, stage_details) Description: Save the components and stage details to a JSON file. Arguments:

  • components (dict): The component details.
  • stage_details (dict): The stage temperature details. ###Returns:
  • output_data (dict): A dictionary containing the components, stage details, and total power.

find_interpolation

find_interpolation(material) Description: Check if an interpolation file exists for the given material.

Arguments:

  • material (str): The name of the material to check.

Returns:

  • bool: True if the interpolation file exists, False otherwise.