Wavefront_Generation module
This module is responsible for processing various levels of wavefront simulaiton and storing them in their relevant Data_Storage arrays (see Wavefront_Storage).
- Notable functions are:
Generate_Wavefronts_Commutatively()- generates the production of wavefronts from a Data_Input_Storage input variable array. Makes use of commutative merging (described in the associated paper) which make it possible for the efficient simualiton of wavefronts.
- Wavefront_Generation.Full_Cycle(optional_data_input: Data_Input_Storage = False, **input_values)
Do full simualiton of the interface and produce a Data_Interface_Storage object with all the simualted data. The simulation procedure is as follows: calcualte input vatiables -> generate wavefront with commutative merging -> multiplicatively merge these wavefronts -> chronologically order wavefronts.
Is initialised using the same key-word arguments to intitalise Data_Input_Storage. OPTIONALLY a Data_Input_Storage array can be supplied directly to bypass internal creation of input data if it has been customized.
All values with the provided keys are of type string. This each input variable is converterted to a Decimal value to be used for precision calculations. The possible parameters to change and their defualt values are as follows, parameters are all optional
- Parameters:
L_impedance (String) – Characteristic impedance of the inductor, assigned to self.Inductor_Impedance (default:’100’)
L_time (String) – The time delay of the inductor in seconds, assigned to self.Inductor_Time (default:’1’)
L_length (String) – The length of the inductor in meters, assigned to self.Inductor_Length (default:’1’)
C_impedance (String) – Characteristic impedance of the capacitor, assigned to self.Capacitor_Impedance (default:’1’)
C_time (String) – The time delay of the capacitor in seconds, assigned to self.Capacitor_Time (default:’1’)
C_length (String) – The length of the capacitor in meters, assigned to self.Capacitor_Length (default:’1’)
V_source (String) – The magnitude of the initial voltage excitation in volts, assigned to self.Voltage_Souce_Magnitude (default:’1’)
number_periods (String) – The number of periods as according to Lumped-Element LC-Osscilator solution. Used to calculate the simulation stop time if provided. Overidden if ‘Simulation_stop_time’ is provided (default:’1’)
Load_impedance (String) – The magnitude of the load resistance, if left inf the load is ignored and the interface takes form of an LC-Osscilator. If a value is provided the load is considered and the self.Is_Buck flag is set to True (default:’inf’)
Simulation_stop_time (String) – The time to which the interface will be simulated. If provided it will overwrite the ‘number_periods’ simulation stop time calculation (default:’0’)
show_about (Boolean) – Indicates information about the calcualted variabels must be printed (default:True)
- Returns:
Interface Data object
- Return type:
from Wavefront_Generation import Full_Cycle from Wavefront_Plotting import plot_refelction_diagram import matplotlib.pyplot as plt # simulate an interface by providing key-values altered from the defaults interface_data = Full_Cycle(L_time = '3.6',C_time = '3.2',L_impedance = '300') # The interface object created stores all level of data from the simulation data_input = interface_data.data_input data_output_commutative = interface_data.data_output_commutative data_output_multiplicative = interface_data.data_output_multiplicative data_output_ordered = interface_data.data_output_ordered # plot the current reflection diagram of the interface fig, ax = plt.subplots() plot_refelction_diagram(interface_data,ax,False,stop_time='40') plt.show()
- Wavefront_Generation.Generate_Wavefronts_Commutatively(Data_Input: Data_Input_Storage)
Generates a Data_Output_Storage object from the calculated input variables stored in a Data_Input_Storage object.
- Parameters:
Data_Input (Data_Input_Storage) – Input data object containing simulation input variables
- Returns:
output data (a collection commutative fanouts in form of np.ndarrays)
- Return type:
Resposible for generating wavefronts and simultaneously commutatively merging the wavefronts. The simaltaneous commutative merging of wavefronts is mandatory for longer simulation times.
- Wavefront_Generation.Higher_Order_Merging(Data_Inputs: Data_Input_Storage, Data_Outputs: Data_Output_Storage)
Multiplicatively merges all commutatively merged data if applicable. Produces a Data_Output_Storage object with merged data.
- Parameters:
Data_Inputs (Data_Input_Storage) – input data of interface
Data_Outputs (Data_Output_Storage) – the commutatively merged data to be multiplicatively merged
- Returns:
a merged Data_Output_Storage storage object, merged version of the supplied Data_Outputs parameter
- Return type:
- Wavefront_Generation.Order_Data_Output_Merged(Data_Input: Data_Input_Storage, Data_Output_Merged: Data_Output_Storage)
Order the merged wavefront data into single dimension chronologically occuring ‘lists’. Uses a Breadth First Search type algorithm.
- Parameters:
Data_Input (Data_Input_Storage) – the input data of the interface
Data_Output_Merged (Data_Output_Storage) – the merged data to be ordered
- Raises:
warnings.warn – should be used on a merged data storage object, ekse results may be incorrect
- Returns:
ordered merged data
- Return type:
- Wavefront_Generation.get_spatial_voltage_current_at_time(Time_Enquriey: Decimal, Interface: Data_Interface_Storage, is_Inductor: bool)
Calcualte the postions of wavefronts on a transmission line and get the spatial distribution of voltage and current on either sides og the points.
- Parameters:
Time_Enquriey (Decimal) – The time at which spatial behaviour is investigated
Interface (Data_Interface_Storage) – The data stroage object of the interface
is_Inductor (bool) – if the transmission line investigate is the inductor or capacitor.
- Returns:
[intercept_postiions, left_voltage, right_voltage, left_current, right_current] left means closer to the interface.
- Return type:
tuple[list, list, list, list, list]
- Wavefront_Generation.multiplicative_merge_single_cycle(input_array: ndarray, Inductor_LCM_Factor: int, Capacitor_LCM_Factor: int)
Completes a single merging cycle of a mangitude fanout along the inductive axis. A single cycle consitis of splitting -> shift -> merging.
- Parameters:
input_array (np.ndarray) – An output array from Datat_Output_Storage class., i.e. data_output.Voltage_Interconnect_Inductor
Inductor_LCM_Factor (int) – The co-factor of the time-delay for the inductor, KL. KL x TL = LCM(TL,TC)
Capacitor_LCM_Factor (int) – The co-factor of the time-delay for the capacitor axis, KC. KC x TC = LCM(TL,TC)
- Returns:
returns the input_array after one more subsequent merging cycle.
- Return type:
np.ndarray
- Wavefront_Generation.multiplicative_merging(input_array: ndarray, Inductor_LCM_Factor: int, Capacitor_LCM_Factor: int, layer_number_limit: int)
recursively apply the merging process on an input array until merged.
- Parameters:
input_array (np.ndarray) – array to be merged
Inductor_LCM_Factor (int) – Inductor LCM cofactor KL
Capacitor_LCM_Factor (int) – Capacitor LCM cofactor KC
layer_number_limit (int) – up to what layer the array must be mrged to
- Returns:
merged array
- Return type:
np.ndarray
- Wavefront_Generation.transform_merged_array_to_C_axis(data_input: Data_Input_Storage, merged_array)
Transform merged data output array to a C-axis merging representation
- Parameters:
data_input (Data_Input_Storage) – input data for merged array
merged_array (np.ndarray[Decimal]) – merged array aligne to the C-axis
- Returns:
merged array aligned to the C-axis
- Return type:
np.ndarray[Decimal]