Skip to content

Commit 90ccc6c

Browse files
committed
Added docstring for add_deadzone_springs!
1 parent e805bd6 commit 90ccc6c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/components/storages.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,17 @@ end
314314
const ReLUSpring{T, C} = RectifiedSpring{T, C}
315315
ReLUSpring(args...;kwargs...) = RectifiedSpring(args...; kwargs...)
316316

317+
"""
318+
add_deadzone_springs!(mechanism, stiffness, bounds, coord_id)
319+
320+
Creates a spring with a deadzone, that acts with stiffness `stiffness` outside of
321+
bounds `bounds`, e.g. (-1.0, 1.0), on the coordinate `coord_id`.
322+
323+
The deadzone is implemented as two ReLU springs on two new coordinates, which are
324+
offset from the original coordinate by the bounds. This is because the ReLU spring
325+
is centered at zero, so the new coordinates are used to shift the 'zero point' to
326+
match the bounds.
327+
"""
317328
function add_deadzone_springs!(mechanism, stiffness, bounds, coord_id)
318329
lb, ub = bounds
319330
lb_coord_id = add_coordinate!(mechanism, ConstCoord(lb); id="lb_$coord_id")

0 commit comments

Comments
 (0)