Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix boundary point in Laplace in a strip tests #927

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading