Re: [Yade-users] [Question #580450]: Applying differents force values

2017-03-28 Thread Jan Stránský
Question #580450 on Yade changed:
https://answers.launchpad.net/yade/+question/580450

Jan Stránský posted a new comment:
O.foeces.permF(int), so both O.forces.permF(540) and
O.forces.permF(upBox.id) are correct, O.forces.permF(O.bodies[540])
would give you some error

once you have the value, you can do whatever you want with it, the most 
Yade-like approach would be to use plot module
#
def plotAddData():
   plot.addData(
  i = O.iter,
  f540 = someValueGotWithPermF,
   )
   # plot.saveDataTxt(fileName) # save it periodically
O.engines = [
   ...
   plot.adddata(iterPeriod=..., command="plotAddData()"),
]
...
# saveDataTxt(fileName) # after simulation ends

Or you can save the value to a text file:

with open(fileName,'a') as f:
   f.write("{}\n".format(someValue))

Have a look at Yade doc and Python doc or write here or open new
question if something is not clear

cheers
Jan

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #580450]: Applying differents force values

2017-03-27 Thread Felipe
Question #580450 on Yade changed:
https://answers.launchpad.net/yade/+question/580450

Status: Answered => Solved

Felipe confirmed that the question is solved:
Thanks Jan Stránský, that solved my question.

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #580450]: Applying differents force values

2017-03-27 Thread Felipe
Question #580450 on Yade changed:
https://answers.launchpad.net/yade/+question/580450

Felipe posted a new comment:
Hello Jan,

Really sorry for my response delay.

I guess what you are saying about reading force. You are totally right.

Just one point, how can i use the command O.forces.permF(someId) that
you have mentioned?

O.forces.permF(540) or O.forces.permF(upBox.id) or
O.forces.permF(O.bodies[540]).

Also, you said i can use this command to get prescribed force and SAVE
IT. How does it works?

Thanks.

Felipe

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #580450]: Applying differents force values

2017-03-24 Thread Jan Stránský
Question #580450 on Yade changed:
https://answers.launchpad.net/yade/+question/580450

Status: Open => Answered

Jan Stránský proposed the following answer:
Hi Felipe,
thanks for the complete scripts. I have tried them and did not find anything 
wrong. Just to summarize:

> I have found divergences when i have apply the force on the surface and then 
> I read the value that i recorded.
> When I read the force, I noticed that the applied values were different from 
> 200.

it is simply because read force and applied force are intrinsically
different values, see my previous comments (you don't read the applied
(=prescribed)  force, you read total force applied on the body
(=prescribed force+forces from interactions)

> is it the correct way to apply the force on the surface? How can i be
sure that i really applied the force value on the surface?

yes, it is the correct way. You can be sure because you used the command
:-) You can also use O.forces.permF(someId) to check if a perment force
is set on body with id=someId (you can use this command to get
prescribed force and save it, maybe this is what you wanted from the
ForceRecorder?).

cheers
Jan

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #580450]: Applying differents force values

2017-03-23 Thread Felipe
Question #580450 on Yade changed:
https://answers.launchpad.net/yade/+question/580450

Felipe gave more information on the question:
Hello Jan,

As you have requested me, i am sharing the full script on the link.

https://www.dropbox.com/s/ykyva1ywy01iaxs/caixa_inferior_100mm_ascii.stl?dl=0

https://www.dropbox.com/s/aasvk3umptt4fk2/caixa_superior_100mm_ascii.stl?dl=0

https://www.dropbox.com/s/2xgx3iut15frqbm/script.py?dl=0

Let me know if i need to provide anything more.

cheers,

felipe

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #580450]: Applying differents force values

2017-03-23 Thread Jan Stránský
Question #580450 on Yade changed:
https://answers.launchpad.net/yade/+question/580450

Jan Stránský posted a new comment:
Hi Felipe,

thanks for more info. However, it is still not complete :-) could you
please create a complete script that records the force and saves the
data?

>From the script it is clear, that force 200 is applied correctly. The rest 
>depends on "read the force". 
Just guessing, O.forces.f returns total force on body, i.e. applied force PLUS 
forces from interactions. In the case of static equlibrium, it returns zero.

cheers
Jan

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #580450]: Applying differents force values

2017-03-22 Thread Felipe
Question #580450 on Yade changed:
https://answers.launchpad.net/yade/+question/580450

Status: Answered => Open

Felipe is still having a problem:
Hello Jan,

I guess the correct way in MWE to ask this question. Below, you can see the 
short script that i am using to apply the force.

# Yade 1.20 - Ubuntu 16.04 LTS

upBox = box( center=(0,210,0), extents=(35,1,35)
,fixed=True,wire=False,material='peso')

p1=O.bodies.append([upBox])

sp=pack.SpherePack()
sp.makeCloud((-35,-45,-35),(35,200,35),rMean=5,periodic=False,porosity=0.8,distributeMass=False,seed=0)
sp.toSimulation()


upBox = O.bodies[540]   
O.forces.addF(upBox.id,(0,-2e2,0), permanent=True)  
upBox.dynamic = True
upBox.state.mass = 10   
upBox.state.inertia =(20,20,1)  
upBox.state.blockedDOFs = 'xzXYZ'   


I was hoping to apply a force value of 200 the spheres to compress and
also this constant force.

When I read the force, I noticed that the applied values were different
from 200.

How should I apply force to keep the determined value constant and when
reading the body to plot on the graph does the force value find exactly
the value that was applied?

The results that were found is on the link.

https://www.dropbox.com/s/9rpfigjaqfy3171/Normal_force2.dat?dl=0

https://www.dropbox.com/s/7u4jlfo1nv4gd1r/Normal_force.dat?dl=0


thanks.

felipe

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #580450]: Applying differents force values

2017-03-22 Thread Jan Stránský
Question #580450 on Yade changed:
https://answers.launchpad.net/yade/+question/580450

Status: Open => Answered

Jan Stránský proposed the following answer:
Hi Felipe,
in such situations, please provide a MWE [1] such that we can test the problem, 
new we can only guess what the problem is.
The applied force is just one part of recorded (total) force on the body, there 
are also forces from interactions.. May this be the "problem"?
cheers
Jan

[1] https://yade-dem.org/wiki/Howtoask

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


[Yade-users] [Question #580450]: Applying differents force values

2017-03-21 Thread Felipe
New question #580450 on Yade:
https://answers.launchpad.net/yade/+question/580450

Hello guys,

I have found divergences when i have apply the force on the surface and then I 
read the value that i recorded.

I am applying four different forces (10N, 20N, 50N and 100N). 

To do it, i am using the script below:

upBox = O.bodies[540]   
#identify the body
O.forces.addF(upBox.id,(0,-2e1,0), permanent=True)  #force value = 
20N
upBox.dynamic = True
upBox.state.mass = 10   
upBox.state.inertia =(20,20,1)  
upBox.state.blockedDOFs = 'xzXYZ'   
#block displacement


is it the correct way to apply the force on the surface? How can i be sure that 
i really applied the force value on the surface?

thanks for advance.

cheers,

felipe

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

___
Mailing list: https://launchpad.net/~yade-users
Post to : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp