Skip to content

Commit b51ba0c

Browse files
Adds meta data
fix initial value Adds initial values Revert change Makes amplitude smaller
1 parent c9af29e commit b51ba0c

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/Blocks/utils.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
@connector function RealInput(;name, nin=1, u_start=nin > 1 ? zeros(nin) : 0.0)
22
if nin == 1
3-
@variables u(t) = u_start
3+
@variables u(t) = u_start [input=true]
44
else
5-
@variables u[1:nin](t) = u_start
5+
@variables u[1:nin](t) = u_start [input=true]
66
u = collect(u)
77
end
88
ODESystem(Equation[], t, [u...], []; name=name)
@@ -22,9 +22,9 @@ Connector with one input signal of type Real.
2222

2323
@connector function RealOutput(;name, nout=1, u_start=nout > 1 ? zeros(nout) : 0.0)
2424
if nout == 1
25-
@variables u(t) = u_start
25+
@variables u(t) = u_start [output=true]
2626
else
27-
@variables u[1:nout](t) = u_start
27+
@variables u[1:nout](t) = u_start [output=true]
2828
u = collect(u)
2929
end
3030
ODESystem(Equation[], t, [u...], []; name=name)
@@ -88,4 +88,4 @@ function MIMO(;name, nin=1, nout=1, u_start=zeros(nin), y_start=zeros(nout))
8888
[y[i] ~ output.u[i] for i in 1:nout]...,
8989
]
9090
return ODESystem(eqs, t, vcat(u..., y...), []; name=name, systems=[input, output])
91-
end
91+
end

src/Thermal/HeatTransfer/ideal_components.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function HeatCapacitor(; name, C, T_start=273.15 + 20)
1616
@parameters C=C
1717
sts = @variables begin
1818
T(t)=T_start
19-
der_T(t)
19+
der_T(t)=0.0
2020
end
2121

2222
D = Differential(t)
@@ -81,7 +81,7 @@ function ConvectiveConductor(; name, G)
8181
@named solid = HeatPort()
8282
@named fluid = HeatPort()
8383
@parameters G=G
84-
sts = @variables Q_flow(t) dT(t)
84+
sts = @variables Q_flow(t)=0.0 dT(t)=0.0
8585
eqs = [
8686
dT ~ solid.T - fluid.T
8787
solid.Q_flow ~ Q_flow
@@ -107,7 +107,7 @@ function ConvectiveResistor(; name, R)
107107
@named solidport = HeatPort()
108108
@named fluidport = HeatPort()
109109
@parameters R=R
110-
sts = @variables Q_flow(t) dT(t)
110+
sts = @variables Q_flow(t)=0.0 dT(t)=0.0
111111
eqs = [
112112
dT ~ solidport.T - fluidport.T
113113
solidport.Q_flow ~ Q_flow

test/Blocks/math.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ end
207207

208208
@testset "Math" begin
209209
for (block, func) in [(Abs, abs), (Sign, sign), (Sin, sin), (Cos, cos), (Tan, tan), (Asin, asin), (Acos, acos), (Atan, atan), (Sinh, sinh), (Cosh, cosh), (Tanh, tanh), (Exp, exp)]
210-
@named source = Sine(frequency=1)
210+
@named source = Sine(frequency=1, amplitude=0.5)
211211
@named b = block()
212212
@named int = Integrator()
213213
@named model = ODESystem([connect(source.output, b.input), connect(b.output, int.input)], t, systems=[int, b, source])

0 commit comments

Comments
 (0)