ODE with BVP problem (getting an error I do not understand)

25 ビュー (過去 30 日間)
Joe
Joe 2013 年 8 月 11 日
Hello I'm having trouble with a BVP question.
My code is:
function [x2,u2] = Problem3()
function dxdz = odeRHS(z,Z)
dxdz = [Z(2); Z(3); Z(4); (z-z^2)];
end
function bc = odeBCs(za,zb)
bc = [ za(1) za(2) zb(1) zb(4) - 0.8 ] end
solinit = bvpinit(0,0); %used bvp4c to solve the BVP Z = bvp4c(@odeRHS,@odeBCs,solinit); u2=Z.y(1,:) x2=Z.x
plot(x2, u2, 'g', 'LineWidth', 2) grid on
I keep getting these errors though.
Error using bvpinit (line 73) The entries of x must satisfy a = x(1) ~= x(end) = b.
Error in Problem3 (line 17) solinit = bvpinit(0,0);
Any help would be greatly appreciated !!

回答 (0 件)

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by