Skip to content

Commit 0fd0b28

Browse files
committed
Negate the W operator
1 parent f69674e commit 0fd0b28

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/systems/diffeqs/diffeqsystem.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,14 @@ function generate_factorized_W(sys::ODESystem, simplify=true; version::FunctionV
126126

127127
gam = Variable(:gam; known = true)()
128128

129-
W = LinearAlgebra.I - gam*jac
129+
W = - LinearAlgebra.I + gam*jac
130130
Wfact = lu(W, Val(false), check=false).factors
131131

132132
if simplify
133133
Wfact = simplify_constants.(Wfact)
134134
end
135135

136-
W_t = LinearAlgebra.I/gam - jac
136+
W_t = - LinearAlgebra.I/gam + jac
137137
Wfact_t = lu(W_t, Val(false), check=false).factors
138138
if simplify
139139
Wfact_t = simplify_constants.(Wfact_t)

test/system_construction.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ Sfw = fw(u, p, 0.2, 0.1)
6262
@test Sfw.U UpperTriangular(FW)
6363
sol = Sfw \ @SArray ones(3)
6464
@test sol isa SArray
65-
@test sol (I - 0.2*J)\ones(3)
65+
@test sol -(I - 0.2*J)\ones(3)
6666
Sfw_t = fwt(u, p, 0.2, 0.1)
6767
@test Sfw_t.L UnitLowerTriangular(FWt)
6868
@test Sfw_t.U UpperTriangular(FWt)
6969
sol = Sfw_t \ @SArray ones(3)
7070
@test sol isa SArray
71-
@test sol (I/0.2 - J)\ones(3)
71+
@test sol -(I/0.2 - J)\ones(3)
7272

7373
@testset "time-varying parameters" begin
7474
@parameters σ′(t-1)

0 commit comments

Comments
 (0)