Results Element |
||||||||||||||||||||||
Class NameBodyResult Description |
||||||||||||||||||||||
BodyResult is an object that contains all the results associated with single body from a simulation. At each output time, the following results are stored:
The following occurs automatically when the model.simulate() method is invoked with returnResults=True.
|
||||||||||||||||||||||
UsageSee SimulationResult |
||||||||||||||||||||||
Comments
|
||||||||||||||||||||||
Example
Assume a model, M, is given to you.
|
||||||||||||||||||||||
# 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() |