export_c_matrix#

Maxwell3d.export_c_matrix(matrix_name, output_file, setup=None, default_adaptive='LastAdaptive', is_post_processed=False)#

Export Capacitance matrix after solving.

This method allows to export in a .txt file capacitance and capacitance coupling coefficient matrices for Electrostatic solutions.

Parameters:
matrix_namestr

Matrix name to be exported.

output_filestr or pathlib.Path

Output file path to export R/L matrix file to. Extension must be .txt.

setupstr, optional

Name of the setup. If not provided, the active setup is used.

default_adaptivestr, optional

Adaptive type. The default is "LastAdaptive".

is_post_processedbool, optional

Boolean to check if it is post processed. Default value is False.

Returns:
bool

True when successful, False when failed.

References

>>> oanalysis.ExportSolnData

Examples

The following example shows how to export capacitance matrix from an Electrostatic solution.

>>> from ansys.aedt.core import Maxwell3d
>>> m3d = Maxwell3d(version="2025.2", solution_type="Electrostatic", new_desktop=False)
>>> up_plate = m3d.modeler.create_box(origin=[0, 0, 3], sizes=[25, 25, 2], material="pec")
>>> gap = m3d.modeler.create_box(origin=[0, 0, 2], sizes=[25, 25, 1], material="vacuum")
>>> down_plate = m3d.modeler.create_box(origin=[0, 0, 0], sizes=[25, 25, 2], material="pec")
>>> voltage1 = m3d.assign_voltage(assignment=down_plate.name, amplitude="0V", name="voltage1")
>>> voltage2 = m3d.assign_voltage(assignment=up_plate.name, amplitude="1V", name="voltage2")
>>> # set matrix and analyze
>>> matrix = m3d.assign_matrix(assignment=[voltage1.name, voltage2.name], matrix_name="Matrix")
>>> setup = m3d.create_setup()
>>> setup.analyze()
>>> # Export R/L Matrix after solving
>>> m3d.export_c_matrix(matrix_name=matrix.name, output_file="C:\Users\C_matrix.txt")
>>> m3d.release_desktop(True, True)