Skip to content

Commit 7801a39

Browse files
Merge pull request #26 from ValentinKaisermayer/fix-MTK-v8
Fixes for MTK v8
2 parents 2d7a4e8 + 0efcdbe commit 7801a39

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+3106
-1595
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
1212

1313
[compat]
1414
IfElse = "0.1"
15-
ModelingToolkit = "5.26, 6, 7"
15+
ModelingToolkit = "8"
1616
OffsetArrays = "1"
1717
OrdinaryDiffEq = "5.56, 6"
1818
Symbolics = "0.1, 1, 2, 3, 4"

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ type the name twice. The same principle applies to the other thermal components.
219219
- `C`: heat capacity (zero or positive)
220220

221221
**State**:
222-
- `T`: temperature (in Kelvin)
222+
- `T`: temperature (in kelvin)
223223

224224
**Connectors**:
225225
- heat port
@@ -233,7 +233,7 @@ type the name twice. The same principle applies to the other thermal components.
233233

234234
**States**:
235235
- `Q_flow`: heat flow rate
236-
- `T`: temperature (in Kelvin)
236+
- `T`: temperature (in kelvin)
237237

238238
**Connectors**:
239239
- two heat ports
@@ -249,7 +249,7 @@ type the name twice. The same principle applies to the other thermal components.
249249

250250
**States**:
251251
- `Q_flow`: heat flow rate
252-
- `T`: temperature (in Kelvin)
252+
- `T`: temperature (in kelvin)
253253

254254
**Connectors**:
255255
- two heat ports
@@ -265,7 +265,7 @@ type the name twice. The same principle applies to the other thermal components.
265265

266266
**States**:
267267
- `Q_flow`: heat flow rate
268-
- `dT`: temperature difference (in Kelvin)
268+
- `dT`: temperature difference (in kelvin)
269269

270270
**Connectors**:
271271
- two heat ports (for modeling of the fluid flow over the solid)
@@ -281,7 +281,7 @@ type the name twice. The same principle applies to the other thermal components.
281281

282282
**States**:
283283
- `Q_flow`: heat flow rate
284-
- `dT`: temperature difference (in Kelvin)
284+
- `dT`: temperature difference (in kelvin)
285285

286286
**Connectors**:
287287
- two heat ports (for modeling of the fluid flow over the solid)
@@ -314,7 +314,7 @@ to a singular heatport.
314314

315315
**States**:
316316
- `Q_flow`: heat flow rate
317-
- `T`: temperature (in Kelvin)
317+
- `T`: temperature (in kelvin)
318318

319319
**Connectors**:
320320
- `hp1...hpN`: the respective heatports
@@ -328,10 +328,10 @@ to a singular heatport.
328328

329329
**Function**: `TemperatureSensor(;name)`
330330

331-
**Description**: Ideal absolute temperature sensor which outputs the temperature (in Kelvin) of the connected port.
331+
**Description**: Ideal absolute temperature sensor which outputs the temperature (in kelvin) of the connected port.
332332

333333
**States**:
334-
- `T`: temperature (in Kelvin)
334+
- `T`: temperature (in kelvin)
335335

336336
**Connectors**:
337337
- heat port
@@ -340,10 +340,10 @@ to a singular heatport.
340340

341341
**Function**: `RelativeTemperatureSensor(;name)`
342342

343-
**Description**: The output of the sensor is the relative temperature, i.e., the difference of the two ports, given in Kelvin.
343+
**Description**: The output of the sensor is the relative temperature, i.e., the difference of the two ports, given in kelvin.
344344

345345
**States**:
346-
- `T`: temperature (in Kelvin)
346+
- `T`: temperature (in kelvin)
347347

348348
**Connectors**:
349349
- two heat ports
@@ -380,10 +380,10 @@ to a singular heatport.
380380

381381
**Function**: `FixedTemperature(;name, T = 0.0)`
382382

383-
**Description**: The model defines a fixed temperature (in Kelvin) at a given port.
383+
**Description**: The model defines a fixed temperature (in kelvin) at a given port.
384384

385385
**Observables**:
386-
- `T`: temperature (in Kelvin)
386+
- `T`: temperature (in kelvin)
387387

388388
**Connectors**:
389389
- heat port

src/Blocks/Blocks.jl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
"""
22
The module `Blocks` contains common input-output components, referred to as blocks.
3-
4-
In general, input-output blocks follow the convention
5-
```
6-
┌───────────┐
7-
u │ ẋ=f(x,u) │ y
8-
────►│ y=g(x,u) ├────►
9-
│ │
10-
└───────────┘
11-
```
12-
where `u` are inputs, `x` are state variables and `y` are outputs. `x,u,y` are all implemented as `@variables` internally, `u` are marked as `[input=true]` and `y` are marked `[output=true]`.
133
"""
144
module Blocks
155
using ModelingToolkit, Symbolics, IfElse, OrdinaryDiffEq
6+
using IfElse: ifelse
167

178
@parameters t
18-
Dₜ = Differential(t)
9+
D = Differential(t)
10+
11+
export RealInput, RealOutput, SISO
12+
include("utils.jl")
1913

20-
export Gain, Sum
14+
export Gain, Sum, MatrixGain, Sum, Feedback, Add, Product, Division
15+
export Abs, Sign, Sqrt, Sin, Cos, Tan, Asin, Acos, Atan, Atan2, Sinh, Cosh, Tanh, Exp
16+
export Log, Log10
2117
include("math.jl")
2218

23-
export Saturation, DeadZone
19+
export Constant, Sine, Cosine, ContinuousClock, Ramp, Step, ExpSine
20+
include("sources.jl")
21+
22+
export Limiter, DeadZone, SlewRateLimiter
2423
include("nonlinear.jl")
2524

26-
export Constant, Integrator, Derivative, FirstOrder, SecondOrder, PID, StateSpace
25+
export Integrator, Derivative, FirstOrder, SecondOrder, StateSpace
26+
export PI, LimPI, PID, LimPID
2727
include("continuous.jl")
2828

2929
end

0 commit comments

Comments
 (0)