save the height sphere in file
hi,
i have wrote a program of bouncing ball on the soil and i want to save the height of sphere in each time step in a file 'height.txt'
the problem is that the script does not calculate the heights and the time step .
my code is:
#!/usr/bin/python
# coding: utf-8
from numpy import*
from yade import plot
""" add the particule to simulation """
O.bodies.
""" add a wall to simulation """
O.bodies.
O.engines=[
ForceResetter(),
InsertionSor
InteractionLoop(
),
# Apply gravity force to particles. damping: numerical dissipation of energy.
NewtonIntegr
]
#fixing step time
O.dt=.5e-
# save the simulation
O.saveTmp()
""" open file"""
fil=open(
fil.write('%e %e\n' % (t/T, height))
""" print the sphere's height """
def height_sphr():
h = [O.bodies.
fil.write('%d, %.4f\n' % (O.iter,h))
fil.close()
Any ideas why it doesn't work?
Thanks in advance,
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: