when use 'decic' ,Error using decic>sls (line 168) Try freeing 1 fixed components.Error in decic (line 77) [dy,dyp] = sls(res,dfdy,dfdyp,neq,free_y,free_yp);
Show older comments
syms sita1(t) sita2(t) sita12(t) sita22(t) Q(t) d(t) P(t) Fx(t) Fy(t) afa(t) bata(t) kt ct L1 L2 L3 L4 d0 J1 J2 m2 m1 Pmax Qmax A
eqs = [Q(t)-8.33*0.00001*sin(pi*t)==0;Q(t)-diff(d(t),t)*A==0;P(t)-(Pmax/Qmax)*Q(t)==0;
(d0+d(t))^2-(L1+L2)^2-L3^2-2*L3*(L1+L2)*sin(sita1(t)+sita2(t))==0;
A*P(t)*(L1-L4)*sin(bata(t))-Fx(t)*(L2+L4)*cos(sita1(t))-kt*sita1(t)-ct*diff(sita1(t),t)-Fy(t)*(L2-L4)*sin(sita1(t))-J1*diff(sita12(t),t)==0;
Fx(t)-m2*(-L2*diff(sita1(t),t)^2*sin(sita1(t))+L2*diff(sita12(t),t)*cos(sita1(t)))+A*P(t)*cos(afa(t)+sita2(t))==0;
Fy(t)-m2*(L2*diff(sita1(t),t)^2*cos(sita1(t))+L2*diff(sita12(t),t)*sin(sita1(t)))-A*P(t)*sin(afa(t)+sita2(t))==0;
A*P(t)*L3*sin(afa(t))-J2*diff(sita22(t),t)==0;diff(sita1(t),t)-sita12(t)==0;sita22(t)-diff(sita2(t),t)==0;
afa(t)+bata(t)+sita1(t)+sita2(t)-0.5*pi==0]
vars=[sita1(t),sita2(t),sita12(t),sita22(t),Q(t),d(t),P(t),Fx(t),Fy(t),afa(t),bata(t)]
[eqs, vars, newVars] = reduceDifferentialOrder(eqs, vars)
F = daeFunction(eqs,vars,[kt,ct,L1,L2,L3,L4,d0,J1,J2,m2,m1,Pmax,Qmax,A])
f = @(t,y,yp) F(t,y,yp,[6.225e+3,156.3,0.3,0.2,0.37,0.1,0.63,12.7,99.7,107,21,2.5e+6,8.33e-5,5.058e-4])
opt = odeset('RelTol', 10.0^(-4), 'AbsTol' , 10.0^(-4));t0 = 0;
[y0,yp0] = decic(f,t0,[0;0;0;0;0;0;0;0;0;0.912;0.628],[1 1 0 0 0 0 1 1 0 1 0]',[0 0 0.5 0.5 8.33e-5 0 0 0 0 0 0]',[0 0 0 0 1 0 0 0 0 0 0]',opt)
f(t0,y0,yp0)
tfinal=20;
y0=[0;0;0.5;0.6;0;0;0;0;0;0.912;0.628];
[t,y]=ode15i(f,[t0:0.001:tfinal],y0,yp0,opt);
3 Comments
Juan Sepulveda Nuñez
on 31 Jan 2023
Amelia
on 12 Jun 2024
I had this same problem and in the process of debugging realized that my Jacobian had terms that were NaN and Inf. Maybe going through and checking to make sure none of the components in your equations return Inf or NaN could help with debugging partially
Answers (1)
Walter Roberson
on 5 Oct 2017
0 votes
decic invokes ode15ipdinit(), which produces several results including the partial derivatives of the ode function. The second partial derivative is then passed into the decic internal routine sls(), which calculates its rank. If the rank is less than the number of fixed variables then sls() issues the error message you see.
In the case of the above equations, the rank of the partial derivative is 5, but the number of fixed variables is 6. You would need to free up at least one more variable. The variables that are fixed are the ones marked with 1 in the fourth input to decic.
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!