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

3 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by