@@ -47,16 +47,16 @@ lsys, ssys = linearize(sys, r, r) # Test allow scalars
47
47
```
48
48
49
49
function plant (; name)
50
- @variables x (t) = 1
51
- @variables u (t)= 0 y (t)= 0
50
+ @variables x (t)
51
+ @variables u (t) y (t)
52
52
D = Differential (t)
53
53
eqs = [D (x) ~ - x + u
54
54
y ~ x]
55
55
ODESystem (eqs, t; name = name)
56
56
end
57
57
58
58
function filt_ (; name)
59
- @variables x (t)= 0 y (t)= 0
59
+ @variables x (t) y (t)
60
60
@variables u (t)= 0 [input = true ]
61
61
D = Differential (t)
62
62
eqs = [D (x) ~ - 2 * x + u
@@ -65,7 +65,7 @@ function filt_(; name)
65
65
end
66
66
67
67
function controller (kp; name)
68
- @variables y (t)= 0 r (t)= 0 u (t)= 0
68
+ @variables y (t)= 0 r (t)= 0 u (t)
69
69
@parameters kp = kp
70
70
eqs = [
71
71
u ~ kp * (r - y)
@@ -108,7 +108,8 @@ Nd = 10
108
108
@named pid = LimPID (; k, Ti, Td, Nd)
109
109
110
110
@unpack reference, measurement, ctr_output = pid
111
- lsys0, ssys = linearize (pid, [reference. u, measurement. u], [ctr_output. u])
111
+ lsys0, ssys = linearize (pid, [reference. u, measurement. u], [ctr_output. u];
112
+ op = Dict (reference. u => 0.0 , measurement. u => 0.0 ))
112
113
@unpack int, der = pid
113
114
desired_order = [int. x, der. x]
114
115
lsys = ModelingToolkit. reorder_unknowns (lsys0, unknowns (ssys), desired_order)
@@ -314,7 +315,7 @@ matrices = linfun([1.0], Dict(p => 3.0), 1.0)
314
315
end
315
316
316
317
@testset " Issue #2941" begin
317
- @variables x (t) y (t)
318
+ @variables x (t) y (t) [guess = 1.0 ]
318
319
@parameters p
319
320
eqs = [0 ~ x * log (y) - p]
320
321
@named sys = ODESystem (eqs, t; defaults = [p => 1.0 ])
0 commit comments