rizer.hybrid.low_voltage_model#
Classes#
Functions#
|
Load a LowVoltageModel from a dictionary of parameters. |
Module Contents#
- class rizer.hybrid.low_voltage_model.LowVoltageModel(lv_discharge_model: rizer.hybrid.low_voltage.constant_mass_discharge_in_lte.ConstantMassDischargeInLTE, electrical_circuit_model: rizer.hybrid.low_voltage.RLR_circuit.RLR_Circuit)#
- lv_discharge_model#
Low-voltage discharge model in LTE to solve the thermal ODEs.
- electrical_circuit_model#
Electrical circuit model to solve simultaneously with the plasma channel ODEs.
- times: numpy.ndarray | None = None#
Time points at which the solution was evaluated [s].
- temperatures: numpy.ndarray | None = None#
Temperature of the plasma channel at each time point [K].
- currents: numpy.ndarray | None = None#
Current through the plasma channel at each time point [A].
- R_p: numpy.ndarray#
Plasma resistance at each time point [Ohm].
- r_p: numpy.ndarray#
Plasma radius at each time point [m].
- d_p: numpy.ndarray#
Plasma diameter at each time point [m].
- P_Joule: numpy.ndarray#
Joule power dissipated in the plasma at each time point [W].
- P_cc_gas: numpy.ndarray#
Power transferred from the plasma to the gas at each time point [W].
- P_cc_electrode: numpy.ndarray#
Power transferred from the plasma to the electrodes at each time point [W].
- P_radiation: numpy.ndarray#
Power radiated by the plasma at each time point [W].
- U_p: numpy.ndarray#
Voltage drop across the plasma at each time point [V].
- U_R_wire: numpy.ndarray#
Voltage drop across the wire resistance at each time point [V].
- U_L_wire: numpy.ndarray#
Voltage drop across the wire inductance at each time point [V].
- U_mes: numpy.ndarray#
Measured voltage at each time point [V].
- power_R_p: numpy.ndarray#
Power dissipated in the plasma resistance at each time point [W].
- power_R_wire: numpy.ndarray#
Power dissipated in the wire resistance at each time point [W].
- power_L_wire: numpy.ndarray#
Power dissipated in the wire inductance at each time point [W].
- energy_R_p: numpy.ndarray#
Energy dissipated in the plasma resistance at each time point [J].
- energy_R_wire: numpy.ndarray#
Energy dissipated in the wire resistance at each time point [J].
- energy_L_wire: numpy.ndarray#
Energy dissipated in the wire inductance at each time point [J].
- R_wire: numpy.ndarray#
Wire resistance at each time point [Ohm].
- solve(times: numpy.ndarray, **solver_options) None#
Solve the system of ordinary differential equations (ODEs) governing the plasma channel.
- Parameters:
times (
numpy.ndarray) – The time points at which to evaluate the solution [s].**solver_options –
Additional options to pass to the ODE solver. By default, the following options are used:
method: ‘BDF’ (suitable for stiff problems)
rtol: 1e-12
atol: 1e-12
first_step: 1e-12
max_step: 1e-8
- Returns:
The results are stored in the instance attributes times, temperatures, and currents.
- Return type:
- Raises:
RuntimeError – If the ODE solver fails to converge.
Notes
The system of ODEs solved is as follows:
Thermal ODE.
Electrical ODE.
The temperature is obtained from the enthalpy using the LTE data.
The ODEs are solved simultaneously using scipy.integrate.solve_ivp.
- plot(x: str, y: str, yscale: str = 'linear', ylim: tuple[float, float] | None = None, show: bool = True, x_unit='s', annotate: bool = False, annotate_max: bool = True, figax: tuple[matplotlib.figure.Figure, matplotlib.axes.Axes] | None = None) tuple[matplotlib.figure.Figure, matplotlib.axes.Axes]#
Plot the results of the simulation.
- Parameters:
x (
str) –The variable to plot on the x-axis. Options are:
”time” or “t”: Time in seconds (or microseconds if x_unit is set to “µs”).
”temperature” or “T”: Discharge temperature in Kelvin.
”current” or “I”: Circuit current in Amperes.
y (
str) –The variable to plot on the y-axis. Options are:
”temperature” or “T”: Discharge temperature [K].
”current” or “I”: Circuit current [A].
”R_p”: Plasma resistance [Ω].
”r_p”: Discharge radius [mm].
”d_p”: Discharge diameter [mm].
”P_Joule”: Joule power dissipated in the plasma [kW].
”P_cc_gas”: Power transferred from the plasma to the gas [kW].
”P_cc_electrode”: Power transferred from the plasma to the electrodes [kW].
”P_radiation”: Power radiated by the plasma [kW].
”U_p”: Plasma voltage [V].
”U_R_wire”: Voltage drop across the wire resistance [V].
”U_L_wire”: Voltage drop across the wire inductance [V].
”U_mes”: Measured voltage [V].
”P_R_p”: Power dissipated in the plasma resistance [kW].
”P_R_wire”: Power dissipated in the wire resistance [kW].
”P_L_wire”: Power dissipated in the wire inductance [kW].
”E_R_p”: Energy dissipated in the plasma resistance [mJ].
”E_R_wire”: Energy dissipated in the wire resistance [mJ].
”E_L_wire”: Energy dissipated in the wire inductance [mJ].
”R_wire”: Wire resistance [Ω].
yscale (
str, optional) – The scale of the y-axis. Options are “linear” or “log” (default is “linear”).ylim (
tupleoffloat, optional) – The limits for the y-axis as a tuple (ymin, ymax). If None, the limits are determined automatically (default is None).show (
bool, optional) – Whether to display the plot immediately (default is True).x_unit (
str, optional) – The unit for the x-axis if x is “time” or “t”. Options are “s” for seconds or “µs” for microseconds (default is “s”).annotate (
bool, optional) – Whether to annotate the plot with the maximum value of y (default is False).annotate_max (
bool, optional) – Whether to annotate the plot with the maximum value of y (default is True). If False, annotate the minimum value instead. annotate must be True for this to have an effect.figax (
tupleofmatplotlib.figure.Figure,matplotlib.axes.Axes, optional) – A tuple containing the Figure and Axes objects to plot on.
- Returns:
The figure and axes objects of the plot.
- Return type:
- Raises:
ValueError – If no data is available for plotting (i.e., solve has not been called). If an invalid variable is specified for the x or y axis.
- rizer.hybrid.low_voltage_model.load_low_voltage_model_from_dict(input_dict: dict) LowVoltageModel#
Load a LowVoltageModel from a dictionary of parameters.
This is a helper function to load the model from a YAML file, where the parameters are stored in a nested dictionary.
- Parameters:
input_dict (
dict) – Dictionary containing the parameters for the LowVoltageModel. Should have the same structure as the low_voltage_model section of the input YAML file.- Returns:
An instance of the LowVoltageModel initialized with the parameters from the input dictionary.
- Return type: