Skip to content

Commit bbbbb3f

Browse files
committed
test: add test for BSplineInterpolation
1 parent 5e953a7 commit bbbbb3f

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

test/Blocks/sources.jl

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -481,16 +481,32 @@ end
481481
@testset "ParametrizedInterpolation" begin
482482
@variables y(t) = 0
483483
@parameters u[1:15] = rand(15)
484-
@parameters x[1:15] = 0:14
484+
@parameters x[1:15] = 0:14.0
485485

486-
@named i = ParametrizedInterpolation(LinearInterpolation, u, x)
487-
eqs = [D(y) ~ i.output.u]
486+
@testset "LinearInterpolation" begin
487+
@named i = ParametrizedInterpolation(LinearInterpolation, u, x)
488+
eqs = [D(y) ~ i.output.u]
488489

489-
@named model = ODESystem(eqs, t, systems = [i])
490-
sys = structural_simplify(model)
490+
@named model = ODESystem(eqs, t, systems = [i])
491+
sys = structural_simplify(model)
491492

492-
prob = ODEProblem(sys, [], (0.0, 4))
493-
sol = solve(prob)
493+
prob = ODEProblem(sys, [], (0.0, 4))
494+
sol = solve(prob)
494495

495-
@test SciMLBase.successful_retcode(sol)
496+
@test SciMLBase.successful_retcode(sol)
497+
end
498+
499+
@testset "BSplineInterpolation" begin
500+
@named i = ParametrizedInterpolation(
501+
BSplineInterpolation, u, x, 3, :Uniform, :Uniform)
502+
eqs = [D(y) ~ i.output.u]
503+
504+
@named model = ODESystem(eqs, t, systems = [i])
505+
sys = structural_simplify(model)
506+
507+
prob = ODEProblem(sys, [], (0.0, 4))
508+
sol = solve(prob)
509+
510+
@test SciMLBase.successful_retcode(sol)
511+
end
496512
end

0 commit comments

Comments
 (0)