solve_sys {caracas} | R Documentation |
If called as solve_sys(lhs, vars)
the roots are found.
If called as solve_sys(lhs, rhs, vars)
the solutions to lhs = rhs
for vars
are found.
solve_sys(lhs, rhs, vars)
lhs |
Equation (or equations as row vector/1xn matrix) |
rhs |
Equation (or equations as row vector/1xn matrix) |
vars |
vector of variable names or symbols |
A list with solutions (with class caracas_solve_sys_sol
for compact printing), each element containing a named
list of the variables' values.
if (has_sympy()) { x <- symbol('x') exp1 <- 2*x + 2 exp2 <- x solve_sys(cbind(exp1), cbind(exp2), x) x <- symbol("x") y <- symbol("y") lhs <- cbind(3*x*y - y, x) rhs <- cbind(-5*x, y+4) sol <- solve_sys(lhs, rhs, list(x, y)) sol }