solve.caracas_symbol: Solve a System of Linear Equations

View source: R/solve.R

solve.caracas_symbolR Documentation

Solve a System of Linear Equations

Description

Solve a System of Linear Equations

Usage

## S3 method for class 'caracas_symbol'
solve(a, b, ...)

Arguments

a

caracas_symbol

b

If provided, either a caracas_symbol (if not, as_sym() is called on the object)

...

Not used

Examples

if (has_sympy()) {
  A <- matrix_sym(2, 2, "a")
  b <- vector_sym(2, "b")
  # Inverse of A:
  solve(A)
  inv(A)
  solve(A) %*% A |> simplify()
  # Find x in Ax = b
  x <- solve(A, b)
  A %*% x |> simplify()
  solve(A, c(2, 1)) |> simplify()
}


caracas documentation built on June 22, 2024, 10:59 a.m.