← Back to team overview

yade-users team mailing list archive

Re: Time Series Forcing implementation in python

 

>
> Do it just like you would in python:
>
> forces,times=[],[]
> for line in
> file('your.text.file.with.2.numbers.per.line.separated.by.whitespace')
>    if len(line.split())<2: continue # skip empty lines
>    f,t=[float(s) for s in line.split()]
>    forces.append(f)
>    times.append(t)
>
> def applyForce():
>    # find index of the time we are at or just after now in the series
>    # this is quite suboptimal, since it traverses the array every time
>    i=0;
>    while times[i]<O.time: i+=1
>    # and use force at that index
>    f=force[i]


Using the method above, yade will read my force data from file, but it will
not apply it to the particles.  (I know that it is reading the force data
properly because I have it print the force data from the file).  I do not
get an error when I run the simulation, but the particles do not move.  I
have tried larger magnitudes of forces to be sure that the particles would
move if exposed to the applied force.  Also, I am now running revision 1732.

Second, when I use InterpolatingSpiralEngine, I get the following error:
"RuntimeError: Number sequence argument required."  The arguements for this
engine include an angular velocity time series, but I have no knowledge of
this data.  Therefore I do not understand why I need this engine.  Perhaps I
should use a different interpolating engine?

Thank you for your continuing help.

Roger

Follow ups

References