mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
56 lines
1.4 KiB
Markdown
56 lines
1.4 KiB
Markdown
---
|
|
layout: default
|
|
---
|
|
|
|
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
|
|
|
<h1 id="function-usolve">Function usolve <a href="#function-usolve" title="Permalink">#</a></h1>
|
|
|
|
Finds one solution of a linear equation system by backward substitution. Matrix must be an upper triangular matrix. Throws an error if there's no solution.
|
|
|
|
`U * x = b`
|
|
|
|
|
|
<h2 id="syntax">Syntax <a href="#syntax" title="Permalink">#</a></h2>
|
|
|
|
```js
|
|
math.usolve(U, b)
|
|
```
|
|
|
|
<h3 id="parameters">Parameters <a href="#parameters" title="Permalink">#</a></h3>
|
|
|
|
Parameter | Type | Description
|
|
--------- | ---- | -----------
|
|
`U` | Matrix, Array | A N x N matrix or array (U)
|
|
`b` | Matrix, Array | A column vector with the b values
|
|
|
|
<h3 id="returns">Returns <a href="#returns" title="Permalink">#</a></h3>
|
|
|
|
Type | Description
|
|
---- | -----------
|
|
DenseMatrix | Array | A column vector with the linear system solution (x)
|
|
|
|
|
|
<h3 id="throws">Throws <a href="#throws" title="Permalink">#</a></h3>
|
|
|
|
Type | Description
|
|
---- | -----------
|
|
|
|
|
|
<h2 id="examples">Examples <a href="#examples" title="Permalink">#</a></h2>
|
|
|
|
```js
|
|
const a = [[-2, 3], [2, 1]]
|
|
const b = [11, 9]
|
|
const x = usolve(a, b) // [[8], [9]]
|
|
```
|
|
|
|
|
|
<h2 id="see-also">See also <a href="#see-also" title="Permalink">#</a></h2>
|
|
|
|
[usolveAll](usolveAll.html),
|
|
[lup](lup.html),
|
|
[slu](slu.html),
|
|
[usolve](usolve.html),
|
|
[lusolve](lusolve.html)
|