| Enlighten Engineering |
|
| Home | Contact Us | OMD For Simulink | SCOOTA | Driving Game | PyOMD2 | PyOMD | Bug Walk |
OMD is partially written in Python and definning models is done using a python script. This document describes how each element is defined and includes a set of python commands that defines a model.
Defines a body to be included in the simulation. Bodies have mass and inertia and move in space in response to forces and interactions with other bodies to which they are joined through joints.
The following parameters need to be defined:
OMDPYTHONBODY = Body("name", Bool specifiying if body is fixed, mass, inertia)
b1 = Body("body1",False,5,[[1,0,0],[0,1,0],[0,0,1]])
Instantiates a body b1, with the name "body1" (often the same string), which is not fixed, has a mass of 5 and the inertia isthe identity matrix.
The units are left to the user, just be consistent.
Defines a kinematic connection between 2 bodies which only allows those two bodies to rotate relative to each other about a single axis.
OMDREVJOINT = JointRev("name",Parent,Child,p2j,j2c,a,theta,omega)
where:
p2j = [0.,0,0]
j2c = [1,0,0.]
a = [0,1,0]
j1rev = JointRev("j1rev",irf,b1,p2j,j2c,a,0,0)
Defines a kinematic connection between 2 bodies which only allows those two bodies to translate relative to each other along a single axis.
OMDTRANSJOINT = JointTrans("name",Parent,Child,p2j,j2c,a,x,xdot)
where:
p2j = [0.,0,0]
j2c = [1,0,0.]
a = [0,1,0]
j1trans = JointRev("j1trans",irf,b1,p2j,j2c,a,0,0)
A force and or torque on a body whose line of action and offset are both definable.
f1 = Force1Body("f1",b1,fv,tv,coord)
where:
fv = [0.0,0.0,-9.81]
tv = [0,0,0]
coord = [0,0,0]
f1 = Force1Body("f1",b1,fv,tv,coord)
Applies torque to a revolute joint, this joint is applied by the parent on the child. The Vector defining the force is applied to a child. An equal and opposite force is applied to the parent.
f3 = ForceRevJnt("f3",j1rev,torque)
where:
| OMD For Simulink Users Guide |