Skip to content

Commit

Permalink
Fix boundary point in Laplace in a strip tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub committed Feb 2, 2024
1 parent 6a468e5 commit 6a2d3cb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions examples/NonlinearBVP1.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions examples/NonlinearBVP2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 6a2d3cb

Please sign in to comment.