Skip to content

Commit 79cc603

Browse files
Merge pull request #784 from SciML/ChrisRackauckas-patch-1
Update nonautonomous_linear_ode.md to use in-place update functions
2 parents a93797e + b7d70f2 commit 79cc603

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/src/solvers/nonautonomous_linear_ode.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function update_func(A, u, p, t)
107107
A[1, 2] = -sin(t)
108108
A[2, 2] = cos(t)
109109
end
110-
A = SciMLOperators.MatrixOperator(ones(2, 2), update_func = update_func)
110+
A = SciMLOperators.MatrixOperator(ones(2, 2), update_func! = update_func)
111111
prob = ODEProblem(A, ones(2), (1.0, 6.0))
112112
sol = solve(prob, MagnusGL6(), dt = 1 / 10)
113113
```
@@ -137,7 +137,7 @@ function update_func(A, u, p, t)
137137
A[1, 2] = -1
138138
A[2, 2] = 0
139139
end
140-
A = SciMLOperators.MatrixOperator(ones(2, 2), update_func = update_func)
140+
A = SciMLOperators.MatrixOperator(ones(2, 2), update_func! = update_func)
141141
prob = ODEProblem(A, ones(2), (0, 30.0))
142142
sol = solve(prob, LieRK4(), dt = 1 / 4)
143143
```
@@ -156,7 +156,7 @@ function update_func(A, u, p, t)
156156
A[1, 2] = -2 * (1 - cos(u[2]) - u[2] * sin(u[2]))
157157
A[2, 2] = 0
158158
end
159-
A = SciMLOperators.MatrixOperator(ones(2, 2), update_func = update_func)
159+
A = SciMLOperators.MatrixOperator(ones(2, 2), update_func! = update_func)
160160
prob = ODEProblem(A, ones(2), (30, 150.0))
161161
sol = solve(prob, MagnusAdapt4())
162162
```

0 commit comments

Comments
 (0)