Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add default values for support #199

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Mechanical/Rotational/sources.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@mtkmodel PartialTorque begin
@parameters begin
use_support
use_support = false
end
@extend flange, phi_support = partial_element = PartialElementaryOneFlangeAndSupport2(use_support = use_support)
@variables begin
Expand Down Expand Up @@ -34,7 +34,7 @@ Input signal acting as external torque on a flange
"""
@mtkmodel Torque begin
@parameters begin
use_support
use_support = false
end
@extend (flange,) = partial_element = PartialElementaryOneFlangeAndSupport2(use_support = use_support)
@components begin
Expand Down Expand Up @@ -69,7 +69,7 @@ Constant torque source
[
description = "Constant torque (if negative, torque is acting as load in positive direction of rotation)",
]
use_support
use_support = false
end
@extend flange, phi = partial_element = PartialTorque(; use_support = use_support)
@variables begin
Expand Down
1 change: 1 addition & 0 deletions test/Mechanical/rotational.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ end
J_motor = 0.1 # Motor inertia

@named fixed = Fixed()
@named torque_test = Torque() # Test that it's possible to instantiate torque with default support value
@named torque = Torque(use_support = true)
@named inertia1 = Inertia(J = 2, phi = pi / 2)
@named spring = Rotational.Spring(c = 1e4)
Expand Down