Soling a boundary value problem
조회 수: 12 (최근 30일)
이전 댓글 표시
I am trying to solve the following elliptic equation

on the interval [0,1] with Neumann Boundary condition,
I want to get a positive solution φ with the maximum of φ is 1.
I want to get a positive solution φ with the maximum of φ is 1.The following is the code I am using
h=0.001;
L=1;
M=L/h;
x=linspace(0,L,M+1);
gamma = @(x)(1+0.1*sin(2*pi*x)).*(1+0.1*sin(2*pi*x));
beta=@(x)(1+0.1*sin(2*pi*x));
%v0 = @(x)(1+0.5*cos(pi*x));
%v0x=@(x)-0.5*pi*sin(pi*x);
bvpfcn = @(x,v)[v(2);(gamma(x)-(beta(x)).*v(1)];
bcfcn = @(va,vb)[va(2);vb(2)];
guess = @(x)[1;0];
%guess = @(x)[v0(x);v0x(x)];
solinit = bvpinit(x,guess);
sol = bvp4c(bvpfcn, bcfcn, solinit);
phi1=sol.y(1,:);
M=max(phi1);
phi=phi1/M;
plot(sol.x,phi)
I have difficulity in selecting the initial function. I tried [1;0] and [v0(x);v0x(x)] which is defined above, I got different solutions. I cannot figure out the problem. Any help would be appreciated!
댓글 수: 0
답변 (1개)
Torsten
2024년 2월 3일
편집: Torsten
2024년 2월 3일
Prove the following:
If u is a solution of your differential equation, so is c*u for every c in IR.
So it does not surprise that bvp4c gives different solutions dependent on your initial guess: the solution is not unique.
If you normalize the solution as you did after solving, it seems it becomes unique. You can see this if you solve your equation for your two initial guess functions and plot the solutions in one graph.
댓글 수: 8
Torsten
2024년 2월 3일
편집: Torsten
2024년 2월 3일
It seems that bvp4c as a numerical solver always converges to the trivial solution phi = 0.
I tried "dsolve", but it is unable to find an analytical solution (s.b.).
I'm still interested in your source that the equation has a solution different from 0.
syms x y(x)
eqn = diff(y,x,2)-((1+0.1*sin(2*pi*x))^2-(1+0.1*sin(2*pi*x)))*y==0
dsolve(eqn)
참고 항목
카테고리
Help Center 및 File Exchange에서 Boundary Value Problems에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

