export_rl_matrix#
- Maxwell2d.export_rl_matrix(matrix_name, output_file, is_format_default=True, width=8, precision=2, is_exponential=False, setup=None, default_adaptive='LastAdaptive', is_post_processed=False)#
Export R/L matrix after solving.
This method allows to export in a .txt file Re(Z)/Im(Z), inductive Coupling Coefficient, R/L, and flux linkage matrices for Eddy Current solutions.
- Parameters:
- matrix_name
str
Matrix name to be exported.
- output_file
or
pathlib.Path
Output file path to export R/L matrix file to. Extension must be
.txt
.- is_format_defaultbool,
optional
Whether the exported format is default or not. If False the custom format is set (no exponential).
- width
int
,optional
Column width in exported .txt file.
- precision
int
,optional
Decimal precision number in exported *.txt file.
- is_exponentialbool,
optional
Whether the format number is exponential or not.
- setup
str
,optional
Name of the setup. If not provided, the active setup is used.
- default_adaptive
str
,optional
Adaptive type. The default is
"LastAdaptive"
.- is_post_processedbool,
optional
Boolean to check if it is post processed. Default value is
False
.
- matrix_name
- Returns:
- bool
True
when successful,False
when failed.
References
>>> oanalysis.ExportSolnData
Examples
The following example shows how to export R/L matrix from an Eddy Current solution.
>>> from ansys.aedt.core import Maxwell2d >>> m2d = Maxwell2d(solution_type="EddyCurrentZ") >>> coil1 = m2d.modeler.create_circle(origin=[5, 0, 0], radius=3, material="copper") >>> coil2 = m2d.modeler.create_circle(origin=[20, 0, 0], radius=3, material="copper") >>> current1 = m2d.assign_current(assignment=coil1.name, amplitude="3A", name="current1") >>> current2 = m2d.assign_current(assignment=coil2.name, amplitude="3A", name="current2") >>> region = m2d.modeler.create_rectangle(origin=[0, 0, -12.5], sizes=[25, 30], name="region") >>> edge_list = [region.top_edge_z, region.bottom_edge_y, region.top_edge_y] >>> m2d.assign_balloon(assignment=edge_list) >>> # Set matrix and analyze >>> matrix = m2d.assign_matrix(assignment=[current1.name, current2.name], matrix_name="Matrix") >>> setup = m2d.create_setup() >>> setup.analyze() >>> # Export R/L Matrix after solving >>> m2d.export_rl_matrix(matrix_name=matrix.name, output_file="C:\Users\RL_matrix.txt") >>> m2d.release_desktop(True, True)