← Back to team overview

yade-users team mailing list archive

Re: [Question #657560]: Plotting force & displacement of impactor in a penetration test

 

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

Swapnil posted a new comment:
I tested the above two commands and they seem to be correct :)

Now I am attempting to plot the force-displacements in the Z-direction.
The following is the current script:

from yade import pack,plot
pred=pack.inCylinder((0,0,0),(0,0,0.25),0.10)
sp=pack.randomDensePack(pred,radius=0.01,spheresInCell=300)
O.bodies.append(sp)
yade.qt.Controller()
idSteel=O.materials.append(FrictMat(young=210e9,poisson=.25,frictionAngle=.8,label="steel"))
hammer=sphere((0,0,0.30),0.04,material=idSteel)
hammerID=O.bodies.append(hammer)
hammer.state.blockedDOFs='z'
calm()
hammer.state.vel=Vector3(0,0,-0.5)
O.engines=[ForceResetter(),InsertionSortCollider([Bo1_Sphere_Aabb()]),InteractionLoop([Ig2_Sphere_Sphere_ScGeom()],[Ip2_FrictMat_FrictMat_FrictPhys()],[Law2_ScGeom_FrictPhys_CundallStrack()]),NewtonIntegrator(),PyRunner(iterPeriod=100,command="addPlotData()")]
def addPlotData():
  Dz=hammer.state.displ[2]
  Fz=O.forces.f(hammerID)[2]
  plot.addData(i=O.iter,Fz=Fz,Dz=Dz)
plot.plots{'Dz':('Fz')}
plot.plot()
O.dt=0.5*PWaveTimeStep()
O.saveTmp()


But I am receiving an error saying the line - plot.plots{'Dz':('Fz')} is an invalid syntax. I tried to run through the documentation but cannot figure out the correction required here.

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