# yade-users team mailing list archive

## Re: [Question #694017]: Extract normal force

```Question #694017 on Yade changed:

Status: Open => Needs information

Hello,

> I call normal contact force, the magnitudes of the force of contact between ball and mill in the normal direction
> > the force at each step time
> i want to save the evolution of interaction force in time

still this is very confusing.
In the simulation, you have (possibly) many balls and many ball-mill interactions and many forces.
What is "(the) force"?
- force of one specific interaction?
- sum of force vectors?
- sum of force magnitudes?
- ... ?

> I call force vector, or normal force, in my question here, the vector
contenning the value of magnitudes force in normal direction saving at
each step time.

I strongly recommend to use a different name for the "vector" in this case not to be confused with "ordinary" force vector.
Maybe array? field?

> i insert a loop for j in O.time in my script; But i can't have the
result i need.

it results in an error, no surprise you do not have the result.
Fix errors first.

> I don't know if there is an other way, to save the contact force at
each step time

There are many ways.
To choose a suitable one, first of all you need to know (or explain it properly in the case you want help from others) what you want. Which does not seem to be the case (see above).

> ... mwe ...

W = working, which is not the case here. Please, fix the indentation to be valid Python code.
Moreover, O.time is a number and you cannot iterate it "for j in O.time"

>   totalNormalForce = i.phys.normalForce

**guessing** it should be inside the sphere-facet condition:
- why the equal sign? Shouldn't the value of totalNormalForce be incremented by i.phys.normalForce instead of rewriting?
- you write you want normal force magnitudes. here you assign/sum normal force vector. What exactly do you want?
- you can save the data "manually" as you do here. But you should clear the output file first (the code appends data to whatever already is in the file)
- instead of "manual" saving, Yade "standardly" uses plot module for this purposes [1]

cheers
Jan