I have linear equation I want to solve, as Ax = b
. I want to show step by step only in symbols and at the end insert numbers and show problem's solution in numbers. I have problems with inserting in numbers. If previously calculated values are whole numbers everything works fine. When I put in something with decimals it prints
[]
This is simplified code to illustrate my problem:
Force = 100 #If I try to put in value of lets say 100.23 the problem happens
x_t = 15
L = 20
A, x, b = sym.symbols('A, x, b')
A_x, A_y, B_y = sym.symbols('A_x, A_y, B_y')
b, F, xt, l = sym.symbols('b, F, xt, L')
A = sym.Matrix([[1, 0, 0],
[0, 1, 0],
[0, 0, 1]])
b = sym.Matrix([[0],
[F],
[F*xt/l]])
x = sym.Matrix([[A_x],
[A_y + B_y],
[B_y]])
linear_eq = sym.Eq(A * x, b)
solution = sym.solve(linear_eq, x) #This always works fine(only symbols)
solution = sym.solve(linear_eq.subs( {F: Force, xt: x_t, l: L }), x )
solution