Find incidence matrix of system of equations
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.
A := daetools::incidenceMatrix(eqs,vars) for
A[i,j] = 1 if
any derivative of
vars[j]. All other elements of
Find the incidence matrix of a system of five equations in five variables.
Create the following vector
five symbolic differential equations.
eqs := [diff(y1(t),t) = y2(t), diff(y2(t),t) = c1*y1(t) + c3*y3(t), diff(y3(t),t) = y2(t) + y4(t), diff(y4(t),t) = y3(t) + y5(t), diff(y5(t),t) = y4(t)]:
Create the vector of variables. Here,
symbolic parameters (not variables) of the system.
vars := [y1(t), y2(t), y3(t), y4(t), y5(t)]:
Find the incidence matrix
A for the equations
respect to the variables
A := daetools::incidenceMatrix(eqs, vars)
A list or a vector of equations or expressions in the state
A list or a vector of identifiers or expressions, such as
A matrix of