Skip to content

Commit ba02255

Browse files
committed
debug: do not allow h>1 in OrthogonnalCollocation
1 parent c06273f commit ba02255

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/controller/transcription.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ struct OrthogonalCollocation <: CollocationMethod
186186
function OrthogonalCollocation(
187187
h::Int=0, no::Int=3; f_threads=false, h_threads=false, roots=:gaussradau
188188
)
189+
if !(h == 0 || h == 1)
190+
throw(ArgumentError("h argument must be 0 or 1 for OrthogonalCollocation."))
191+
end
189192
if roots==:gaussradau
190193
x, _ = FastGaussQuadrature.gaussradau(no, COLLOCATION_NODE_TYPE)
191194
# we reverse the nodes to include the τ=1.0 node:

0 commit comments

Comments
 (0)