Skip to content

Commit 602c9ca

Browse files
test: reduce step size for CS FMUs in test
1 parent 5ecf4fd commit 602c9ca

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/fmi/fmi.jl

+7-7
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const FMU_DIR = joinpath(@__DIR__, "fmus")
3232
@testset "v2, CS" begin
3333
fmu = loadFMU("SpringPendulum1D", "Dymola", "2022x"; type = :CS)
3434
@named inner = MTK.FMIComponent(
35-
Val(2); fmu, communication_step_size = 0.001, type = :CS)
35+
Val(2); fmu, communication_step_size = 1e-5, type = :CS)
3636
@variables x(t) = 1.0
3737
@mtkbuild sys = ODESystem([D(x) ~ x], t; systems = [inner])
3838
test_no_inputs_outputs(sys)
@@ -66,7 +66,7 @@ const FMU_DIR = joinpath(@__DIR__, "fmus")
6666
@testset "v3, CS" begin
6767
fmu = loadFMU("SpringPendulum1D", "Dymola", "2023x", "3.0"; type = :CS)
6868
@named inner = MTK.FMIComponent(
69-
Val(3); fmu, communication_step_size = 0.001, type = :CS)
69+
Val(3); fmu, communication_step_size = 1e-5, type = :CS)
7070
@variables x(t) = 1.0
7171
@mtkbuild sys = ODESystem([D(x) ~ x], t; systems = [inner])
7272
test_no_inputs_outputs(sys)
@@ -210,7 +210,7 @@ end
210210
@testset "v3, CS" begin
211211
fmu = loadFMU(joinpath(FMU_DIR, "StateSpace.fmu"); type = :CS)
212212
@named sspace = MTK.FMIComponent(
213-
Val(3); fmu, communication_step_size = 1e-4, type = :CS,
213+
Val(3); fmu, communication_step_size = 1e-6, type = :CS,
214214
reinitializealg = BrownFullBasicInit())
215215
@test MTK.isinput(sspace.u)
216216
@test MTK.isoutput(sspace.y)
@@ -259,9 +259,9 @@ end
259259
@testset "v2, CS" begin
260260
fmu = loadFMU(joinpath(FMU_DIR, "SimpleAdder.fmu"); type = :CS)
261261
@named adder1 = MTK.FMIComponent(
262-
Val(2); fmu, type = :CS, communication_step_size = 1e-3)
262+
Val(2); fmu, type = :CS, communication_step_size = 1e-5)
263263
@named adder2 = MTK.FMIComponent(
264-
Val(2); fmu, type = :CS, communication_step_size = 1e-3)
264+
Val(2); fmu, type = :CS, communication_step_size = 1e-5)
265265
sys, prob = build_looped_adders(adder1, adder2)
266266
sol = solve(prob,
267267
Tsit5();
@@ -300,9 +300,9 @@ end
300300
@testset "v3, CS" begin
301301
fmu = loadFMU(joinpath(FMU_DIR, "StateSpace.fmu"); type = :CS)
302302
@named sspace1 = MTK.FMIComponent(
303-
Val(3); fmu, type = :CS, communication_step_size = 1e-4)
303+
Val(3); fmu, type = :CS, communication_step_size = 1e-5)
304304
@named sspace2 = MTK.FMIComponent(
305-
Val(3); fmu, type = :CS, communication_step_size = 1e-4)
305+
Val(3); fmu, type = :CS, communication_step_size = 1e-5)
306306
sys, prob = build_looped_sspace(sspace1, sspace2)
307307
sol = solve(prob, Rodas5P(autodiff = false); reltol = 1e-8)
308308
@test SciMLBase.successful_retcode(sol)

0 commit comments

Comments
 (0)