daetools::isLowIndexDAE

Check if differential index of system equations is lower than 2

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Syntax

daetools::isLowIndexDAE(eqs,vars)

Description

daetools::isLowIndexDAE(eqs,vars) checks if the system eqs of first-order semilinear differential algebraic equations (DAEs) has a low differential index. If the differential index of the system is 0 or 1, isLowIndexDAE returns TRUE. If the differential index of eqs is higher than 1, then daetools::isLowIndexDAE returns FALSE.

The number of equations eqs must match the number of variables vars.

Examples

Example 1

Check if a system of first-order semilinear DAEs has a low (0 or 1) differential index.

Create the following system of two differential algebraic equations. Here, x(t) and y(t) are the state variables of the system.

eqs := [diff(x(t),t) = x(t) + y(t), x(t)^2 + y(t)^2 = 1];
vars := [x(t), y(t)]

Use daetools::isLowIndexDAE to check the differential order of the system. The differential order of this system is 1. For systems of index 0 and 1, daetools::isLowIndexDAE returns TRUE.

daetools::isLowIndexDAE(eqs, vars)

Example 2

Check if the following DAE system has a low or high differential index. If the index is higher than 1, then use daetools::reduceDAEIndex to reduce it.

Create the following system of two differential algebraic equations. Here, x(t), y(t), and z(t) are the state variables of the system.

eqs := [diff(x(t),t) = x(t) + z(t),
        diff(y(t),t) = f(t),
        x(t) = y(t)];

vars := [x(t), y(t), z(t)]

Use daetools::isLowIndexDAE to check the differential index of the system. For this system, daetools::isLowIndexDAE returns FALSE. This means that the differential index of the system is 2 or higher.

daetools::isLowIndexDAE(eqs, vars)

Use daetools::reduceDAEIndex to rewrite the system so that the differential index is 1. The new system has one additional state variable, Dyt(t).

[newEqs, newVars, transform, oldIndex] :=
         daetools::reduceDAEIndex(eqs, vars):

newEqs;
newVars

daetools::reduceDAEIndex also returns the differential index of the original system.

oldIndex

Check if the differential order of the new system is lower than 2.

daetools::isLowIndexDAE(newEqs, newVars)

Parameters

eqs

A list or a vector of equations or expressions in the state variables vars and their derivatives. Expressions represent equations with 0 right side.

vars

A list or a vector of identifiers or expressions, such as [x1(t), x2(t)].

Return Values

TRUE or FALSE.

Introduced in R2014b