Skip to content

Commit fdc907a

Browse files
author
Brad Carman
committed
removed ConstantX components
1 parent f724bd5 commit fdc907a

File tree

7 files changed

+16
-91
lines changed

7 files changed

+16
-91
lines changed

docs/src/connectors/sign_convention.md

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,13 @@ This is demonstrated in the following domains of `Mechanical`, `Electrical`, and
5757

5858
The flow variable (i.e. force) input component for the `Mechanical` domain is
5959

60-
```julia
60+
```@example sign_convention
61+
using ModelingToolkit
62+
using ModelingToolkitStandardLibrary.Mechanical.Translational
63+
6164
@mtkmodel ConstantForce begin
6265
@parameters begin
63-
f = 0
66+
f
6467
end
6568
@components begin
6669
flange = MechanicalPort()
@@ -75,12 +78,6 @@ end
7578
Here we can see that a positive input force results in an increasing velocity.
7679

7780
```@example sign_convention
78-
using ModelingToolkit
79-
using ModelingToolkitStandardLibrary.Mechanical.Translational
80-
81-
@parameters t
82-
D = Differential(t)
83-
8481
@mtkmodel System begin
8582
@components begin
8683
mass = Mass(; m = 10)
@@ -98,10 +95,12 @@ full_equations(sys)
9895

9996
The flow variable (i.e. current) input component for the `Electrical` domain is
10097

101-
```julia
98+
```@example sign_convention
99+
using ModelingToolkitStandardLibrary.Electrical
100+
102101
@mtkmodel ConstantCurrent begin
103102
@parameters begin
104-
i = 0
103+
i
105104
end
106105
@components begin
107106
p = Pin()
@@ -117,8 +116,6 @@ end
117116
Here we can see that a positive input current results in an increasing voltage. Note that the electrical domain uses pins `p` and `n` at each side of the source and energy storage components. The direction of connection is not important here, only that a positive connector `p` connects with a negative connector `n`.
118117

119118
```@example sign_convention
120-
using ModelingToolkitStandardLibrary.Electrical
121-
122119
@mtkmodel System begin
123120
@components begin
124121
capacitor = Capacitor(; C = 10)
@@ -156,11 +153,13 @@ full_equations(sys)
156153

157154
The flow variable (i.e. mass flow) input component for the `Hydraulic` domain is
158155

159-
```julia
156+
```@example sign_convention
157+
using ModelingToolkitStandardLibrary.Hydraulic.IsothermalCompressible
158+
160159
@mtkmodel ConstantMassFlow begin
161160
@parameters begin
162161
p_int
163-
dm = 0
162+
dm
164163
end
165164
@components begin
166165
port = HydraulicPort(; p_int)
@@ -174,8 +173,6 @@ end
174173
A positive input mass flow leads to an increasing pressure (in this case we get increasing density (`rho`), which is directly related to an increasing pressure).
175174

176175
```@example sign_convention
177-
using ModelingToolkitStandardLibrary.Hydraulic.IsothermalCompressible
178-
179176
@mtkmodel System begin
180177
@components begin
181178
volume = FixedVolume(; vol = 10.0, p_int = 0.0)

src/Electrical/Analog/sources.jl

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -48,29 +48,4 @@ See [OnePort](@ref)
4848
end
4949
end
5050

51-
"""
52-
ConstantCurrent(; i=0, name)
53-
54-
Acts as an ideal constant current source with no internal resistance.
55-
56-
# Connectors:
57-
- `p`: positive pin
58-
- `n`: negative pin
59-
60-
# Parameters:
61-
- `i`: input current
6251

63-
"""
64-
@mtkmodel ConstantCurrent begin
65-
@parameters begin
66-
i = 0
67-
end
68-
@components begin
69-
p = Pin()
70-
n = Pin()
71-
end
72-
@equations begin
73-
0 ~ p.i + n.i
74-
i ~ -n.i
75-
end
76-
end

src/Electrical/Electrical.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ include("Analog/ideal_components.jl")
2323
export CurrentSensor, PotentialSensor, VoltageSensor, PowerSensor, MultiSensor
2424
include("Analog/sensors.jl")
2525

26-
export Voltage, Current, ConstantCurrent
26+
export Voltage, Current
2727
include("Analog/sources.jl")
2828

2929
# include("Digital/gates.jl")

src/Hydraulic/IsothermalCompressible/IsothermalCompressible.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ include("utils.jl")
1919
export Cap, Tube, FixedVolume, DynamicVolume
2020
include("components.jl")
2121

22-
export ConstantMassFlow, MassFlow, Pressure, FixedPressure
22+
export MassFlow, Pressure, FixedPressure
2323
include("sources.jl")
2424

2525
end

src/Hydraulic/IsothermalCompressible/sources.jl

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,6 @@
33
44
Hydraulic mass flow input source
55
6-
# Connectors:
7-
8-
- `port`: hydraulic port
9-
- `dm`: real input
10-
"""
11-
@mtkmodel ConstantMassFlow begin
12-
@parameters begin
13-
p_int
14-
dm = 0
15-
end
16-
@components begin
17-
port = HydraulicPort(; p_int)
18-
end
19-
@equations begin
20-
port.dm ~ -dm
21-
end
22-
end
23-
24-
"""
25-
MassFlow(; name, p_int)
26-
27-
Hydraulic mass flow input source
28-
296
# Connectors:
307
318
- `port`: hydraulic port

src/Mechanical/Translational/Translational.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ include("utils.jl")
1818
export Mass, Spring, Damper, Fixed
1919
include("components.jl")
2020

21-
export ConstantForce, Force, Position, Velocity, Acceleration
21+
export Force, Position, Velocity, Acceleration
2222
include("sources.jl")
2323

2424
export ForceSensor, PositionSensor

src/Mechanical/Translational/sources.jl

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,3 @@
1-
"""
2-
ConstantForce(; f=0, name)
3-
4-
Linear 1D constant force input source
5-
6-
# Connectors:
7-
- `flange`: 1-dim. translational flange
8-
9-
# Parameters:
10-
- `f`: input force
11-
"""
12-
@mtkmodel ConstantForce begin
13-
@parameters begin
14-
f = 0
15-
end
16-
@components begin
17-
flange = MechanicalPort()
18-
end
19-
@equations begin
20-
# connectors
21-
flange.f ~ -f
22-
end
23-
end
24-
251
"""
262
Force(; name)
273

0 commit comments

Comments
 (0)