(testmodels-coordinatespringdamperextvelocityoffsettest)= # coordinateSpringDamperExtVelocityOffsetTest.py You can view and download this file on Github: [coordinateSpringDamperExtVelocityOffsetTest.py](https://github.com/jgerstmayr/EXUDYN/tree/master/python/TestModels/coordinateSpringDamperExtVelocityOffsetTest.py) ```{code-block} python :linenos: #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # This is an EXUDYN example # # Details: The velocityOffset of ObjectConnectorCoordinateSpringDamperExt in the built-in force law # k*(q - x_off) + d*(v - v_off) (#2867): a mass on a damper to the ground, started at rest, is driven by the # damper to the velocity v_off - after many time constants m/d its velocity is v_off. # # Author: Johannes Gerstmayr # Date: 2026-10-07 # # 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. # #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ import exudyn as exu from exudyn.utilities import * #includes itemInterface and rigidBodyUtilities testIsActive = exu.sys.get('testIsActive', False) mass, damping, velocityOffset = 1., 50., 0.7 SC = exu.SystemContainer() mbs = SC.AddSystem() nGround = mbs.AddNode(NodePointGround()) node = mbs.AddNode(Node1D(referenceCoordinates=[0], initialCoordinates=[0], initialVelocities=[0])) mbs.AddObject(ObjectMass1D(nodeNumber=node, mass=mass)) mGround = mbs.AddMarker(MarkerNodeCoordinate(nodeNumber=nGround, coordinate=0)) mNode = mbs.AddMarker(MarkerNodeCoordinate(nodeNumber=node, coordinate=0)) nData = mbs.AddNode(NodeGenericData(numberOfDataCoordinates=3, initialCoordinates=[0,0,0])) mbs.AddObject(ObjectConnectorCoordinateSpringDamperExt(markerNumbers=[mGround, mNode], nodeNumber=nData, stiffness=0, damping=damping, velocityOffset=velocityOffset)) mbs.Assemble() simulationSettings = exu.SimulationSettings() simulationSettings.timeIntegration.numberOfSteps = 1000 simulationSettings.timeIntegration.endTime = 1 #50 time constants m/d simulationSettings.timeIntegration.verboseMode = 0 simulationSettings.solution.file.write = False mbs.SolveDynamic(simulationSettings) velocity = mbs.GetNodeOutput(node, exu.OutputVariableType.Coordinates_t) #a float, one coordinate exu.Print('velocity', velocity, ', expected', velocityOffset) errors = int(abs(velocity - velocityOffset) > 1e-8) exu.Print('coordinateSpringDamperExtVelocityOffsetTest: errors', errors) u = errors + velocity exu.Print('solution of coordinateSpringDamperExtVelocityOffsetTest=', u) exu.sys['testResult'] = u ```