We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7450590 commit b2a2316Copy full SHA for b2a2316
test/misc/linsolve_switching_tests.jl
@@ -0,0 +1,28 @@
1
+@testitem "Singular Systems -- Auto Linear Solve Switching" begin
2
+ using LinearSolve, NonlinearSolve
3
+
4
+ function f!(du, u, p)
5
+ du[1] = 2u[1] - 2
6
+ du[2] = (u[1] - 4u[2])^2 + 0.1
7
+ end
8
9
+ u0 = [0.0, 0.0] # Singular Jacobian at u0
10
11
+ prob = NonlinearProblem(f!, u0)
12
13
+ sol = solve(prob) # This doesn't have a root so let's just test the switching
14
+ @test sol.u≈[1.0, 0.25] atol=1e-3 rtol=1e-3
15
16
+ function nlls!(du, u, p)
17
18
19
+ du[3] = 0
20
21
22
+ u0 = [0.0, 0.0]
23
24
+ prob = NonlinearProblem(NonlinearFunction(nlls!, resid_prototype = zeros(3)), u0)
25
26
+ solve(prob)
27
28
+end
0 commit comments