from sympy import *
print("\n--- User input -----------------------")
fourth = S(1)/4
twelfth = fourth/3
b = var("b")
print("\n--- a: -------------------------------")
Ii = twelfth * b**4 * Matrix([54, 3, 2, 1])
Iy_A = sum(Ii)
Ai = b**2 * Matrix([6, 3, 2, 1])
zi = fourth * b * Matrix([1, -3, 5, -7])
zq = zi.multiply_elementwise(zi)
Iy_B = zq.multiply_elementwise(Ai)
Iy_B = sum(Iy_B)
Iy = Iy_A + Iy_B
pprint("IyA:")
pprint(Iy_A)
pprint("\nIyB:")
pprint(Iy_B)
pprint("\nIy:")
pprint(Iy)
pprint("\nIy/mm^4(b=2):")
pprint(Iy.subs(b,2))