Skip to content

Commit 2ba73c6

Browse files
authored
Merge pull request #744 from control-toolbox/auto-juliaformatter-pr
[AUTO] JuliaFormatter.jl run
2 parents c7b0ea4 + dc8cf2a commit 2ba73c6

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

test/suite/reexport/test_ctflows.jl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ function test_ctflows()
373373
t0 = 0
374374
tf = 1
375375
x0 = 1.0
376-
376+
377377
ocp = @def begin
378378
λ R, variable
379379
t [t0, tf], time
@@ -382,10 +382,10 @@ function test_ctflows()
382382
(t) == λ * x(t)
383383
(x(t)^2) min
384384
end
385-
385+
386386
# Test: Flow(ocp) works for control-free problems
387387
f = Flow(ocp)
388-
388+
389389
# Test: basic call returns 2 values (state, costate)
390390
λ_val = 0.5
391391
p0 = 1.0
@@ -400,7 +400,7 @@ function test_ctflows()
400400
t0 = 0
401401
tf = 1
402402
x0 = 1.0
403-
403+
404404
ocp = @def begin
405405
λ R, variable
406406
t [t0, tf], time
@@ -409,11 +409,11 @@ function test_ctflows()
409409
(t) == λ * x(t)
410410
(x(t)^2) min
411411
end
412-
412+
413413
f = Flow(ocp)
414414
λ_val = 0.5
415415
p0 = 1.0
416-
416+
417417
# Test: augment=true returns 3 values (state, costate, variable costate)
418418
xf, pf, pλ = f(t0, x0, p0, tf, λ_val; augment=true)
419419
Test.@test xf isa Real
@@ -428,7 +428,7 @@ function test_ctflows()
428428
x0 = 1.0
429429
λ_val = 0.5
430430
p0 = 1.0
431-
431+
432432
ocp = @def begin
433433
λ R, variable
434434
t [t0, tf], time
@@ -437,7 +437,7 @@ function test_ctflows()
437437
(t) == λ * x(t)
438438
(x(t)^2) min
439439
end
440-
440+
441441
# Manual Hamiltonian construction
442442
H(x, p, λ) = p * λ * x - x^2
443443
function H_aug(x_, p_)
@@ -446,14 +446,14 @@ function test_ctflows()
446446
return H(x, p, λ)
447447
end
448448
f_manual = Flow(OptimalControl.Hamiltonian(H_aug))
449-
449+
450450
# Automatic Flow from OCP
451451
f_auto = Flow(ocp)
452-
452+
453453
# Test: both give similar results
454454
xf_manual, pf_manual = f_manual(t0, [x0, λ_val], [p0, 0.0], tf)
455455
xf_auto, pf_auto = f_auto(t0, x0, p0, tf, λ_val)
456-
456+
457457
Test.@test xf_manual[1] xf_auto rtol=1e-6
458458
Test.@test pf_manual[1] pf_auto rtol=1e-6
459459
end
@@ -463,7 +463,7 @@ function test_ctflows()
463463
t0 = 0
464464
tf = 1
465465
x0 = 1.0
466-
466+
467467
ocp = @def begin
468468
λ R, variable
469469
t [t0, tf], time
@@ -472,11 +472,11 @@ function test_ctflows()
472472
(t) == λ * x(t)
473473
(x(t)^2) min
474474
end
475-
475+
476476
f = Flow(ocp)
477477
λ_zero = 0.0
478478
p0 = 1.0
479-
479+
480480
xf, pf = f(t0, x0, p0, tf, λ_zero)
481481
Test.@test xf x0 rtol=1e-10 # x remains constant
482482
end

0 commit comments

Comments
 (0)