DAE Problem : cannot understand how to find the problem in my code

1 次查看(过去 30 天)
This is code to solve 6 ode's and 12 algebraic equations. All of them are interdependent. How do I go about it? I keep getting errors but I am unable to solve it.
**M file**
*M file* function f=ncs1_dae(t,x)
%Input parameters
global alpha A AH AI AO AV ACS beta CPH CPI CPIN CPO CPV dB g hB hI hO hH hV Hmax k M MH min Pset qein R rhol rhov ri ro TIN TR vB lambda;
input()
%Variables
TI=x(1);
........
..........
=x(16);
%f(1) to f(6) are ODEs
f(1)=
f(2)=
f(3)=
f(4)=
f(5)=
f(6)=
%f(7) to f(18) are Algebraic Equations
f(7)=
f(8)=
f(9)=
f(10)=
f(11)=
f(12)=
f(13)=
f(14)=
f(15)=
f(16)=
f(17)=
f(18)=
f=f';
This is what I enter in the command window:
>> x0=[298 298 298 298 1 0.3 0 373 0 0 0 0 0 0 0 0.0013 0.0041 0.0056];
>> tspan=[0 1200];
>> M=[eye(6,18);zeros(12,18)];
>> options=odeset('Mass',M);
>> [t1,x1]=ode15s(f,[0,1200],x0,options);
The warning msg I get is : Warning: Failure at t=3.014342e-01. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (8.881784e-16) at time t. > In ode15s at 753 >> if true
% code
end

回答(1 个)

Jan
Jan 2012-10-1
编辑:Jan 2012-10-1
You can define an DAE such that there is no feasible point. If the mass matrix is singular, as in your case, the initial slope M(t0, y0) * y'(0) = f(t0, y0) must exist.
Imagine a DAE which describes a point sliding on a circulare wire. If you start the integration with a point apart from the wire, there is no valid first step of the integration, because it is impossible to keep the trajectory on the feasible path.

类别

Help CenterFile Exchange 中查找有关 Get Started with Optimization Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by