Solve BVP with Arrays as Coefficients

조회 수: 2 (최근 30일)
Paul Safier
Paul Safier 2025년 5월 9일
편집: Torsten 2025년 5월 9일
Can bvp4c and/or bvp5c be used to solve a boundary value problem where the coefficients (or terms) of the BVP are provided by an array, versus symbolic (e.g. x, x^2,...)?
For example, I need to solve:
y'' + a*y' + b*y = f. where, say x, is defined between 0 and 1. A, b and f are vectors/arrays at certain values of x. Can Matlab's BVP solvers interpolate these arrays as needed?
Thanks!

채택된 답변

Torsten
Torsten 2025년 5월 9일
편집: Torsten 2025년 5월 9일
If you have functions depending on x for a, b and f, you are done.
If not, you can try the following:
Use "interp1" to interpolate a, b and f in the x-value where the coefficients are needed by bvp4c.
Or fit functions to a, b and f with x as independent variable before calling bvp4c and use these function to supply a, b and f at the relevant x-positions.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Boundary Value Problems에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by