BodyResult

Results ElementBodyResult is an object that contains all the results associated with single body from a simulation.

Class Name

BodyResult

Description

At each output time, the following results are stored:
Entity Component Name
Rigid Body (0-6): X, Y, Z, E0, E1, E2, E3
Point Mass (0-2): X, Y, Z
Flex_Body (0-6): X, Y, Z, E0, E1, E2, E3

(7-12): X_dot, Y_dot, Z_dot, ωx, ωy, ωz

(13-18): X_dotdot, Y_dotdot, Z_dotdot, ωx_dot, ωy_dot, ωz_dot

(19-18+Nmodes): Modal participation factors

(19+Nmodes): Strain energy

The following occurs automatically when the model.simulate() method is invoked with returnResults=True.
  • At T=0, for each Body in the model (Rigid, PointMass and Flex_Body)
    • A BodyResults object is created
    • The object is stored in the SimulationResults container object
  • At each output time (including T=0):
    • for each Body in the model (Rigid, PointMass and Flex_Body)
      • The body results are appended to the BodyResults object
  • Thus at the end of the simulation, the SimulationResults object is fully "populated"

Usage

See SimulationResult

Example

Demonstrate the use of BodyResult to create plots from MotionSolve results.

Assume a model, M, is given to you.
  • Perform a dynamic simulation from 0 to 2 seconds with 200 output steps.
  • Extract the time history for the translational X component of the displacement of Body1.
  • Plot the X time history in matplotlib.
# Perform a simulation
run = M.simulate(type="DYNAMICS", end=2, steps=200, returnResults=True)

# Get the force request data from the run object
req = run.getObject (model.body1)

# Extract the time and X signals
times = req.getComponent ("times")
FZ = req.getComponent ("X")

# Plot the signal
import matplotlib.pyplot as plt
plt.plot (times, FZ)
plt.title ("Body1-X vs. Time")
plt.xlabel("Time")
plt.ylabel ("Displacement [m]")
plt.grid (True)
plt.show()

Comments

  1. See Properties for an explanation about what properties are, why they are used, and how you can extend these.
  2. The SimulationResults may be queried to get access to the time histories of its various components. See the examples above.