← Back to team overview

yade-users team mailing list archive

Re: [Question #647311]: plot velocity

 

Question #647311 on Yade changed:
https://answers.launchpad.net/yade/+question/647311

    Status: Open => Answered

Jan Stránský proposed the following answer:
Hi Rodolfo,

> I am new user in yade

welcome :-)

> I would like to know if is possible build a chart from sphere velocity
of script below.

sure. Just put a PyRunner to your O.engines and place the rest of the below code to the end of your script
 
#############
...
O.engines = [
   ...
   PyRunner(iterPeriod=1000,command="plotAddData()"),
]
...
def plotAddData():
   v = O.bodies[0].state.vel
   vz = v[2]
   plot.addData(
      iter = O.iter,
      time = O.time,
      vz = vz,
   )
plot.plots = {'time':('vx','vy','vz')}
plot.plot()
# push play button
#############

cheers
Jan

[1] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.PyRunner
[2] https://yade-dem.org/doc/yade.plot.html#yade.plot.addData
[3] https://yade-dem.org/doc/user.html#plotting-variables

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.