power_balance.profiles#
Source: power_balance/profiles/__init__.py
gen_cscoil_current_profile#
gen_cscoil_current_profile(stop_time: int = None, time_step: float = None, time_range: Tuple[float, ...] = None, max_current: float = None, label: str = '', output_directory: str = '/home/runner/work/powerbalance/powerbalance/power_balance/profiles/mat_profile_files') -> numpy.ndarray
Assigns a Central Solenoid coil current value for each step in the given time array the result is saved by default for usage in the modelica models.
Parameters#
-
stop_time
:int
, defaultNone
the time in seconds at which the profile stops, typically the end of the simulation
-
time_step
:float
, defaultNone
the difference in seconds between each individual step, typically matching the time step of the simulation
-
time_range
:typing.Tuple
, defaultNone
the tuple containing information about the plasma scenario. typically (ramp-up start, flat-top start, flat-top end, ramp-down end)
-
max_current
:float
, defaultNone
maximum current in Amperes, default is 50 kA
-
label
:str
, default ````extra identifier for this profile
-
output_directory
:str
, default/home/runner/work/powerbalance/powerbalance/power_balance/profiles/mat_profile_files
name of directory to save the dataset to. If set to None, data is not saved, by default uses the module internal profile directory
Returns#
-
numpy.ndarray
transposed numpy array of time and cscoil current values
gen_nbiheat_profile#
gen_nbiheat_profile(stop_time: int = None, time_step: float = None, time_range: Tuple[float, ...] = None, max_power: float = None, label: str = '', output_directory: str = '/home/runner/work/powerbalance/powerbalance/power_balance/profiles/mat_profile_files') -> numpy.ndarray
Creates an array of neutral beam injection heat values for the given time array
Parameters#
-
stop_time
:int
, defaultNone
the time in seconds at which the profile stops, typically the end of the simulation
-
time_step
:float
, defaultNone
the difference in seconds between each individual step, typically matching the time step of the simulation
-
time_range
:typing.Tuple
, defaultNone
the tuple containing information about the plasma scenario. typically (ramp-up start, flat-top start, flat-top end, ramp-down end)
-
max_power
:float
, defaultNone
maximum power in Watts, default is 60 MW
-
label
:str
, default ````extra identifier for this profile
-
output_directory
:str
, default/home/runner/work/powerbalance/powerbalance/power_balance/profiles/mat_profile_files
name of directory to save the dataset to. If set to None, data is not saved, by default uses the module internal profile directory.
Returns#
-
numpy.ndarray
transposed numpy array of time and plasma heat values
gen_pf1coil_current_profile#
gen_pf1coil_current_profile(stop_time: int = None, time_step: float = None, time_range: Tuple[float, ...] = None, max_current: float = None, label: str = '', output_directory: str = '/home/runner/work/powerbalance/powerbalance/power_balance/profiles/mat_profile_files') -> numpy.ndarray
Assigns current value for the first Poloidal Field for each step in the given time array the result is saved by default for usage in the modelica models.
Parameters#
-
stop_time
:int
, defaultNone
the time in seconds at which the profile stops, typically the end of the simulation
-
time_step
:float
, defaultNone
the difference in seconds between each individual step, typically matching the time step of the simulation
-
time_range
:typing.Tuple
, defaultNone
the tuple containing information about the plasma scenario. typically (ramp-up start, flat-top start, flat-top end, ramp-down end)
-
max_current
:float
, defaultNone
maximum current in Amperes, default is 10 kA
-
label
:str
, default ````extra identifier for this profile
-
output_directory
:str
, default/home/runner/work/powerbalance/powerbalance/power_balance/profiles/mat_profile_files
name of directory to save the dataset to. If set to None, data is not saved, by default uses the module internal profile directory
Returns#
-
numpy.ndarray
transposed numpy array of time and pf1coil current values
gen_pf2coil_current_profile#
gen_pf2coil_current_profile(stop_time: int = None, time_step: float = None, time_range: Tuple[float, ...] = None, max_current: float = None, label: str = '', output_directory: str = '/home/runner/work/powerbalance/powerbalance/power_balance/profiles/mat_profile_files') -> numpy.ndarray
Assigns current value for the second Poloidal Field (PF) for each step in the given time array the result is saved by default for usage in the modelica models.
Parameters#
-
stop_time
:int
, defaultNone
the time in seconds at which the profile stops, typically the end of the simulation
-
time_step
:float
, defaultNone
the difference in seconds between each individual step, typically matching the time step of the simulation
-
time_range
:typing.Tuple
, defaultNone
the tuple containing information about the plasma scenario. typically (ramp-up start, flat-top start, flat-top end, ramp-down end)
-
max_current
:float
, defaultNone
maximum current in Amperes, default is 5 kA
-
label
:str
, default ````extra identifier for this profile
-
output_directory
:str
, default/home/runner/work/powerbalance/powerbalance/power_balance/profiles/mat_profile_files
name of directory to save the dataset to. If set to None, data is not saved, by default uses the module internal profile directory
Returns#
-
numpy.ndarray
transposed numpy array of time and pf2coil current values
gen_pf3coil_current_profile#
gen_pf3coil_current_profile(stop_time: int = None, time_step: float = None, time_range: Tuple[float, ...] = None, max_current: float = None, label: str = '', output_directory: str = '/home/runner/work/powerbalance/powerbalance/power_balance/profiles/mat_profile_files') -> numpy.ndarray
Assigns current value for the third Poloidal Field (PF) for each step in the given time array the result is saved by default for usage in the modelica models.
Parameters#
-
stop_time
:int
, defaultNone
the time in seconds at which the profile stops, typically the end of the simulation
-
time_step
:float
, defaultNone
the difference in seconds between each individual step, typically matching the time step of the simulation
-
time_range
:typing.Tuple
, defaultNone
the tuple containing information about the plasma scenario. typically (ramp-up start, flat-top start, flat-top end, ramp-down end)
-
max_current
:float
, defaultNone
maximum current in Amperes, default is 2 kA
-
label
:str
, default ````extra identifier for this profile
-
output_directory
:str
, default/home/runner/work/powerbalance/powerbalance/power_balance/profiles/mat_profile_files
name of directory to save the dataset to. If set to None, data is not saved, by default uses the module internal profile directory
Returns#
-
numpy.ndarray
transposed numpy array of time and pf3coil current values
gen_pf4coil_current_profile#
gen_pf4coil_current_profile(stop_time: int = None, time_step: float = None, time_range: Tuple[float, ...] = None, max_current: float = None, label: str = '', output_directory: str = '/home/runner/work/powerbalance/powerbalance/power_balance/profiles/mat_profile_files') -> numpy.ndarray
Assigns current value for the fourth Poloidal Field (PF) for each step in the given time array the result is saved by default for usage in the modelica models.
Parameters#
-
stop_time
:int
, defaultNone
the time in seconds at which the profile stops, typically the end of the simulation
-
time_step
:float
, defaultNone
the difference in seconds between each individual step, typically matching the time step of the simulation
-
time_range
:typing.Tuple
, defaultNone
the tuple containing information about the plasma scenario. typically (ramp-up start, flat-top start, flat-top end, ramp-down end)
-
max_current
:float
, defaultNone
maximum current in Amperes, default is 5 kA
-
label
:str
, default ````extra identifier for this profile
-
output_directory
:str
, default/home/runner/work/powerbalance/powerbalance/power_balance/profiles/mat_profile_files
name of directory to save the dataset to. If set to None, data is not saved, by default uses the module internal profile directory
Returns#
-
numpy.ndarray
transposed numpy array of time and pf4coil current values
gen_pf5coil_current_profile#
gen_pf5coil_current_profile(stop_time: int = None, time_step: float = None, time_range: Tuple[float, ...] = None, max_current: float = None, label: str = '', output_directory: str = '/home/runner/work/powerbalance/powerbalance/power_balance/profiles/mat_profile_files') -> numpy.ndarray
Assigns current value for the fifth Poloidal Field (PF) for each step in the given time array the result is saved by default for usage in the modelica models.
Parameters#
-
stop_time
:int
, defaultNone
the time in seconds at which the profile stops, typically the end of the simulation
-
time_step
:float
, defaultNone
the difference in seconds between each individual step, typically matching the time step of the simulation
-
time_range
:typing.Tuple
, defaultNone
the tuple containing information about the plasma scenario. typically (ramp-up start, flat-top start, flat-top end, ramp-down end)
-
max_current
:float
, defaultNone
maximum current in Amperes, default is 3 kA
-
label
:str
, default ````extra identifier for this profile
-
output_directory
:str
, default/home/runner/work/powerbalance/powerbalance/power_balance/profiles/mat_profile_files
name of directory to save the dataset to. If set to None, data is not saved, by default uses the module internal profile directory
Returns#
-
numpy.ndarray
transposed numpy array of time and pf5coil current values
gen_pf6coil_current_profile#
gen_pf6coil_current_profile(stop_time: int = None, time_step: float = None, time_range: Tuple[float, ...] = None, max_current: float = None, label: str = '', output_directory: str = '/home/runner/work/powerbalance/powerbalance/power_balance/profiles/mat_profile_files') -> numpy.ndarray
Assigns current value for the sixth Poloidal Field (PF) for each step in the given time array the result is saved by default for usage in the modelica models.
Parameters#
-
stop_time
:int
, defaultNone
the time in seconds at which the profile stops, typically the end of the simulation
-
time_step
:float
, defaultNone
the difference in seconds between each individual step, typically matching the time step of the simulation
-
time_range
:typing.Tuple
, defaultNone
the tuple containing information about the plasma scenario. typically (ramp-up start, flat-top start, flat-top end, ramp-down end)
-
max_current
:float
, defaultNone
maximum current in Amperes, default is 5 kA
-
label
:str
, default ````extra identifier for this profile
-
output_directory
:str
, default/home/runner/work/powerbalance/powerbalance/power_balance/profiles/mat_profile_files
name of directory to save the dataset to. If set to None, data is not saved, by default uses the module internal profile directory
Returns#
-
numpy.ndarray
transposed numpy array of time and pf6coil current values
gen_rfheat_profile#
gen_rfheat_profile(stop_time: int = None, time_step: float = None, time_range: Tuple[float, ...] = None, max_power: float = None, label: str = '', output_directory: str = '/home/runner/work/powerbalance/powerbalance/power_balance/profiles/mat_profile_files') -> numpy.ndarray
Creates an array of radio frequency heat values for the given time array
Parameters#
-
stop_time
:int
, defaultNone
the time in seconds at which the profile stops, typically the end of the simulation
-
time_step
:float
, defaultNone
the difference in seconds between each individual step, typically matching the time step of the simulation
-
time_range
:typing.Tuple
, defaultNone
the tuple containing information about the plasma scenario. typically (ramp-up start, flat-top start, flat-top end, ramp-down end)
-
max_power
:float
, defaultNone
maximum power in Watts, default is 60 MW
-
label
:str
, default ````extra identifier for this profile
-
output_directory
:str
, default/home/runner/work/powerbalance/powerbalance/power_balance/profiles/mat_profile_files
name of directory to save the dataset to. If set to None, data is not saved, by default uses the module internal profile directory.
Returns#
-
numpy.ndarray
transposed numpy array of time and plasma heat values
gen_tfcoil_current_profile#
gen_tfcoil_current_profile(stop_time: int = None, time_step: float = None, time_range: Tuple[float, ...] = None, max_current: float = None, label: str = '', output_directory: str = '/home/runner/work/powerbalance/powerbalance/power_balance/profiles/mat_profile_files') -> numpy.ndarray
Assigns a Toroidal Field coil current value to each time step within the given time array
Parameters#
-
stop_time
:int
, defaultNone
the time in seconds at which the profile stops, typically the end of the simulation
-
time_step
:float
, defaultNone
the difference in seconds between each individual step, typically matching the time step of the simulation
-
time_range
:typing.Tuple
, defaultNone
the tuple containing information about the plasma scenario. typically (ramp-up start, flat-top start, flat-top end, ramp-down end)
-
max_current
:float
, defaultNone
maximum current in Amperes, default is 60 kA
-
label
:str
, default ````extra indentifier for this profile
-
output_directory
:str
, default/home/runner/work/powerbalance/powerbalance/power_balance/profiles/mat_profile_files
name of directory to save the dataset to. If set to None, data is not saved, by default uses the module internal profile directory
Returns#
-
numpy.ndarray
transposed numpy array of time and tfcoil current values
gen_thermalpowerout_profile#
gen_thermalpowerout_profile(stop_time: int = None, time_step: float = None, time_range: Tuple[float, ...] = None, max_power: float = None, label: str = '', output_directory: str = '/home/runner/work/powerbalance/powerbalance/power_balance/profiles/mat_profile_files') -> numpy.ndarray
Creates an array of thermal power output values for the given time array
Parameters#
-
stop_time
:int
, defaultNone
the time in seconds at which the profile stops, typically the end of the simulation
-
time_step
:float
, defaultNone
the difference in seconds between each individual step, typically matching the time step of the simulation
-
time_range
:typing.Tuple
, defaultNone
the tuple containing information about the plasma scenario. typically (ramp-up start, flat-top start, flat-top end, ramp-down end)
-
max_power
:float
, defaultNone
maximum power in Watts, default is 1000 MW
-
label
:str
, default ````extra identifier for this profile
-
output_directory
:str
, default/home/runner/work/powerbalance/powerbalance/power_balance/profiles/mat_profile_files
name of directory to save the dataset to. If set to None, data is not saved, by default uses the module internal profile directory.
Returns#
-
numpy.ndarray
transposed numpy array of time and plasma heat values
generate_all#
generate_all(output_directory: str, time_range: Tuple[float, ...] = None, stop_time: int = None, time_step: int = None, max_values: Optional[Dict] = None) -> None
Generate all the current profiles in the given directory using _time_array_default and _time_range_default, and also using the max currents and powers specified in the input to the Power Balance
Parameters#
-
output_directory
:str
location to save the profile '.mat' files
-
time_range
:typing.Tuple
, defaultNone
the tuple containing information about the plasma scenario. typically (ramp-up start, flat-top start, flat-top end, ramp-down end)
-
stop_time
:int
, defaultNone
the time in seconds at which the profile stops, typically the end of the simulation
-
time_step
:int
, defaultNone
the difference in seconds between each individual step, typically matching the time step of the simulation
-
max_values
:typing.Optional
, defaultNone
a dictionary containing information about the maximum currents and powers for each profile in the format {'system name': value}
read_profile_to_df#
read_profile_to_df(filename: str) -> pandas.core.frame.DataFrame
Open a '.mat' profile file and write contents to a Pandas dataframe for easy access
Parameters#
-
filename
:str
address of the '.mat' file
Returns#
-
pandas.core.frame.DataFrame
dataframe containing time series data for the given profile