densityw = 1030; densityt = 4500
length = 54.10; width = 6.20; height = 6.20; volume = 8711.02
length1 = 53.50; width1 = 6.13; height1 = 6.13; volume1 = 8420.99
gconstant = 6.67*10^-11
r[x_, y_, z_] := Sqrt[x^2 + y^2 + z^2]
u1[x_, y_, z_] :=
gconstant*volume*
densityt*(1/r[x, y, z] + (length^2*(3*x^2 - r[x, y, z]^2))/(
10*r[x, y, z]^5) + (
width^2*(3*y^2 - r[x, y, z]^2) +
height^2*(3*z^2 - r[x, y, z]^2))/(10*r[x, y, z]^5))
u2[x_, y_, z_] :=
gconstant*volume1*
densityt*(1/r[x, y, z] + (length1^2*(3*x^2 - r[x, y, z]^2))/(
10*r[x, y, z]^5) + (
width1^2*(3*y^2 - r[x, y, z]^2) +
height1^2*(3*z^2 - r[x, y, z]^2))/(10*r[x, y, z]^5))
u3[x_, y_, z_] :=
gconstant*volume1*
densityw*(1/r[x, y, z] + (length1^2*(3*x^2 - r[x, y, z]^2))/(
10*r[x, y, z]^5) + (
width1^2*(3*y^2 - r[x, y, z]^2) +
height1^2*(3*z^2 - r[x, y, z]^2))/(10*r[x, y, z]^5))
u[x_, y_, z_] := u1[x, y, z] - u2[x, y, z] - u3[x, y, z]