I have a coupled second order DE; how to solve them with boundary conditions; How to get get F1 and F2
조회 수: 2 (최근 30일)
이전 댓글 표시
equation 1: d^2f1/dx^2-Q/K1*F1+P/K1=0
equation 2 d^2f2/dx^2-Q/K1*F2+P/K2=0 Boundary conditions F1(0)=0 F2(l)=P F1(l-u)=F2(l-u) dF1/dx(l-u)=dF2/dx(l-u) PS All variables l, u, P,Q and K1 are known
댓글 수: 0
답변 (1개)
Torsten
2017년 9월 28일
Use "bvp4c" with the "multipoint boundary value problem" facility:
https://de.mathworks.com/help/matlab/ref/bvp4c.html#bt5uooc-23
https://de.mathworks.com/help/matlab/math/boundary-value-problems.html#brfhdsd-1
Best wishes
Torsten.
댓글 수: 2
Torsten
2017년 10월 2일
편집: Torsten
2017년 10월 2일
function dydx = f(x,y,region)
P = ...;
Q = ...;
K1 = ...;
K2 = ...;
dydx = zeros(2,1);
dydx(1) = y(2);
% The definition of dydx(2) depends on the region.
switch region
case 1 % x in [0 l-u]
dydx(2) = y(1)*Q/K1-P/K1
case 2 % x in [l-u l]
dydx(2) = y(1)*Q/K1-P/K2;
end
function res = bc(YL,YR)
P=...;
res = [YL(1,1) % y(0) = 0
YR(1,1) - YL(1,2) % Continuity of F(x) at x=l-u
YR(2,1) - YL(2,2) % Continuity of dF/dx at x=l-u
YR(1,end) - P]; % y(l) = P
You should be able to add initial conditions and call "bvp4c" following the example in my above link.
Of course, you will have to give values to the parameters used in the function routines.
Best wishes
Torsten.
참고 항목
카테고리
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!