> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Analysis

The following sample code illustrates how to create a simple example.

* The example was created using "Ansys installed path/Motion/Document/Drive Train Models.zip"

## Sound Pressure

Sound pressure analysis (SPA) can be used to analyze the sound pressure generated by the vibration of the system surface based on "Rayleigh Integral". this example describes how to create the Sound Pressure.

* Before the analysis, the bodies that are the source of sound pressure must be defined as FE or EasyFlex bodies in the preprocessor.
* The coordinate systems must be created to define the microphone positions which are the target positions for sound pressure calculation.

```python theme={null}
# Example_OperationAPI_CreateSoundPressure.py
# Refer to the OperationAPI.py file
import sys
references_path = __file__.rsplit('\\', 1)[0]
sys.path.append(references_path)
from OperationAPI import *

# Start the headless application interface
applicationHandler = ApplicationHandler()

# Import result file
# Get Install Path
# The 'XX' in AWP_ROOTXXX represents the year, like 25 for the year 2025, and the leat 'X' indicates the half of the year,
# where '1' represents the first half and '2' represents the second half.
# For example, in 'AWP_ROOT251' and 'AWP_ROOT252', '25' represents the year 2025, and '1' indicates the first half of the year,
# while '2' indicates the second half.
install_path = get_env_variable("AWP_ROOTXXX")

filepath = combine_path(install_path, r'Motion\Document\Drive Train Models\Tutorial_01_Trasmission\Tutorial\Subsystem\Subsystem Drivetrain\GearBox1_improved.dfr')

# Set array about result file
filepaths = List[str]()
filepaths.Add(filepath)

# Open about result files
applicationHandler.AddDocument(filepaths)

# Find Page
pages = applicationHandler.GetPages()

findViews = list()
for page in pages :
    views = page.GetViews()
    animationViews = [view for view in views if view.ViewType == ViewType.Animation]
    for animationView in animationViews :
        if animationView.DocumentFilePath == filepath and animationView.AnalysisResultType == AnalysisResultType.Dynamics :
            findViews.append(animationView)

viewCount = len(findViews)
if viewCount > 0 :
    animationview = findViews[0]
    animationview.CreateCoordinateSystem("Microphone", "Ground")

    microphone = animationview.GetViewModelByName("Microphone")
    microphone.TransformationOffsetPosition = Vector(0,300,0)

    bodynames = List[str](1)
    bodynames.Add(r'Housing_01/FE_Housing')
    microphoneNames = List[str](1)
    microphoneNames.Add(r'Microphone')

    animationview.CreateSoundPressure(bodynames, microphoneNames, 10.0, 100.0, 3.0, 1.21E-09, 343000.0, 2000.0, 1, 100, False)
```
