edit_sources#
- Q2d.edit_sources(cg=None, acrl=None, dcrl=None, harmonic_loss=None)#
Set up the source loaded for Q3D or Q2D in multiple sources simultaneously.
- Parameters:
- cg
dict,optional Dictionary of input sources to modify the module and phase of a CG solution. Dictionary values can be: - 1 Magnitude to set up
0degas the default - 2 Values tuple or list (magnitude and phase)- acrl
dict,optional Dictionary of input sources to modify the module and phase of an ACRL solution. Dictionary values can be: - 1 Magnitude to set up 0deg as the default - 2 Values tuple or list (magnitude and phase)
- dcrl
dict,optional Dictionary of input sources to modify the module and phase of a DCRL solution, This parameter is only available for Q3D. Dictionary values can be: - 1 Magnitude to set up
0degas the default - 2 Values tuple or list (magnitude and phase)- harmonic_loss: dict, optional
Dictionary of real and imaginary currents for each source in order to compute harmonic loss. Dictionary values can be: - 1 Real part of the current - 2 Imag part of the current
- cg
- Returns:
- bool
Truewhen successful,Falsewhen failed.
Examples
>>> from ansys.aedt.core import Q3d >>> q3d = Q3d(version="2025.2") >>> sources_cg = {"Box1": ("1V", "0deg"), "Box1_2": "1V"} >>> sources_acrl = {"Box1:Source1": ("5A", "0deg")} Values can also be passed as lists instead of tuples. >>> sources_dcrl = {"Box1_1:Source2": ["5V", "0deg"]} Assuming to have two TAB files containing respectively the real and imaginary parts of the current for the source ``Box1:Source1``. >>> real_data_set = q3d.import_dataset1d("real_dataset_file_path", name="real_dataset") >>> imag_data_set = q3d.import_dataset1d("imag_dataset_file_path", name="imag_dataset") >>> harmonic_loss = {"Box1:Source1": (real_data_set.name, imag_data_set.name)} >>> q3d.edit_sources(cg=sources_cg, acrl=sources_acrl, dcrl=sources_dcrl, harmonic_loss=harmonic_loss)