bvp4c error

26 ビュー (過去 30 日間)
Binod Pant
Binod Pant 2020 年 3 月 6 日
編集済み: Binod Pant 2020 年 3 月 6 日
.

回答 (2 件)

darova
darova 2020 年 3 月 6 日
I changed timespan
solinit = bvpinit([0,0.1],[1,1]);

Stephan
Stephan 2020 年 3 月 6 日
編集済み: Stephan 2020 年 3 月 6 日
In your case bvp5c is suitable to solve your problem, without changing the timespan:
solinit = bvpinit([0,1],[0,0]);
sol = bvp5c(@deriv,@bcs,solinit);
plot(sol.x,sol.y(1,:),'-r');
function dYdx = deriv(~,Y)
dYdx(1) = Y(2);
dYdx(2) = (Y(2)-exp(Y(1)))*100;
end
%boundary conditions y(a) = -1 and y(b) = 0
function res = bcs(ya,yb)
res = [ ya(1) + 1; yb(1) - 0];
end

カテゴリ

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