Skip to content

Commit

Permalink
Fix Spring
Browse files Browse the repository at this point in the history
  • Loading branch information
YingboMa committed Sep 26, 2023
1 parent faf7682 commit dad15ea
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Rotations = "6038ab10-8711-5258-84ad-4b1120ba62dc"

[compat]
ModelingToolkit = "8.30"
ModelingToolkitStandardLibrary = "1.14"
ModelingToolkitStandardLibrary = "1.14, 2"
Rotations = "1.4"
julia = "1"

Expand Down
2 changes: 1 addition & 1 deletion src/forces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ function Spring(; c, name, m = 0, lengthFraction = 0.5, s_unstretched = 0, kwarg
@unpack frame_a, frame_b = ptf
@named lineForce = LineForceWithMass(; length = s_unstretched, m, lengthFraction,
kwargs...)
@named spring2d = TP.Spring(c; s_rel0 = s_unstretched)
@named spring2d = TP.Spring(; c, s_rel0 = s_unstretched)
@parameters c=c [description = "spring constant", bounds = (0, Inf)]
@parameters s_unstretched=s_unstretched [
description = "unstretched length of spring",
Expand Down
3 changes: 2 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ D = Differential(t)
defs = Dict(collect(spring.r_rel_0 .=> [0, 1, 0])...,
collect(body.r_0 .=> [0, 0, 0])...,
collect((D.(body.phi)) .=> [0, 0, 0])...,
collect(D.(D.(body.phi)) .=> [0, 0, 0])...)
collect((D.(body.phid)) .=> [0, 3, 0])...,
collect(D.(D.(body.phi)) .=> [0, 3, 0])...)
prob = ODEProblem(ssys, defs, (0, 10))

# du = prob.f.f.f_oop(prob.u0, prob.p, 0)
Expand Down

0 comments on commit dad15ea

Please sign in to comment.