Difference matrix
diff_mat(N, l = "-1", d = 1)
Number of rows (and columns)
Value / symbol below main diagonal
Value / symbol on main diagonal
if (has_sympy()){
Dm <- diff_mat(4)
Dm
y <- vector_sym(4, "y")
Dm %*% y
}
#> c: [y₁ -y₁ + y₂ -y₂ + y₃ -y₃ + y₄]ᵀ