myFirstExample.py

You can view and download this file on Github: myFirstExample.py

 1#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2# This is an EXUDYN example
 3#
 4# Details:  Micro example from documentation; use this to check if Exudyn works
 5#
 6# Author:   Johannes Gerstmayr
 7# Date:     2019-08-01
 8#
 9# Copyright:This file is part of Exudyn. Exudyn is free software. You can redistribute it and/or modify it under the terms of the Exudyn license. See 'LICENSE.txt' for more details.
10#
11#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12
13import exudyn as exu               #EXUDYN package including C++ core part
14from exudyn.itemInterface import * #conversion of data to exudyn dictionaries
15
16SC = exu.SystemContainer()         #container of systems
17mbs = SC.AddSystem()               #add a new system to work with
18
19nMP = mbs.AddNode(NodePoint2D(referenceCoordinates=[0,0]))
20mbs.AddObject(ObjectMassPoint2D(physicsMass=10, nodeNumber=nMP ))
21mMP = mbs.AddMarker(MarkerNodePosition(nodeNumber = nMP))
22mbs.AddLoad(Force(markerNumber = mMP, loadVector=[0.001,0,0]))
23
24mbs.Assemble()                     #assemble system and solve
25simulationSettings = exu.SimulationSettings()
26simulationSettings.timeIntegration.verboseMode=1 #provide some output
27mbs.SolveDynamic(simulationSettings)