Question: Writing equations in procedure

 

restart

with(LinearAlgebra):

with(StringTools):

FormatTime("%m-%d-%Y, %H:%M")

NULL

Pile spacing of each pile from a refrence pile:

S__p := Matrix(9, 9, {(1, 1) = 0., (1, 2) = 3.30, (1, 3) = 6.60, (1, 4) = 3.30, (1, 5) = 4.67, (1, 6) = 7.38, (1, 7) = 6.60, (1, 8) = 7.38, (1, 9) = 9.33, (2, 1) = 3.30, (2, 2) = 0., (2, 3) = 3.30, (2, 4) = 4.67, (2, 5) = 3.30, (2, 6) = 4.67, (2, 7) = 7.38, (2, 8) = 6.60, (2, 9) = 7.38, (3, 1) = 6.60, (3, 2) = 3.30, (3, 3) = 0., (3, 4) = 7.38, (3, 5) = 4.67, (3, 6) = 3.30, (3, 7) = 9.33, (3, 8) = 7.38, (3, 9) = 6.60, (4, 1) = 3.30, (4, 2) = 4.67, (4, 3) = 7.38, (4, 4) = 0., (4, 5) = 3.30, (4, 6) = 6.60, (4, 7) = 3.30, (4, 8) = 4.67, (4, 9) = 7.38, (5, 1) = 4.67, (5, 2) = 3.30, (5, 3) = 4.67, (5, 4) = 3.30, (5, 5) = 0., (5, 6) = 3.30, (5, 7) = 4.67, (5, 8) = 3.30, (5, 9) = 4.67, (6, 1) = 7.38, (6, 2) = 4.67, (6, 3) = 3.30, (6, 4) = 6.60, (6, 5) = 3.30, (6, 6) = 0., (6, 7) = 7.38, (6, 8) = 4.67, (6, 9) = 3.30, (7, 1) = 6.60, (7, 2) = 7.38, (7, 3) = 9.33, (7, 4) = 3.30, (7, 5) = 4.67, (7, 6) = 7.38, (7, 7) = 0., (7, 8) = 3.30, (7, 9) = 6.60, (8, 1) = 7.38, (8, 2) = 6.60, (8, 3) = 7.38, (8, 4) = 4.67, (8, 5) = 3.30, (8, 6) = 4.67, (8, 7) = 3.30, (8, 8) = 0., (8, 9) = 3.30, (9, 1) = 9.33, (9, 2) = 7.38, (9, 3) = 6.60, (9, 4) = 7.38, (9, 5) = 4.67, (9, 6) = 3.30, (9, 7) = 6.60, (9, 8) = 3.30, (9, 9) = 0.})

Angle of each pile from a reference pile in radian:

xi := Matrix(9, 9, {(1, 1) = 0., (1, 2) = 0., (1, 3) = 0., (1, 4) = 1.57, (1, 5) = .785, (1, 6) = .464, (1, 7) = 1.57, (1, 8) = 1.11, (1, 9) = .785, (2, 1) = 3.14, (2, 2) = 0., (2, 3) = 0., (2, 4) = 2.36, (2, 5) = 1.57, (2, 6) = .785, (2, 7) = 2.03, (2, 8) = 1.57, (2, 9) = 1.11, (3, 1) = 3.14, (3, 2) = 3.14, (3, 3) = 0., (3, 4) = 2.68, (3, 5) = 2.36, (3, 6) = 1.57, (3, 7) = 2.36, (3, 8) = 2.03, (3, 9) = 1.57, (4, 1) = 1.57, (4, 2) = .785, (4, 3) = .464, (4, 4) = 0., (4, 5) = 0., (4, 6) = 0., (4, 7) = 1.57, (4, 8) = .785, (4, 9) = .464, (5, 1) = 2.36, (5, 2) = 1.57, (5, 3) = .785, (5, 4) = 3.14, (5, 5) = 0., (5, 6) = 0., (5, 7) = 2.36, (5, 8) = 1.57, (5, 9) = .785, (6, 1) = 2.68, (6, 2) = 2.36, (6, 3) = 1.57, (6, 4) = 3.14, (6, 5) = 3.14, (6, 6) = 0., (6, 7) = 2.68, (6, 8) = 2.36, (6, 9) = 1.57, (7, 1) = 1.57, (7, 2) = 1.11, (7, 3) = .785, (7, 4) = 1.57, (7, 5) = .785, (7, 6) = .464, (7, 7) = 0., (7, 8) = 0., (7, 9) = 0., (8, 1) = 2.03, (8, 2) = 1.57, (8, 3) = 1.11, (8, 4) = 2.36, (8, 5) = 1.57, (8, 6) = .785, (8, 7) = 3.14, (8, 8) = 0., (8, 9) = 0., (9, 1) = 2.36, (9, 2) = 2.03, (9, 3) = 1.57, (9, 4) = 2.68, (9, 5) = 2.36, (9, 6) = 1.57, (9, 7) = 3.14, (9, 8) = 3.14, (9, 9) = 0.})

NULL

Angle of each pile from a reference pile in degrees:

