Skip to content

Commit f88861c

Browse files
committed
test: add test for BSplineInterpolation
1 parent b453a88 commit f88861c

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

test/Blocks/sources.jl

+24-8
Original file line numberDiff line numberDiff line change
@@ -480,16 +480,32 @@ end
480480
@testset "ParametrizedInterpolation" begin
481481
@variables y(t) = 0
482482
@parameters u[1:15] = rand(15)
483-
@parameters x[1:15] = 0:14
483+
@parameters x[1:15] = 0:14.0
484484

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

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

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

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

0 commit comments

Comments
 (0)