Symbolics.jl
Symbolics.jl copied to clipboard
get rref of augment matrix
prepare to get rref from expression
- write expression
- to augment matrix
- evaluate
rreffunction to get rref
seems type has problem
let
using LaTeXStrings,Symbolics,LinearAlgebra,RowEchelon,Latexify
@variables x,y,z,eqs
eq1=4x+3y+2z~4
eq2=5x+4y+7z~2
eq3=6x-4y+5z~5
eqs=[eq1,eq2,eq3]
coeffs,b=[(eq).lhs for eq in eqs],[(eq).rhs for eq in eqs]
matrix=Symbolics.jacobian(coeffs,[x,y,z])
augment_matrix=hcat(matrix,b)
# reduce_matrix=rref(augment_matrix) ??
end
Please try:
using LaTeXStrings, Symbolics, LinearAlgebra, RowEchelon, Latexify
@variables x, y, z, eqs
eq1 = 4x + 3y + 2z ~ 4
eq2 = 5x + 4y + 7z ~ 2
eq3 = 6x - 4y + 5z ~ 5
eqs = [eq1, eq2, eq3]
coeffs, b = [(eq).lhs for eq in eqs], [(eq).rhs for eq in eqs]
matrix = Symbolics.jacobian(coeffs, [x, y, z])
augment_matrix = hcat(matrix, b)
augment_matrix = Symbolics.value.(augment_matrix) # SEE HERE
reduce_matrix=rref(augment_matrix)
Num is a wrapper for Number and SymbolicUtils.Symbolic, etc.
You need to call Symbolics.value to get its internal values.
Numis a wrapper forNumberandSymbolicUtils.Symbolic, etc.You need to call
Symbolics.valueto get its internal values.
Thanks !