RequestResult
Results ElementRequestResult is an object that contains all the simulation results associated with a single Request.
Class Name
RequestResult
Description
Entity | Component Name |
---|---|
Displacement Request | MAG, X, Y, Z, PSI, THETA, PHI |
Velocity Request | VM, VX, VY, VZ, WM, WX, WY, WZ |
Acceleration Request | ACCM, ACCX, ACCY, ACCZ, WDTM, WDTX, WDTY, WDTZ |
Force Request | FM, FX, FY, FZ, TM, TX, TY, TZ |
User Request | F1, F2, F3, F4, F5, F6, F7, F8 |
- At T=0, for each Request in the model
- A RequestResult object is created.
- The object is stored in the SimulationResults container object.
- At each output time (including T=0):
- for each Request in the model:
- The Request results are appended to the RequestResult object.
- for each Request in the model:
- Thus, at the end of the simulation, the SimulationResults object is fully "populated".
Usage
Example
Demonstrate the use of RequestResult to create plots from MotionSolve results.
- Perform a dynamic simulation from 0 to 2 seconds with 200 output steps.
- Extract the time history for the FZ component of force request forceRequest1.
- Plot the FZ 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.forceRequest1)
# Extract the time and FZ signals
times = req.getComponent ("times")
FZ = req.getComponent ("FZ")
# Plot the signal
import matplotlib.pyplot as plt
plt.plot (times, FZ)
plt.title ("Fz vs. Time")
plt.xlabel ("Time")
plt.ylabel ("force [N]")
plt.grid (True) plt.show ()
Comments
- See Properties for an explanation about what properties are, why they are used, and how you can extend these.
- The SimulationResults may be queried to get access to the time histories of its various components.