Solving ODEs that degenerate to DAEs

4 次查看(过去 30 天)
I am having some trouble with a ODE problem that I am trying to solve and I am wondering if it is because the ODEs that I am using degenerate into a DAE at some time points. Specifically I am using ode15s to solve a problem using ode system that has a mass matrix that is state and time dependent. More specifically the problem I am trying to solve is a pneumatic systems problem where I have a bunch of volumes of air that are leaking into each other and changing volumes. One of the equations that I am using is the continuity equation in form of:
Volume*(dP/dt)-(P*Volume/T)(dT/dt)=(R*T)(dM/dt)-P(dVolume/dt) Solving it in the form:
[Volume,-(P*Volume/T)][x1';x2']=(R*x2)(dM/dt)-x1(dVolume/dt)
(dM/dT) is the flows into the chamber and is dependant on P & T. (dVolume/dt) is dependent solely on t. And then there is another equation that represents the heat flow into the chamber which gives me enough equations to solve the system but also suffers from a similar form of degeneration.
What I am wondering is at times when the volume of the chamber goes to zero it is obvious that the equation becomes a algebraic equation because the mass matrix terms go to zero.So the solver will know that it is a DAE. The thing I am worried about is the next time step when the volume is very small but not zero will the solver struggle because that equation the mass matrix terms are non-zero but the equation is still functionally an algebraic equation? This worry is supported by the warning I am getting from the solver which is :
"Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN. " Then: "This DAE appears to be of index greater than 1."
Before you ask, I know simscape can solve these kinds of problems but it isn't suitable for this problem because I need to be able to programaticaly set up the flow network. ie. Add/Destroy volumes at certain times and connect those volumes into the leakage network. And I haven't found a way to do that in simscape.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulation Setup 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by