Skip to content

Commit efecf13

Browse files
committed
test: increase Ts to avoid TIME_LIMIT status
1 parent 9e00982 commit efecf13

2 files changed

Lines changed: 25 additions & 25 deletions

File tree

‎test/2_test_state_estim.jl‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ end
475475
function h_dae!(y, x, a, d, _ )
476476
y[] = 2 * x[] + a[] + 0.1 * d[]
477477
end
478-
dae = NonLinModelDAE(fq_dae!, h_dae!, 100.0, 1, 1, 1, 1, 1; p=[0.01])
478+
dae = NonLinModelDAE(fq_dae!, h_dae!, 1000.0, 1, 1, 1, 1, 1; p=[0.001])
479479
internalmodel9 = InternalModel(dae)
480480

481481
unstablemodel = LinModel(ss(diagm([0.5, -0.5, 1.5]), ones(3,1), I, 0, 1))
@@ -541,7 +541,7 @@ end
541541
function h_dae!(y, x, a, d, _ )
542542
y[] = 2 * x[] + a[] + 0.1 * d[]
543543
end
544-
dae = NonLinModelDAE(fq_dae!, h_dae!, 100.0, 1, 1, 1, 1, 1; p=[0.01])
544+
dae = NonLinModelDAE(fq_dae!, h_dae!, 1000.0, 1, 1, 1, 1, 1; p=[0.001])
545545
internalmodel5 = InternalModel(dae)
546546
initstate!(internalmodel5, [0], [0], [0])
547547
preparestate!(internalmodel5, [6], [0])
@@ -1099,8 +1099,8 @@ end
10991099
function h!(y, x, a, d, _ )
11001100
y[] = 2 * x[] + a[] + 0.1 * d[]
11011101
end
1102-
p = [0.01]
1103-
dae = NonLinModelDAE(fq!, h!, 100.0, 1, 1, 1, 1, 1; p)
1102+
p = [0.001]
1103+
dae = NonLinModelDAE(fq!, h!, 1000.0, 1, 1, 1, 1, 1; p)
11041104

11051105
transcription = TrapezoidalCollocation()
11061106
mhe = MovingHorizonEstimator(dae; He=3, transcription)
@@ -1377,8 +1377,8 @@ end
13771377
function h!(y, x, d, _ )
13781378
y[] = x[] + 0.1 * d[]
13791379
end
1380-
p = [0.01]
1381-
model = NonLinModel(f!, h!, 100.0, 1, 1, 1, 1; p)
1380+
p = [0.001]
1381+
model = NonLinModel(f!, h!, 1000.0, 1, 1, 1, 1; p)
13821382
transcription = SingleShooting(1)
13831383
mhe_foh = MovingHorizonEstimator(model; He=3, transcription)
13841384
@test mhe_foh.transcription.h == 1
@@ -1429,8 +1429,8 @@ end
14291429
function h!(y, x, d, _ )
14301430
y[] = x[] + 0.1 * d[]
14311431
end
1432-
p = [0.01]
1433-
model = NonLinModel(f!, h!, 100.0, 1, 1, 1, 1; p)
1432+
p = [0.001]
1433+
model = NonLinModel(f!, h!, 1000.0, 1, 1, 1, 1; p)
14341434
transcription = MultipleShooting(1)
14351435
mhe_foh = MovingHorizonEstimator(model; He=3, direct=false, transcription)
14361436
preparestate!(mhe_foh, [0.0], [0.0])
@@ -1524,9 +1524,9 @@ end
15241524
function h!(y, x, a, d, _ )
15251525
y[] = 2 * x[] + a[] + 0.1 * d[]
15261526
end
1527-
p = [0.01]
1527+
p = [0.001]
15281528
as_0, xs_0 = [-1.0], [1.0]
1529-
dae = NonLinModelDAE(fq!, h!, 100.0, 1, 1, 1, 1, 1; p, xs_0, as_0)
1529+
dae = NonLinModelDAE(fq!, h!, 1000.0, 1, 1, 1, 1, 1; p, xs_0, as_0)
15301530

15311531
transcription = TrapezoidalCollocation(f_threads=true, h_threads=false)
15321532
mhe = MovingHorizonEstimator(dae; He=2, transcription, hessian=true)
@@ -1578,9 +1578,9 @@ end
15781578
function h!(y, x, a, d, _ )
15791579
y[] = 2 * x[] + a[] + 0.1 * d[]
15801580
end
1581-
p = [0.01]
1581+
p = [0.001]
15821582
as_0, xs_0 = [-0.01], [0.01]
1583-
dae = NonLinModelDAE(fq!, h!, 100.0, 1, 1, 1, 1, 1; p, xs_0, as_0)
1583+
dae = NonLinModelDAE(fq!, h!, 1000.0, 1, 1, 1, 1, 1; p, xs_0, as_0)
15841584

