← Back to team overview

yade-users team mailing list archive

Re: [Question #262922]: TorqueEngine, angular acceleration and moment of inertia of Boxes

 

Question #262922 on Yade changed:
https://answers.launchpad.net/yade/+question/262922

Jan Stránský proposed the following answer:
Just a sidenote, if you use box, the mass and inertia is computed in
py/utils.py file [1,2,3], not in c++ as you refer to.. in utils.py, the
inertia is computed as you cited, but with density instead of mass.. so
evidently a bug :-) feel free to report it
Jan

PS: thanks for notifying

b1 = b=box((0,0,0),(1,1,1))
b2 = b=box((0,0,0),(2,2,2))
print b1.state.inertia, b2.state.inertia

Vector3(8000,8000,8000) Vector3(32000,32000,32000) # but should be 32x more
(8x more mass x 4x more geometry inertia), not 4x more...

[1]
http://bazaar.launchpad.net/~yade-pkg/yade/git-trunk/view/head:/py/utils.py#L214
[2]
http://bazaar.launchpad.net/~yade-pkg/yade/git-trunk/view/head:/py/utils.py#L116
[3]
http://bazaar.launchpad.net/~yade-pkg/yade/git-trunk/view/head:/py/utils.py#L128


2015-03-02 19:36 GMT+01:00 behzad
<question262922@xxxxxxxxxxxxxxxxxxxxx>:

> Question #262922 on Yade changed:
> https://answers.launchpad.net/yade/+question/262922
>
> behzad posted a new comment:
> Yes, this value came from PFC!
>
> I changed it to zero. Now the ratio of the applied torque to the obtained
> angular acceleration is correct.
> However, the problem is the calculation of inertia is not correct.
>
> we have:
>
> upper_plate =
> O.bodies.append(box((0,0,0),(1,1,0.1),fixed=True,material=CohMat))
>
> ]: O.bodies[upper_plate].state.mass
>  ->  [2]: 1600.0
>
>
> So from
>
>
> body->state->inertia=Vector3r(mass*(4*extents[1]*extents[1]+4*extents[2]*extents[2])/12.,mass*(4*extents[0]*extents[0]+4*extents[2]*extents[2])/12.,mass*(4*extents[0]*extents[0]+4*extents[1]*extents[1])/12.);
>
> we must have inertia as (538.66,538.66,1066.66)
>
> But we get:
>
>  O.bodies[upper_plate].state.inertia
>  ->  [3]: Vector3(8080,8080,16000)
>
> Where does it come from?
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to     : yade-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.