I'm trying to solve a system of DAE (mixture of ODE and Algebraic Eq). So, my system looks like this
M dy/dt = F(t,y)
The matrix M is basically a constant mass matrix 1 in the diagonal with all zeros on the few last lines and few last column.
so for an example mass matrix looks like this
M = [1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 0]
my vector Fx is in dimension (4x1) if we take the matrix example.
How do I proceed if I get this error?
Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN
my code for the system resolution :
Mass = Mass_Matrix( Nc,NT );
opt = odeset('RelTol', 10.0^(-3), 'AbsTol' , 10.0^(-3), 'Mass', Mass ,'MassSingular', 'yes', 'OutputFcn',@odeprint);
[T,Y] = ode15s(@(t,y)Function_Fx( t, y, Resolution, y01),[0 1],y0,opt);
and my vector Fx is created by the Function_Fx
function Fx = Function_Fx( t, y, Resolution, y01)
With Resolution being a struct variables, and y01 a stored values.
My question is where could be the problem, is it the F(t,y) or the M? Given M is constant mass matrix.
Thank you for your help
Function_Fx
and values for all used variables (Mass
,t
,y
,Resolution
,y01
,y01
). otherwise no one can reproduce your problem – m.s.y(4)
. – A. Donda