Skip to content

Commit dfe55e7

Browse files
committed
adapted TestModels and Examples to new mainSystemExtensions
1 parent d3c696e commit dfe55e7

File tree

430 files changed

+5733
-2397
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

430 files changed

+5733
-2397
lines changed

INSTALL.txt

+17-4
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,26 @@ for installation use:
33

44
pre-compiled binaries are available via pypi.org
55

6-
for installation of pre-release versions, use:
6+
for installation of pre-release versions, which is in line with
7+
the latest code on GitHub, use:
78
pip install exudyn --pre
89

10+
for building wheel, go to 'main' folder and inside a Python shell, type:
11+
python setup.py bdist_wheel
12+
13+
For detailed, platform-specific installation instructions, see:
14+
Documentation on ReadTheDocs:
15+
https://exudyn.readthedocs.io/en/latest/docs/RST/Exudyn.html
16+
17+
PDF documentation:
18+
https://github.com/jgerstmayr/EXUDYN/tree/master/docs/theDoc/theDoc.pdf
19+
920
For Examples see:
21+
https://exudyn.readthedocs.io/en/latest/docs/RST/ExamplesIndex.html
22+
https://exudyn.readthedocs.io/en/latest/docs/RST/TestModelsIndex.html
23+
24+
or
25+
1026
https://github.com/jgerstmayr/EXUDYN/tree/master/main/pythonDev/Examples
1127
https://github.com/jgerstmayr/EXUDYN/tree/master/main/pythonDev/TestModels
1228

13-
For building instructions and detailed information on installation see:
14-
https://github.com/jgerstmayr/EXUDYN/tree/master/docs/theDoc/theDoc.pdf
15-

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Exudyn
3737

3838
**A flexible multibody dynamics systems simulation code with Python and C++**
3939

40-
Exudyn version = 1.6.110.dev1 (Gillespie)
40+
Exudyn version = 1.6.118.dev1 (Gillespie)
4141

4242
+ **University of Innsbruck**, Department of Mechatronics, Innsbruck, Austria
4343

docs/RST/Examples/3SpringsDistance.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ You can view and download this file on Github: `3SpringsDistance.py <https://git
120120
simulationSettings.timeIntegration.generalizedAlpha.useIndex2Constraints = True
121121
simulationSettings.displayStatistics = True
122122
123-
exu.SolveDynamic(mbs, simulationSettings)
123+
mbs.SolveDynamic(simulationSettings)
124124
125125
else:
126126
simulationSettings.solutionSettings.coordinatesSolutionFileName = "staticSolution.txt"
@@ -130,7 +130,7 @@ You can view and download this file on Github: `3SpringsDistance.py <https://git
130130
simulationSettings.staticSolver.newton.absoluteTolerance = 1e-1
131131
simulationSettings.staticSolver.verboseMode = 2
132132
133-
exu.SolveStatic(mbs, simulationSettings)
133+
mbs.SolveStatic(simulationSettings)
134134
135135
SC.WaitForRenderEngineStopFlag()
136136
exu.StopRenderer() #safely close rendering window!

docs/RST/Examples/ALEANCFpipe.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ You can view and download this file on Github: `ALEANCFpipe.py <https://github.c
190190
exu.StartRenderer()
191191
#mbs.WaitForUserToContinue()
192192
193-
exu.SolveDynamic(mbs, simulationSettings,
193+
mbs.SolveDynamic(simulationSettings,
194194
solverType=exu.DynamicSolverType.TrapezoidalIndex2)
195195
196196
SC.WaitForRenderEngineStopFlag()
@@ -215,7 +215,7 @@ You can view and download this file on Github: `ALEANCFpipe.py <https://github.c
215215
216216
exu.StartRenderer()
217217
218-
exu.SolveStatic(mbs, simulationSettings)
218+
mbs.SolveStatic(simulationSettings)
219219
220220
sol = mbs.systemData.GetODE2Coordinates()
221221
n = len(sol)

