How to solve the issue 'a float is required' when using the mathfunction log
Hello,I'm going to use yade to simulate biaxial drained compression experiment. But when it runs to script 46,strainy = -100.*math.
Could you please help me solve the error?
Thank you.
Here are my scripts and I use python 2.7.15.
from yade import pack,plot
import math
O.materials.
sp = pack.SpherePack()
size = .24
sp.makeCloud(
sp.toSimulation()
O.cell.hSize = Matrix3(size,0,0, 0,size,0, 0,0,.1)
print len(O.bodies)
for p in O.bodies:
p.state.
p.state.mass = 2650 * 0.1 * pi * p.shape.radius**2 # 0.1 = thickness of cylindrical particle
inertia = 0.5 * p.state.mass * p.shape.radius**2
p.state.inertia = (.5*inertia,
O.dt = utils.PWaveTime
print O.dt
O.engines = [
ForceResetter(),
InsertionSor
InteractionLoop(
[
[
[
),
PeriTriaxCon
dynCell=True,
goal=
stressMask=3,
relStress
maxUnbala
maxStrain
doneHook=
label='biax'
),
NewtonIntegr
PyRunner(
]
def saveAddData():
stress = utils.getStress()
plot.addData(
strainy = -100.*math.
stressy = -0.001*stress[1],
p = -0.0005*
q = 0.0005*
)
plot.
def shear():
print getStress()
print O.cell.hSize
setContactFr
O.cell.
biax.
biax.
biax.
biax.
biax.
O.engines=
O.pause()
O.run();O.wait()
The error it reports is as follows.
/usr/bin/yadedaily in <module>()
/usr/bin/yadedaily in saveAddData()
44 stress = utils.getStress()
45 plot.addData(
---> 46 strainy = -100.*math.
47 stressy = -0.001*stress[1],
48 p = -0.0005*
TypeError: a float is required
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Robert Caulk
- Solved:
- Last query:
- Last reply: