Updating of boundary condition during bvp4c solution procedure

5 ビュー (過去 30 日間)
Eric Roden
Eric Roden 2023 年 5 月 10 日
コメント済み: Eric Roden 2023 年 5 月 11 日
Dear colleagues:
I am solving the Poisson-Boltzmann equation, a non-linear elliptical PDE which describes the distribution of electric potential (psi) in the vicinity of a charged surface, as a boundary value problem using bvp4c. For this problem, psi is the primary dependent variable being solved for as a function of distance away from the charged surface. One of the boundary conditions is surface charge density (sigp), which is itself dependent on the electric potential at the surface, i.e. sigp is dependent (in a non-linear way) on the value of psi at x = 0. Thus I need to update the surface charge density (sigp) boundary condition dynamically during the solution, based on the current value for psi at x = 0. A few basic questions are:
1. Would I do the calculation to update sigp within the bvpfcn or the bcfcn routine
2. How do I go about getting a hold of the value for psi at x = 0
3. How do I go about passing the updated boundary condition value back to the solution routine?
I'm guessing this is going to involve use of the "Unknown Parameters" facility in bvp4c, but exactly how to implement this is not clear.
Thanks in advance for any help anyone can provide.
Kind regards, Eric
Eric Roden, University of Wisconsin-Madison, Department of Geoscience

採用された回答

Torsten
Torsten 2023 年 5 月 10 日
In bvp4c, your boundary conditions at xl = xstart and xr = xend can take the form fl(xl,psil) = 0 and fr(xr,psir) = 0 where fl and fr can be nonlinear functions of the value of psi at x = xl (named ul in the example codes) or x = xr (named ur in the example codes).
Thus it should be no problem to specify the surface charge density (sigp) if you know how it depends on the (given) value of psi. Here I assume you want to make sigp depend on the value of psi on the same side of your integration interval [xl xr]. Thus cases like fl(xl,psir) = 0 or fr(xr,psil) = 0 should be excluded, I guess.
  1 件のコメント
Eric Roden
Eric Roden 2023 年 5 月 11 日
Thank you, Torsten, this worked perfectly. Much appreciated.

サインインしてコメントする。

その他の回答 (0 件)

製品


リリース

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by