docs/RST/Examples/ANCFALEtest.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ You can view and download this file on Github: `ANCFALEtest.py <https://github.c
186186
#static step
187187
simulationSettings.staticSolver.numberOfLoadSteps=10
188188
189-
success = exu.SolveStatic(mbs, simulationSettings, updateInitialValues=True)
189+
success = mbs.SolveStatic(simulationSettings, updateInitialValues=True)
190190
191191
192192
#turn on moving beam:
@@ -199,7 +199,7 @@ You can view and download this file on Github: `ANCFALEtest.py <https://github.c
199199
#rope decelerates due to gravity and then runs backwards
200200
simulationSettings.timeIntegration.numberOfSteps = int(1/h)
201201
simulationSettings.timeIntegration.endTime = 1
202-
success = exu.SolveDynamic(mbs, simulationSettings,
202+
success = mbs.SolveDynamic(simulationSettings,
203203
exudyn.DynamicSolverType.TrapezoidalIndex2,
204204
updateInitialValues=True)
205205
mbs.systemData.SetODE2Coordinates_tt(coordinates = mbs.systemData.GetODE2Coordinates_tt(),
@@ -219,7 +219,7 @@ You can view and download this file on Github: `ANCFALEtest.py <https://github.c
219219
simulationSettings.solutionSettings.appendToFile = True #continue solution
220220
simulationSettings.timeIntegration.endTime = tEnd
221221
222-
success = exu.SolveDynamic(mbs, simulationSettings,
222+
success = mbs.SolveDynamic(simulationSettings,
223223
exudyn.DynamicSolverType.TrapezoidalIndex2
224224
)
225225
@@ -229,9 +229,9 @@ You can view and download this file on Github: `ANCFALEtest.py <https://github.c
229229
230230
plt.close('all')
231231
if True:
232-
from exudyn.plot import PlotSensor
232+
233233
plt.figure("ALE pos/vel")
234-
PlotSensor(mbs, sensorNumbers=[mbs.variables['sALEpos'],mbs.variables['sALEvel']], components=[0,0])
234+
mbs.PlotSensor(sensorNumbers=[mbs.variables['sALEpos'],mbs.variables['sALEvel']], components=[0,0])
235235
236236
plt.figure("midpoint")
237237
data0 = np.loadtxt('solution/beamALEmidPoint.txt', comments='#', delimiter=',')

docs/RST/Examples/ANCFcantileverTest.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ You can view and download this file on Github: `ANCFcantileverTest.py <https://g
110110
111111
if doDynamicSimulation:
112112
exu.StartRenderer()
113-
exu.SolveDynamic(mbs, simulationSettings)
113+
mbs.SolveDynamic(simulationSettings)
114114
SC.WaitForRenderEngineStopFlag()
115115
exu.StopRenderer() #safely close rendering window!
116116
else:
@@ -129,8 +129,8 @@ You can view and download this file on Github: `ANCFcantileverTest.py <https://g
129129
mbs.SetLoadParameter(nLoad, 'loadVector', [0, -loadValue,0])
130130
print('load vector=' + str(mbs.GetLoadParameter(nLoad, 'loadVector')) )
131131
132-
exu.SolveStatic(mbs, simulationSettings, updateInitialValues=True)
133-
#exu.SolveStatic(mbs, simulationSettings, updateInitialValues=False) #second solve to increase accuracy
132+
mbs.SolveStatic(simulationSettings, updateInitialValues=True)
133+
#mbs.SolveStatic(simulationSettings, updateInitialValues=False) #second solve to increase accuracy
134134
135135
sol = mbs.systemData.GetODE2Coordinates()
136136

docs/RST/Examples/ANCFcantileverTestDyn.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ You can view and download this file on Github: `ANCFcantileverTestDyn.py <https:
138138
simulationSettings.solutionSettings.solutionInformation = "nonlinear beam oscillations"
139139
140140
exu.StartRenderer()
141-
exu.SolveDynamic(mbs, simulationSettings)
141+
mbs.SolveDynamic(simulationSettings)
142142
SC.WaitForRenderEngineStopFlag()
143143
exu.StopRenderer() #safely close rendering window!
144144

docs/RST/Examples/ANCFcontactCircle.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ You can view and download this file on Github: `ANCFcontactCircle.py <https://gi
187187
if solveDynamic:
188188
exu.StartRenderer()
189189
190-
exu.SolveDynamic(mbs, simulationSettings)
190+
mbs.SolveDynamic(simulationSettings)
191191
192192
SC.WaitForRenderEngineStopFlag()
193193
exu.StopRenderer() #safely close rendering window!
@@ -207,7 +207,7 @@ You can view and download this file on Github: `ANCFcontactCircle.py <https://gi
207207
exu.StartRenderer()
208208
209209
#mbs.WaitForUserToContinue()
210-
exu.SolveStatic(mbs, simulationSettings)
210+
mbs.SolveStatic(simulationSettings)
211211
212212
sol = mbs.systemData.GetODE2Coordinates()
213213
n = len(sol)

docs/RST/Examples/ANCFcontactCircle2.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ You can view and download this file on Github: `ANCFcontactCircle2.py <https://g
204204
if solveDynamic:
205205
exu.StartRenderer()
206206
207-
exu.SolveDynamic(mbs, simulationSettings)
207+
mbs.SolveDynamic(simulationSettings)
208208
209209
SC.WaitForRenderEngineStopFlag()
210210
exu.StopRenderer() #safely close rendering window!
@@ -229,7 +229,7 @@ You can view and download this file on Github: `ANCFcontactCircle2.py <https://g
229229
exu.StartRenderer()
230230
231231
mbs.WaitForUserToContinue()
232-
exu.SolveStatic(mbs, simulationSettings)
232+
mbs.SolveStatic(simulationSettings)
233233
234234
#sol = mbs.systemData.GetODE2Coordinates()
235235
#n = len(sol)

docs/RST/Examples/ANCFmovingRigidbody.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ You can view and download this file on Github: `ANCFmovingRigidbody.py <https://
254254
if solveDynamic:
255255
exu.StartRenderer()
256256
257-
exu.SolveDynamic(mbs, simulationSettings)
257+
mbs.SolveDynamic(simulationSettings)
258258
259259
SC.WaitForRenderEngineStopFlag()
260260
exu.StopRenderer() #safely close rendering window!
@@ -277,7 +277,7 @@ You can view and download this file on Github: `ANCFmovingRigidbody.py <https://
277277
278278
exu.StartRenderer()
279279
280-
exu.SolveStatic(mbs, simulationSettings)
280+
mbs.SolveStatic(simulationSettings)
281281
282282
sol = mbs.systemData.GetODE2Coordinates()
283283
n = len(sol)

docs/RST/Examples/ANCFslidingJoint2D.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ You can view and download this file on Github: `ANCFslidingJoint2D.py <https://g
243243
if solveDynamic:
244244
exu.StartRenderer()
245245
246-
exu.SolveDynamic(mbs, simulationSettings)
246+
mbs.SolveDynamic(simulationSettings)
247247
248248
SC.WaitForRenderEngineStopFlag()
249249
exu.StopRenderer() #safely close rendering window!
@@ -266,7 +266,7 @@ You can view and download this file on Github: `ANCFslidingJoint2D.py <https://g
266266
267267
exu.StartRenderer()
268268
269-
exu.SolveStatic(mbs, simulationSettings)
269+
mbs.SolveStatic(simulationSettings)
270270
271271
#sol = mbs.systemData.GetODE2Coordinates()
272272
#n = len(sol)

docs/RST/Examples/ANCFslidingJoint2Drigid.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ You can view and download this file on Github: `ANCFslidingJoint2Drigid.py <http
192192
exu.StartRenderer()
193193
mbs.WaitForUserToContinue()
194194
195-
exu.SolveDynamic(mbs, simulationSettings)
195+
mbs.SolveDynamic(simulationSettings)
196196
197197
SC.WaitForRenderEngineStopFlag()
198198
exu.StopRenderer() #safely close rendering window!
@@ -217,7 +217,7 @@ You can view and download this file on Github: `ANCFslidingJoint2Drigid.py <http
217217
218218
exu.StartRenderer()
219219
220-
exu.SolveStatic(mbs, simulationSettings)
220+
mbs.SolveStatic(simulationSettings)
221221
222222
#sol = mbs.systemData.GetODE2Coordinates()
223223
#n = len(sol)

docs/RST/Examples/ANCFswitchingSlidingJoint2D.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,11 @@ You can view and download this file on Github: `ANCFswitchingSlidingJoint2D.py <
237237
238238
239239
exu.StartRenderer()
240-
exu.SolveDynamic(mbs, simulationSettings)
240+
mbs.SolveDynamic(simulationSettings)
241241
242242
if False:
243243
for i in range(5000): #2500
244-
exu.SolveDynamic(mbs, simulationSettings)
244+
mbs.SolveDynamic(simulationSettings)
245245
246246
if mbs.GetRenderEngineStopFlag():
247247
print('stopped by user')

docs/RST/Examples/ANCFtestHalfcircle.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ You can view and download this file on Github: `ANCFtestHalfcircle.py <https://g
155155
156156
mbs.SetPreStepUserFunction(UFchangeLoad)
157157
158-
exu.SolveDynamic(mbs, simulationSettings)
158+
mbs.SolveDynamic(simulationSettings)
159159
#v = mbs.CallObjectFunction(1,'GetAngularVelocity',{'localPosition':[L/2,0,0],'configuration':'Current'})
160160
#print('angular vel='+str(v))
161161
SC.WaitForRenderEngineStopFlag()
@@ -197,7 +197,7 @@ You can view and download this file on Github: `ANCFtestHalfcircle.py <https://g
197197
# cableDict['physicsReferenceAxialStrain'] = 0.1*curvatureValue
198198
# mbs.ModifyObject(nCable, cableDict)
199199
200-
exu.SolveStatic(mbs, simulationSettings)
200+
mbs.SolveStatic(simulationSettings)
201201
202202
sol = mbs.systemData.GetODE2Coords()
203203
mbs.systemData.SetODE2Coords(coords=sol, configurationType=exu.ConfigurationType.Initial) #set initial conditions for next step
@@ -214,7 +214,7 @@ You can view and download this file on Github: `ANCFtestHalfcircle.py <https://g
214214
else:
215215
simulationSettings.staticSolver.numberOfLoadSteps = 1
216216
simulationSettings.staticSolver.adaptiveStep = True
217-
exu.SolveStatic(mbs, simulationSettings)
217+
mbs.SolveStatic(simulationSettings)
218218
219219
220220
SC.WaitForRenderEngineStopFlag()

docs/RST/Examples/ANCFtests2.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ You can view and download this file on Github: `ANCFtests2.py <https://github.co
165165
166166
167167
168-
exu.SolveDynamic(mbs, simulationSettings)
168+
mbs.SolveDynamic(simulationSettings)
169169
170170
SC.WaitForRenderEngineStopFlag()
171171
exu.StopRenderer() #safely close rendering window!
@@ -200,7 +200,7 @@ You can view and download this file on Github: `ANCFtests2.py <https://github.co
200200
# cableDict['physicsReferenceAxialStrain'] = 0.1*curvatureValue
201201
# mbs.ModifyObject(nCable, cableDict)
202202
203-
exu.SolveStatic(mbs, simulationSettings)
203+
mbs.SolveStatic(simulationSettings)
204204
205205
sol = mbs.systemData.GetODE2Coordinates()
206206
mbs.systemData.SetODE2Coordinates(coordinates=sol, configurationType=exu.ConfigurationType.Initial) #set initial conditions for next step
@@ -216,7 +216,7 @@ You can view and download this file on Github: `ANCFtests2.py <https://github.co
216216
simulationSettings.staticSolver.newton.relativeTolerance = 1e-7
217217
simulationSettings.staticSolver.verboseMode = 1
218218
simulationSettings.displayStatistics = True
219-
exu.SolveStatic(mbs, simulationSettings)
219+
mbs.SolveStatic(simulationSettings)
220220
221221
222222
SC.WaitForRenderEngineStopFlag()

docs/RST/Examples/CMSexampleCourse.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ You can view and download this file on Github: `CMSexampleCourse.py <https://git
458458
if 'renderState' in exu.sys: SC.SetRenderState(exu.sys['renderState']) #load last model view
459459
mbs.WaitForUserToContinue() #press space to continue
460460
461-
exu.SolveDynamic(mbs, #solverType=exu.DynamicSolverType.TrapezoidalIndex2,
461+
mbs.SolveDynamic(#solverType=exu.DynamicSolverType.TrapezoidalIndex2,
462462
simulationSettings=simulationSettings)
463463
464464
if addSensors:
@@ -478,8 +478,8 @@ You can view and download this file on Github: `CMSexampleCourse.py <https://git
478478
if False: #use this to reload the solution and use SolutionViewer
479479
SC.visualizationSettings.general.autoFitScene=False #if reloaded view settings
480480
481-
from exudyn.interactive import SolutionViewer
482-
SolutionViewer(mbs) #can also be entered in IPython ...
481+
482+
mbs.SolutionViewer() #can also be entered in IPython ...
483483
484484
485485
# # Plot sensor
@@ -488,8 +488,8 @@ You can view and download this file on Github: `CMSexampleCourse.py <https://git
488488
489489
490490
if addSensors:
491-
from exudyn.plot import PlotSensor
492-
PlotSensor(mbs, sensorNumbers=[sMidDispl,sMidDispl,sMidDispl], components=[0,1,2])
491+
492+
mbs.PlotSensor(sensorNumbers=[sMidDispl,sMidDispl,sMidDispl], components=[0,1,2])
493493
494494
495495
# In[ ]:

docs/RST/Examples/ComputeSensitivitiesExample.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ You can view and download this file on Github: `ComputeSensitivitiesExample.py <
112112
mbs.Assemble()
113113
114114
#start solver:
115-
exu.SolveDynamic(mbs, simulationSettings)
115+
mbs.SolveDynamic(simulationSettings)
116116
117117
118118

docs/RST/Examples/HydraulicActuator2Arms.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -276,24 +276,24 @@ You can view and download this file on Github: `HydraulicActuator2Arms.py <https
276276
mbs.WaitForUserToContinue()
277277
278278
#use %timeit to measure time!
279-
exu.SolveDynamic(mbs, simulationSettings, showHints=False)
279+
mbs.SolveDynamic(simulationSettings, showHints=False)
280280
281281
282282
if True: #use this to reload the solution and use SolutionViewer
283283
SC.visualizationSettings.general.autoFitScene = False
284-
from exudyn.interactive import SolutionViewer
285-
SolutionViewer(mbs) #can also be entered in IPython ...
284+
285+
mbs.SolutionViewer() #can also be entered in IPython ...
286286
287287
exu.StopRenderer() #safely close rendering window!
288288
289-
from exudyn.plot import PlotSensor
290-
PlotSensor(mbs, sensorNumbers=[sForce,sForce2], components=[exudyn.plot.componentNorm]*2, labels=['connector force arm1','connector force arm1'], yLabel='force (N)', closeAll=True)
291-
PlotSensor(mbs, sensorNumbers=[sDistance,sDistance2], components=0)
292-
PlotSensor(mbs, sensorNumbers=[sPressures]*2+[sPressures2]*2, components=[0,1,0,1], labels=['p0 arm1', 'p1 arm1', 'p0 arm2', 'p1 arm2'], yLabel='pressure (N/m^2)')
289+
290+
mbs.PlotSensor(sensorNumbers=[sForce,sForce2], components=[exudyn.plot.componentNorm]*2, labels=['connector force arm1','connector force arm1'], yLabel='force (N)', closeAll=True)
291+
mbs.PlotSensor(sensorNumbers=[sDistance,sDistance2], components=0)
292+
mbs.PlotSensor(sensorNumbers=[sPressures]*2+[sPressures2]*2, components=[0,1,0,1], labels=['p0 arm1', 'p1 arm1', 'p0 arm2', 'p1 arm2'], yLabel='pressure (N/m^2)')
293293
294294
#p01 = mbs.GetSensorStoredData(sPressures)
295295
#p01[:,1] = A[0]*p01[:,1] - A[1]*p01[:,2]
296-
#PlotSensor(mbs, sensorNumbers=p01, components=0, labels=['differential hydraulic force'], yLabel='hydraulic force (N)')
296+
#mbs.PlotSensor(sensorNumbers=p01, components=0, labels=['differential hydraulic force'], yLabel='hydraulic force (N)')
297297
298298
299299

0 commit comments

Comments
 (0)