15851585
no, roots = 3, :gausslegendre
15861586
transcription = OrthogonalCollocation(0, no; roots, f_threads=true, h_threads=false)

‎test/3_test_predictive_control.jl‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -918,8 +918,8 @@ end
918918
function h!(y, x, a, d, _ )
919919
y[] = 2 * x[] + a[] + 0.1 * d[]
920920
end
921-
p = [0.01]
922-
dae = NonLinModelDAE(fq!, h!, 100.0, 1, 1, 1, 1, 1; p)
921+
p = [0.001]
922+
dae = NonLinModelDAE(fq!, h!, 1000.0, 1, 1, 1, 1, 1; p)
923923

924924
transcription = TrapezoidalCollocation()
925925
nmpc = NonLinMPC(dae; He=3, Hp=3, transcription)
@@ -1069,8 +1069,8 @@ end
10691069
function h!(y, x, d, _ )
10701070
y[] = x[] + 0.1 * d[]
10711071
end
1072-
p = [0.01]
1073-
model = NonLinModel(f!, h!, 100.0, 1, 1, 1, 1; p)
1072+
p = [0.001]
1073+
model = NonLinModel(f!, h!, 1000.0, 1, 1, 1, 1; p)
10741074
transcription = SingleShooting(1)
10751075
nmpc_foh = NonLinMPC(model; Hp=5, Hc=1, Nwt=[0], transcription)
10761076
preparestate!(nmpc_foh, [0.0], [0.0])
@@ -1115,8 +1115,8 @@ end
11151115
function h!(y, x, d, _ )
11161116
y[] = x[] + 0.1 * d[]
11171117
end
1118-
p = [0.01]
1119-
model = NonLinModel(f!, h!, 100.0, 1, 1, 1, 1; p)
1118+
p = [0.001]
1119+
model = NonLinModel(f!, h!, 1000.0, 1, 1, 1, 1; p)
11201120
transcription = MultipleShooting(1)
11211121
nmpc_foh = NonLinMPC(model; Hp=5, Hc=1, Nwt=[0], transcription)
11221122
preparestate!(nmpc_foh, [0.0], [0.0])
@@ -1195,9 +1195,9 @@ end
11951195
y[] = x[] + a[] + 0.1 * d[]
11961196
end
11971197
Kp = 2*0.2 # static gain for input, factor 2 since the output is 2*x (a==x)
1198-
p = [0.01]
1198+
p = [0.001]
11991199
as_0, xs_0 = [-1.0], [1.0]
1200-
dae = NonLinModelDAE(fq!, h!, 100.0, 1, 1, 1, 1, 1; p, xs_0, as_0)
1200+
dae = NonLinModelDAE(fq!, h!, 1000.0, 1, 1, 1, 1, 1; p, xs_0, as_0)
12011201

12021202
transcription = TrapezoidalCollocation(f_threads=true, h_threads=false)
12031203
nmpc = NonLinMPC(dae; Hp=100, Hc=1, He=2, Nwt=[0.0], transcription)
@@ -1238,9 +1238,9 @@ end
12381238
y[] = x[] + a[] + 0.1 * d[]
12391239
end
12401240
Kp = 2*0.2 # static gain for input, factor 2 since the output is 2*x (a==x)
1241-
p = [0.01]
1241+
p = [0.001]
12421242
as_0, xs_0 = [-1.0], [1.0]
1243-
dae = NonLinModelDAE(fq!, h!, 100.0, 1, 1, 1, 1, 1; p, xs_0, as_0)
1243+
dae = NonLinModelDAE(fq!, h!, 1000.0, 1, 1, 1, 1, 1; p, xs_0, as_0)
12441244

12451245
no, roots = 3, :gausslegendre
12461246
transcription = OrthogonalCollocation(0, no; roots, f_threads=true, h_threads=false)
@@ -1783,11 +1783,11 @@ end
17831783

17841784
@testitem "All MPCs with move blocking" setup=[SetupMPCtests] begin
17851785
using .SetupMPCtests, ControlSystemsBase, LinearAlgebra
1786-
G = tf( 10, [400, 1])
1787-
linmodel = LinModel(G, 100.0)
1786+
G = tf( 10, [4000, 1])
1787+
linmodel = LinModel(G, 1000.0)
17881788
f = (x, u, _, p) -> p.A * x + p.Bu * u
17891789
h = (x, _, p) -> p.C * x
1790-
nonlinmodel = NonLinModel(f, h, 100.0, 1, 1, 1, p=linmodel, solver=nothing)
1790+
nonlinmodel = NonLinModel(f, h, 1000.0, 1, 1, 1, p=linmodel, solver=nothing)
17911791
Mwt, Nwt, Hp, Hc = [1], [0], 30, [2, 3, 4, 21]
17921792
N = 25
17931793
mpc0 = ExplicitMPC(linmodel; Mwt, Nwt, Hp, Hc)

0 commit comments

Comments
 (0)