JMathLabTutorial:Equations (Nonlinear Systems)

From jWork.ORG
Revision as of 20:25, 27 December 2016 by Jworkorg (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Limitted access. Reguest membership or login to this link first if you are already a member

Systems of Nonlinear Equations

Coupled systems of equations can be solved by the function algsys([expressions],[symbolic variables]). First, all linear equations are solved using the Gauss-method, then each equation is fed through solve() and the solution used to eliminate one variable in all other expressions. The equations are treated in the order they are supplied. This method only works for simple systems. The solution is provided as vector of solution vectors, each individual solution in as linear factor: In the first example below there is one solution with xs=-2/3, a2=3/4, a0=2, a1=0, the second example has two solutions.

syms xs,a0,a1,a2
a=algsys([2-a0,a1-0,a2*xs^2+a1*xs+a0-3-xs, 2*a2*xs+a1+1],[a2,a1,a0,xs])

syms a,xs

Summary Table

Name( Arguments ) Function
subst($var_x$,$var_y$,$var_z$) substitute $var_x$ for $var_y$ in $var_z$
trigrat($var$) trigonometric and other simplifications
trigexp($var$) trigonometric expansion
solve($var$, $Sym$) solves $var = 0$ for $Sym$.
algsys([$var_1$, $var_2,\ldots$],[$sym_1$, $sym_2,\ldots$]) solves the system of equations $var_1 = 0, var_2 = 0,\ldots$ for $sym_1, sym_2,\ldots$.
linsolve($matrix$, $vector$) solves $matrix \cdot x = vector$ for $x$
linsolve2($matrix$, $vector$) solves $matrix \cdot x = vector$ for $x$ (Lapack)
linlstsq($matrix$, $vector$) solves $matrix \cdot x = vector$ for $x$, overdetermined (Lapack)