How to solve 1D PDE's of 2nd order using PDE Toolbox (solvepde)? Or should I use pdepe (or another function) instead?

4 ビュー (過去 30 日間)
I need to solve following equations:
Poisson equation in 1D:
d^2 fi / dx^2 = -rho(x), where rho is an array of values for each node on grid.
Equation in 1D:
d^2 A / dx^2 + mu(x)*A = -F(x), where mu and F are arrays of values for each node on grid.
Every example I found for these cases are either 2D and 3D or considering rho, mu and F as constant values. My problem is to find potentials on grid, knowing rho, mu and f on this grid.
Or maybe I simply using wrong function for this problem?
Don't hesitate to ask clarifying questions.
Thanks in advance!

回答 (1 件)

Ravi Kumar
Ravi Kumar 2018 年 2 月 14 日
I think pdepe should work for you. Check out the Example 2 in the documentation page. Note that in this example, source term, F, is not constant as in your case.

Community Treasure Hunt

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

Start Hunting!

Translated by