Choose a Solver

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.

The general solvers (solve for symbolic solutions and numeric::solve for numeric approximations) handle a wide variety of equations, inequalities, and systems. When you use the general solver, MuPAD® identifies the equation or the system as one of the types listed in the table that follows. Then the system calls the appropriate solver for that type. If you know the type of the equation or system you want to solve, directly calling the special solver is more efficient. When you call special solvers, MuPAD skips trying other solvers. Direct calls to the special solvers can help you to:

  • Improve performance of your code

  • Sometimes get a result where the general solver fails

The following table lists the types of equations and systems for which MuPAD offers special solvers. The solve and numeric::solve commands also handle these types of equations and systems (except systems presented in a matrix form). Define ordinary differential equations with the ode command before calling the general solver.

Equation TypeSymbolic SolversNumeric Solvers
General system of linear equations

linsolve

numeric::linsolve

General system of linear equations given in a matrix form

linalg::matlinsolve

numeric::matlinsolve

System of linear equations given in a matrix form , where A is a Vandermonde matrix. For example:

.

See linalg::vandermonde for the definition and details.

linalg::vandermondeSolve

System of linear equations given in a matrix form , where A is a Toeplitz matrix. For example:

.

See linalg::toeplitz for the definition and details.

linalg::toeplitzSolve

System of linear equations given in a matrix form . The lower triangular matrix L and the upper triangular matrix U form an LU-decomposition.

linalg::matlinsolveLU

Univariate polynomial equation. Call these functions to isolate the intervals containing real roots.

polylib::realroots

numeric::polyroots, numeric::realroots

Bivariate polynomial equation for which the general solver returns RootOf. Try calling solve with the option MaxDegree. If the option does not help to get an explicit solution, compute the series expansion of the solution. Expand the solution around the point where one of the variables is 0.

series

System of polynomial equations

numeric::polysysroots

Arbitrary univariate equation

numeric::realroot, numeric::realroots

System of arbitrary equations

numeric::fsolve

Ordinary differential equation or a system of ODEs

ode::solve

numeric::odesolve

Ordinary differential equation or a system of ODEs. Call this function to get a procedure representing the numeric results instead of getting the numeric approximation itself.

numeric::odesolve2

Ordinary differential equations on homogeneous manifolds embedded in the space of n×m matrices.

numeric::odesolveGeometric

Linear congruence equation

numlib::lincongruence

Quadratic congruence equation

numlib::msqrts

Polynomial equation. Call this function to find modular roots.

numlib::mroots