ODE with BVP problem (getting an error I do not understand)
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Numerical Integration and Differential Equations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!