Note
Go to the end to download the full example code.
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#
Perform required imports.
from ansys.dpf import post
from ansys.dpf.post import examples
Get Solution
object#
Get the Solution
object.
solution = post.load_solution(examples.complex_rst)
solution.has_complex_result()
True
Get displacement result#
Get the displacement Result
object. It contain a field for real values
and a field for imaginary values.
disp_result = solution.displacement()
Check if support has complex frequencies#
Check if the support has complex frequencies.
disp_result.has_complex_frequencies()
True
Compute the result
disp = disp_result.vector
disp.num_fields
2
Define phase#
Define the phase. The phase value must be a float. The phase unit is degrees.
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 0x7fbcfe892200>
Get amplitude#
Get the 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.032 seconds)