lsolve.md (950B)
1 <!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. --> 2 3 # Function lsolve 4 5 Finds one solution of a linear equation system by forwards substitution. Matrix must be a lower triangular matrix. Throws an error if there's no solution. 6 7 `L * x = b` 8 9 10 ## Syntax 11 12 ```js 13 math.lsolve(L, b) 14 ``` 15 16 ### Parameters 17 18 Parameter | Type | Description 19 --------- | ---- | ----------- 20 `L` | Matrix, Array | A N x N matrix or array (L) 21 `b` | Matrix, Array | A column vector with the b values 22 23 ### Returns 24 25 Type | Description 26 ---- | ----------- 27 DenseMatrix | Array | A column vector with the linear system solution (x) 28 29 30 ### Throws 31 32 Type | Description 33 ---- | ----------- 34 35 36 ## Examples 37 38 ```js 39 const a = [[-2, 3], [2, 1]] 40 const b = [11, 9] 41 const x = lsolve(a, b) // [[-5.5], [20]] 42 ``` 43 44 45 ## See also 46 47 [lsolveAll](lsolveAll.md), 48 [lup](lup.md), 49 [slu](slu.md), 50 [usolve](usolve.md), 51 [lusolve](lusolve.md)