theta := Matrix(9, 9, {(1, 1) = 0., (1, 2) = 0., (1, 3) = 0., (1, 4) = 90.0, (1, 5) = 44.8, (1, 6) = 26.6, (1, 7) = 90.0, (1, 8) = 63.6, (1, 9) = 44.8, (2, 1) = 180., (2, 2) = 0., (2, 3) = 0., (2, 4) = 135., (2, 5) = 90.0, (2, 6) = 44.8, (2, 7) = 116., (2, 8) = 90.0, (2, 9) = 63.6, (3, 1) = 180., (3, 2) = 180., (3, 3) = 0., (3, 4) = 153., (3, 5) = 135., (3, 6) = 90.0, (3, 7) = 135., (3, 8) = 116., (3, 9) = 90.0, (4, 1) = 90.0, (4, 2) = 44.8, (4, 3) = 26.6, (4, 4) = 0., (4, 5) = 0., (4, 6) = 0., (4, 7) = 90.0, (4, 8) = 44.8, (4, 9) = 26.6, (5, 1) = 135., (5, 2) = 90.0, (5, 3) = 44.8, (5, 4) = 180., (5, 5) = 0., (5, 6) = 0., (5, 7) = 135., (5, 8) = 90.0, (5, 9) = 44.8, (6, 1) = 153., (6, 2) = 135., (6, 3) = 90.0, (6, 4) = 180., (6, 5) = 180., (6, 6) = 0., (6, 7) = 153., (6, 8) = 135., (6, 9) = 90.0, (7, 1) = 90.0, (7, 2) = 63.6, (7, 3) = 44.8, (7, 4) = 90.0, (7, 5) = 44.8, (7, 6) = 26.6, (7, 7) = 0., (7, 8) = 0., (7, 9) = 0., (8, 1) = 116., (8, 2) = 90.0, (8, 3) = 63.6, (8, 4) = 135., (8, 5) = 90.0, (8, 6) = 44.8, (8, 7) = 180., (8, 8) = 0., (8, 9) = 0., (9, 1) = 135., (9, 2) = 116., (9, 3) = 90.0, (9, 4) = 153., (9, 5) = 135., (9, 6) = 90.0, (9, 7) = 180., (9, 8) = 180., (9, 9) = 0.})

The total number of piles in a pile group:

n__pile := 9

The length of each pile in the pile group in (meters):

L__p := 12.182   

 

``

Diameter of pile (meter):

`φ__pile` := .457

The radius of each pile (meter):

r__0 := evalf((1/2)*`φ__pile`, 2)

NULL

`ρ__A` := 1.0

NULL

D__s := 0.5e-1

NULL

Omega := 46``

``

`ν__soil` := .5

NULL

E__p := 3.2*10^10``

NULL

G__s := 5.7*10^7``

NULL

 

V__s := 182.88

NULL

``

NULL

NULL

V__La := 395.845``

NULL

`&alpha;__&nu;` := proc (S__p, xi, n__pile) local `&alpha;__tmp`, flist, i, j, `&alpha;__1`, `&alpha;__2`, `&alpha;__3`; global D__s, V__La, V__s, Omega; description "Calculate the horizontal interaction factor from a refernce pile in a pile group"; flist := []; for i to `n__pile ` do for j to n__pile do `&alpha;__1`[i, j] := evalf[4](.5*(S__p[i, j]/`&phi;__pile`)^.5*exp(-D__s*Omega*S__p[i, j]/V__La)*exp(-I*Omega*S__p[i, j]/V__La)); `&alpha;__2`[i, j] := evalf[4]((3/4)*(S__p[i, j]/`&phi;__pile`)^.5*exp(-D__s*Omega*S__p[i, j]/V__s)*exp(-I*Omega*S__p[i, j]/V__s)/sqrt(2)); `&alpha;__3`[i, j] := evalf[4](`&alpha;__1`[i, j]*cos(xi[i, j])^2+`&alpha;__2`[i, j]*sin(xi[i, j])^2); if i = j then `&alpha;__tmp`[i, i] := 1.0 elif xi[i, j] = 0. then `&alpha;__tmp`[i, j] := `&alpha;__1`[i, j] elif xi[i, j] = 1.57 then `&alpha;__tmp`[i, j] := `&alpha;__2`[i, j] elif xi[i, j] <> 1.57 and xi[i, j] <> 0. then `&alpha;__tmp`[i, j] := `&alpha;__3`[i, j] end if; flist := [op(flist), `&alpha;__tmp`[i, j]] end do end do end proc:

NULL

NULL

NULL

NULLNULL

NULLNULLNULL

`&alpha;__v` := eval(Matrix(n__pile, n__pile, `&alpha;__&nu;`(S__p, xi, n__pile)))``

NULL

``

``

``

NULL

NULL

``

NULL

 

Download Test_pile.mw

Good Evening Maple Community,

Can anybody please help in the attached file. Highlighted in yellow are the three equations I'm trying to program in Maple procedure, but could not get any output due to an error message. Please Help.

 

Boyer 

Please Wait...