Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Why do i receive the following error: a singular Jacobian encountered while using the MATLAB function bvp4c
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I'm trying to solve a system of fifteen first order ordiantry differential equations. When running i receive the following error: Unable to solve the collocation equations -- a singular Jacobian encountered.
I think my error is due to the choosing of the initial values: I'm not sure how to select these.
My code is the following:
solinit = bvpinit(linspace(0,14,15),@init);
sol = bvp4c(@ode,@bc,solinit);
function [dydx] = ode(x,y)
% First order differential equations
% for a simple wire hockling mechanism
% y(1) = x, y(2) = y, y(3) = z, y(4) = d1x, y(5) = d1y, y(6) = d1z,
% y(7) = d3x, y(8) = d3y, y(9) = d3z, y(10) = N1, y(11) = N2
% y(12) = N3, y(13) = M1, y(14) = M2, y(15) = M3
dydx = [y(7)
y(8)
y(9)
y(14)/0.0028*((y(7)*y(6)-y(9)*y(4))*y(6)-(y(7)*y(5)-y(8)*y(4))*y(5))+y(15)/0.0020*(y(8)*y(6)-y(9)*y(5))
y(14)/0.0028*((y(8)*y(6)-y(9)*y(5))*y(6)-(y(7)*y(5)-y(8)*y(4))*y(4))+y(15)/0.0020*(y(7)*y(6)-y(9)*y(4))
y(14)/0.0028*((y(8)*y(6)-y(9)*y(5))*y(5)-(y(7)*y(6)-y(9)*y(4))*y(4))+y(15)/0.0020*(y(7)*y(5)-y(8)*y(4))
y(13)/0.0028*(y(5)*y(9)-y(8)*y(6))+y(14)/0.0028*((y(7)*y(6)-y(9)*y(4))*y(9)-y(8)*(y(7)*y(5)-y(8)*y(4)))
y(13)/0.0028*(y(4)*y(9)-y(7)*y(6))+y(14)/0.0028*((y(8)*y(6)-y(9)*y(5))*y(9)-y(7)*(y(7)*y(5)-y(8)*y(4)))
y(13)/0.0028*(y(4)*y(8)-y(7)*y(5))+y(14)/0.0028*((y(8)*y(6)-y(9)*y(5))*y(8)-y(7)*(y(7)*y(6)-y(9)*y(4)))
y(11)*y(15)/0.0020-y(12)*y(14)/0.0028
y(12)*y(13)/0.0028-y(10)*y(15)/0.0020
y(10)*y(14)/0.0028-y(11)*y(13)/0.0020
y(14)*y(15)/0.0028*(1-0.0028/0.0020)+y(11)
y(13)*y(15)/0.0028*(1-0.0028/0.0020)-y(10)
0];
end
function [res] = bc(ya,yb)
% Boundary conditions are described here
% y(1) = x, y(2) = y, y(3) = z, y(4) = d1x, y(5) = d1y, y(6) = d1z,
% y(7) = d3x, y(8) = d3y, y(9) = d3z, y(10) = N1, y(11) = N2
% y(12) = N3, y(13) = M1, y(14) = M2, y(15) = M3
res = [ya(1)
ya(2)
ya(3)
ya(4)-1
ya(5)
ya(6)
ya(7)
ya(8)
ya(9)-1
yb(1)
yb(2)
yb(3)-(500-10)
yb(4)-cos(0)
yb(7)
yb(8)];
end
function [v] = init(x)
% Guess
v = [0
0
0
1
0
0
0
0
1
1
1
1
1
1
0];
end
My functions are in seperate files, for easy visibility they are shown in a single file here. This should not be the problem.
0 Kommentare
Antworten (0)
Diese Frage ist geschlossen.
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!