diff --git a/examples/NonlinearBVP1.jl b/examples/NonlinearBVP1.jl index 0d0c365cb..df65e6aed 100644 --- a/examples/NonlinearBVP1.jl +++ b/examples/NonlinearBVP1.jl @@ -3,18 +3,18 @@ using LinearAlgebra # Define the vector that collates the differential equation and # the boundary conditions -N(u, x = Fun()) = [u(-1.)-1., u(1.)+0.5, 0.001u'' + 6(1-x^2)u' + u^2 - 1]; +N1(u, x = Fun()) = [u(-1.)-1., u(1.)+0.5, 0.001u'' + 6(1-x^2)u' + u^2 - 1]; # Solve the equation using Newton iteration function nbvpsolver() x = Fun() u0 = 0 * x # starting value - newton(N, u0) + newton(N1, u0) end u = nbvpsolver(); #src # We verify that the solution satisfies the differential equation and the boundary conditions using Test #src -@test norm(N(u)) ≤ 1000eps() #src +@test norm(N1(u)) ≤ 1000eps() #src diff --git a/examples/NonlinearBVP2.jl b/examples/NonlinearBVP2.jl index b7cbdd0b3..7dc24b67f 100644 --- a/examples/NonlinearBVP2.jl +++ b/examples/NonlinearBVP2.jl @@ -4,7 +4,7 @@ using ApproxFun using LinearAlgebra -N(u1, u2) = [u1'(0) - 0.5*u1(0)*u2(0); +N2(u1, u2) = [u1'(0) - 0.5*u1(0)*u2(0); u2'(0) + 1; u1(1) - 1; u2(1) - 1; @@ -15,6 +15,6 @@ function nbvpsolver2() x = Fun(0..1) u10 = one(x) u20 = one(x) - newton(N, [u10,u20]) + newton(N2, [u10,u20]) end u1,u2 = nbvpsolver2(); diff --git a/test/runtests.jl b/test/runtests.jl index a96d13c82..472fe57a5 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -93,7 +93,7 @@ end b = rangespace(A) @test Fun(component(v[1],1), component(b[1],1))(0.1,-1.0) ≈ v(0.1,-1.0)[1] - @test Fun(component(v[1],2), component(b[1],2))(0.1,-1.0) ≈ v(0.1,-1.0)[1] + @test Fun(component(v[1],2), component(b[1],2))(0.1,1.0) ≈ v(0.1,1.0)[1] @test ApproxFun.default_Fun(v[1] , b[1])(0.1,1.0) ≈ v(0.1,1.0)[1] end