XML Syntax Alternative

Any model built using XML syntax can be rewritten in a much more compact and readable way using the MotionSolve Python interface.

The example below illustrates this with a simple model.
from msolve import * 
def sliding_block (out_name):
 m       = Model (output=out_name)
 grav    = Accgrav (jgrav=-9.800)
 dstiff  = Integrator (type="DSTIFF", error=1e-5)
 p0      = Point (10,0,0)
 ux      = Vector (1,0,0)
 uz      = Vector (0,0,1)
 grnd    = Part (ground=True)
 oxyz    = Marker (body=grnd, label="Global CS")

 # Sliding Block
 blk1    = Part (label="Block-1", mass=1, ip=[4.9e-4,4.9e-4,4.9e-4])
 blk1.cm = Marker (label="Block-1 CM", body=blk1, qp=p0, zp=p0+ux, xp=p0+uz)

 # Trans Joint along Global-X
 im1     = Marker (label="Joint-1 I", body=blk1, qp=p0, zp=p0+ux, xp=p0+uz)
 jm1     = Marker (label="Joint-1 J", body=grnd, qp=p0, zp=p0+ux, xp=p0+uz)
 jnt1    = Joint (label="Joint-1", type="TRANSLATIONAL", i = im1, j = jm1)

 # Actuator force
 sf1     = Sforce (type="TRANSLATION", actiononly=True, i=im1, j=jm1,
 label   = "Actuation Force-1", function="3*sin(2*pi*time)")
 so      = Output (reqsave=True)
 return m

###############################################################################
model = sliding_block ("One-Sliding-Block")
model.simulate (type="DYNAMICS", end=4, dtout=.01)

The XML syntax will be fully supported and enhanced as needed.