Complex results from a modal or harmonic analysis#

模态分析或谐波分析的复杂结果

This example shows how you can access complex results from a modal or harmonic analysis.

Perform required imports#

执行所需的导入

from ansys.dpf import post
from ansys.dpf.post import examples

Get Solution object#

获取 ``Solution`` 对象

solution = post.load_solution(examples.complex_rst)
solution.has_complex_result()
True

Get displacement result#

获取位移结果

获取位移 Result 对象。它包含一个实数值域和一个虚数值域。

disp_result = solution.displacement()

Check if support has complex frequencies#

Check if the support has complex frequencies.

disp_result.has_complex_frequencies()
True

计算结果

disp = disp_result.vector
disp.num_fields
2

Define phase#

定义相位

定义相位。相位值必须是浮点数。相位单位为度。

phase = 39.0
disp_at_phase = disp_result.vector_at_phase(phase)
print(f"Maximum displacement at phase {phase}:", disp_at_phase.max_data)
print(f"There are {disp_at_phase.num_fields} fields")
real_field = disp_result.vector_at_phase(0.0)
img_field = disp_result.vector_at_phase(90.0)

real_field
Maximum displacement at phase 39.0: [[2.15187123e-09 2.15185939e-09 3.19282171e-10]]
There are 1 fields

<ansys.dpf.post.result_data.ResultData object at 0x000002B11B106350>

Get amplitude#

获取振幅

disp_ampl = disp_result.vector_amplitude
disp_ampl.num_fields
disp_ampl.max_data
DPFArray([[2.76946052e-09, 2.76952555e-09, 4.10914321e-10]])

Total running time of the script: (0 minutes 0.034 seconds)

Gallery generated by Sphinx-Gallery