We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a9ac36 commit e037aecCopy full SHA for e037aec
test/Blocks/math.jl
@@ -157,6 +157,25 @@ end
157
@test sol[prod.output.u] ≈ 2 * sin.(2 * pi * sol.t)
158
end
159
160
+@testset "Power" begin
161
+ @named c1 = Constant(; k = 2)
162
+ @named c2 = Constant(; k = 2)
163
+ @named pow = Power(;)
164
+ @named model = ODESystem(
165
+ [
166
+ connect(c1.output, pow.input1),
167
+ connect(c2.output, pow.input2)
168
+ ],
169
+ t,
170
+ systems = [pow, c1, c2])
171
+ sys = structural_simplify(model)
172
+ prob = ODEProblem(sys, [], (0.0, 1.0))
173
+ sol = solve(prob, Rodas4())
174
+ @test isequal(unbound_inputs(sys), [])
175
+ @test sol.retcode == Success
176
+ @test sol[pow.output.u] ≈ 4
177
+end
178
+
179
@testset "Division" begin
180
@named c1 = Sine(; frequency = 1)
181
@named c2 = Constant(; k = 2)
0 commit comments