# displacement vs friction graph plotting

We have written a code for a sphere on a horizontal plate with some contact law between them and a normal load is applied on the sphere.

sp=sphere((0,0,0),1)
plate=box((0,0,-1.1),(10,10,.1))
O.bodies.append(sp)
O.bodies.append(plate)
plate.state.vel =(0,.002,0)
sp.setPermF(5,(0,0,-1))
mat = FrictMat(frictionAngle=0.5)
O.materials.append(mat)
InteractionLoop(
[Ig2_Box_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
)

Can you please suggest the code for plotting graph of "Displacement of plate v/s friction at interface" .

## Question information

Language:
English Edit question
Status:
For:
Assignee:
No assignee Edit question
Last query:
 Revision history for this message Pawan (pawan10) said on 2021-06-20: #1

#creating sphere
sp=sphere((0,0,0),1)
#sp.state.blockedDOFs = "xyzXYZ"

#creating plate
plate=box((0,0,-1.1),(10,10,.1))

O.bodies.append(sp)
O.bodies.append(plate)

#providing plate velocity
plate.state.vel =(0,.002,0)

#normal force on sphere
sp.setPermF(5,(0,0,-1))

#tribology
mat = FrictMat(frictionAngle=0.5)
O.materials.append(mat)

O.dt=dtSafety*PWaveTimeStep()
print('Timestep',O.dt)

O.engines=[
ForceResetter(),
InteractionLoop(
[Ig2_Box_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
),
]

We have completed code till here. How can we plot "Displacement of plate versus mag. of Friction at interface"

 Revision history for this message Jan Stránský (honzik) said on 2021-06-20: #2

Hello,

> Can you please suggest the code for plotting graph of "Displacement of plate v/s friction at interface" .
> How can we plot "Displacement of plate versus mag. of Friction at interface"

Can you please suggest what is "friction at interface" to be plotted ?
Friction coefficient? Tangential force? Some inelastic part of the tangential force? ... ?

How to track and plot values, have a look at .
"The plot module provides simple interface and storage for tracking various data. Although originally conceived for plotting only, it is widely used for tracking variables in general."
You can then plot data directly in yade or save the data to be plotted by a different program.

Cheers
Jan

 Revision history for this message Pawan (pawan10) said on 2021-06-24: #3

Sorry for the inconvenience, I am new to this platform.
I have sorted my code till here

idSteel=O.materials.append(FrictMat(young=210e9,poisson=.25,frictionAngle=.8,label="steel")) #material
sp=sphere((0,0,0),1,material=idSteel) #sphere
plate=box((0,0,-1),(10,100,0),material=idSteel) #plate
plateID=O.bodies.append(plate) #plateID=0
spID=O.bodies.append(sp) #spID=1
sp.state.blockedDOFs = "xyXYZ" #sphere movement z dir allowed
O.forces.setPermF(1,(0,0,-1)) # 1 mag. force on sphere in -ve z direction
plate.state.blockedDOFs = "xyzXYZ" #plate movement blocked
plate.state.vel =(0,.02,0) #plate given const. velocity in y direction

#engine
O.engines=[ForceResetter(),
InteractionLoop(
[Ig2_Box_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
),
NewtonIntegrator(),
]

Dz=plate.state.displ()
Fz=O.forces.f(plateID)
plot.plots={'Dz':('Fz')}
plot.plot()
O.dt=0.5*PWaveTimeStep()
O.saveTmp()

Here what I am trying to do is fixing a sphere particle on a moving plate. A normal load is applied on the sphere ....the same thing as we do in the shear test ..but here with a single particle.
Now I want to record the friction at the interface with the displacement of the plate.

The problem that I feel is the normal force applied is not getting transferred to the interface and hence no friction is recorded.

For the friction force, I have taken force on the plate....as the only force on the plate in a moving direction will be friction.

Kindly help me with this .

 Revision history for this message Jan Stránský (honzik) said on 2021-06-28: #4

So "friction at interface" is friction force?

In your O.engines, you have no collider, therefore no collision detection and no forces.
Have a look at .

Cheers
Jan