Questions about bvp4c solution

2 ビュー (過去 30 日間)
Elia Paini
Elia Paini 2021 年 4 月 26 日
コメント済み: Elia Paini 2021 年 4 月 29 日
Hi, I solved correctly a system of ODE second order with BCs, with the instruction bvp4c.
However, I have some questions about it.
My code is as follows:
...
xmesh = linspace(1e-5,1.5*1e-3,20);
solinit = bvpinit(xmesh,1e-3*[0,0,0,0,1,1,1,1]);
sol = bvp4c(@bvpfcn,@bcs,solinit);
plot(sol.x,sol.y)
1) When I plot the solution, I should choose in x interval sol.x or xmesh? What is their difference?
2) I don't understand how Matlab uses the second vector [0,0,0,0,1,1,1,1] in bvpinit.
It should represent the initial guess of solution (I have 8 variables), but it seems that its values don't change final solution. Is it right?
I've already read Matlab guide about bvp4c, but I have not found these answers.
Thank you!

採用された回答

Shadaab Siddiqie
Shadaab Siddiqie 2021 年 4 月 29 日
From my understanding you have few doutes on the arguments of bvp4c function.
  1. 'bvp4c' function not output 'sol.stats' when 'NMax' is exceeded, This is a due to what the 'stats' object returns. Typically, it has values that are associated with a solved problem, rather than an incomplete one.
  2. solinit are the Initial guess of solution, specified as a structure. Use bvpinit to create solinit. Unlike initial value problems, a boundary value problem can have no solution, a finite number of solutions, or infinitely many solutions. An important part of the process of solving a BVP is providing a guess for the required solution. The quality of this guess can be critical for the solver performance and even for a successful computation. For some guidelines on creating a good initial guess, see Initial Guess of Solution. But it is not nessary for the solution to change if the initial conditions are changed.
  1 件のコメント
Elia Paini
Elia Paini 2021 年 4 月 29 日
Ok, thank you!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeBoundary Value Problems についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by