Skip to content

Commit ce0533f

Browse files
fix: handle case when u0 === nothing in linearization_function
1 parent 4eee373 commit ce0533f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/linearization.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ function linearization_function(sys::AbstractSystem, inputs,
7979
abstol = initialization_abstol, reltol = initialization_reltol,
8080
nlsolve_alg = initialization_solver_alg)
8181
lin_fun = LinearizationFunction(
82-
diff_idxs, alge_idxs, input_idxs, length(unknowns(sys)), prob, h, similar(u0),
82+
diff_idxs, alge_idxs, input_idxs, length(unknowns(sys)),
83+
prob, h, u0 === nothing ? nothing : similar(u0),
8384
ForwardDiff.Chunk(input_idxs), initializealg, initialization_kwargs)
8485
return lin_fun, sys
8586
end

0 commit comments

Comments
 (0)