• API
• FAQ
• Tools
• Archive
SHARE
TWEET

# Untitled

a guest Aug 14th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. ClearAll["Global`*"];
2. W[1] = c[1]*Sin[b*x1] + c[2]*Cos[b*x1] + c[3]*Sinh[b*x1] +
3.    c[4]*Cosh[b*x1];
4. W[2] = c[5]*Sin[b*(x1 - z[1])] + c[6]*Cos[b*(x1 - z[1])] +
5.    c[7]*Sinh[b*(x1 - z[1])] + c[8]*Cosh[b*(x1 - z[1])];
6. W[3] = c[9]*Sin[b*(x1 - z[2])] + c[10]*Cos[b*(x1 - z[2])] +
7.    c[11]*Sinh[b*(x1 - z[2])] + c[12]*Cosh[b*(x1 - z[2])];
8. w = Piecewise[{{W[1], x1 <= z[1]}, {W[2], z[1] <= x1 <= z[2]}, {W[3],
9.      x1 >= z[2]}}];
10.
11. boundary[i_, j_] :=
12.  Module[ {bc},
13.   bc1 = {W[i] /. {x1 -> 0}, (D[W[i], {x1, 2}]) /. {x1 -> 0},
14.     W[j] /. {x1 -> L1}, ((D[W[j], {x1, 2}]) /. {x1 -> L1})}; bc = bc1]
15.
16. countinuity[i_, j_] :=
17.  Module[{eq},
18.   eq1 = {((W[i] /. x1 -> z[i]) - (W[j] /.
19.         x1 -> z[i])), (((D[W[i], {x1}]) /.
20.         x1 -> z[i]) - ((D[W[j], {x1}]) /.
21.         x1 -> z[i])), (((D[W[i], {x1, 2}]) /.
22.         x1 -> z[i]) - ((D[W[j], {x1, 2}]) /.
23.         x1 -> z[i])), (((D[W[i], {x1, 3}]) /.
24.          x1 -> z[i]) - ((D[W[j], {x1, 3}]) /. x1 -> z[i])) + (K[i]*
25.         W[i] /. x1 -> z[i])}; eq = eq1 ]
26.
27. e1 = boundary[1, 3];
28. e2 = countinuity[1, 2];
29. e3 = countinuity[2, 3];
30. comb = Tuples[{0, 1*^12}, 3];
31. eq = Flatten[{e1, e2, e3}];
32. var = Table[c[i], {i, 1, Length[eq]}];
33. R = Normal@CoefficientArrays[eq, var][[2]];
34. R = R /. {K[1] -> K1, K[2] -> K2};
35. MatrixForm[R];
36. P = -b^10 (Sinh[
37.        b L1] (16 b^3 ((K1 + K2) Cos[b L1] - K1 Cos[b (L1 - 2 z[1])] -
38.            K2 Cos[b (L1 - 2 z[2])]) + 2 (32 b^6 - K1 K2) Sin[b L1] +
39.         K1 K2 (4 Sin[b (L1 - 2 z[1])] -
40.            2 I Sin[b (L1 - 2 (z[1] + I z[2]))] -
41.            4 Sin[b (L1 - 2 z[2])] +
42.            4 Sin[b (L1 + 2 z[1] - 2 z[2])] + (1 + 2 I) Sin[
43.              b (L1 - 2 I z[2])] + (1 - 2 I) Sin[b (L1 + 2 I z[2])] +
44.            2 I Sin[b (L1 - 2 z[1] + 2 I z[2])] +
45.            4 Cosh[b z[
46.                2]] ((1 - 2 Cosh[2 b z[1]]) Cosh[b z[2]] Sin[b L1] +
47.               8 Sin[b z[1]] Sin[b (L1 - z[2])] Sinh[b z[1]])) +
48.         4 K1 (K2 Cos[b L1] - K2 Cos[b (L1 - 2 z[2])] +
49.            4 b^3 Sin[b L1]) Sinh[2 b z[1]] +
50.         4 K2 Sin[b L1] (4 b^3 + K1 Sinh[2 b z[1]]) Sinh[2 b z[2]]) -
51.      Cosh[
52.        b L1] (-K1 K2 (10 Cos[b L1] - 6 Cos[b (L1 - 2 z[1])] -
53.            4 Cos[b (L1 - 2 z[2])] - (1 - 2 I) Cos[b (L1 - 2 I z[2])] +
54.             Cos[b (L1 - 2 z[1] - 2 I z[2])] - (1 + 2 I) Cos[
55.              b (L1 + 2 I z[2])] + Cos[b (L1 - 2 z[1] + 2 I z[2])]) +
56.         4 K1 Cosh[b z[1]]^2 (K2 Cos[b L1] - K2 Cos[b (L1 - 2 z[2])] +
57.            4 b^3 Sin[b L1]) +
58.         2 (2 b^3 (-2 (2 K1 + 3 K2) Sin[b L1] +
59.               K2 (Sin[b (L1 - 2 I z[2])] + Sin[b (L1 + 2 I z[2])])) +
60.            2 K2 Cosh[b z[2]]^2 (K1 Cos[b L1] -
61.               K1 Cos[b (L1 - 2 z[1])] + 4 b^3 Sin[b L1] +
62.               K1 Sin[b L1] Sinh[2 b z[1]]) +
63.            K1 (2 (K2 Cos[b L1] - K2 Cos[b (L1 - 2 z[2])] +
64.                  4 b^3 Sin[b L1]) Sinh[b z[1]]^2 +
65.               16 K2 Sin[b z[1]] Sin[b (L1 - z[2])] Sinh[b z[1]] Sinh[
66.                 b z[2]] +
67.               K2 Sin[b L1] ((-3 + Cosh[2 b z[2]]) Sinh[2 b z[1]] -
68.                  2 Cosh[2 b z[1]] Sinh[2 b z[2]])))));
69.
70. f[z1_, z2_, l1_, k1_, k2_, beta_] :=
71.   Module[{m}, z[1] = z1; z[2] = z2 ; L1 = l1; K1 = k1; K2 = k2;
72.    r = beta; s1 = P; s2 = NSolve[s1 == 0 && 0 < b < 30];
73.    s3 = N[b /. s2];
74.    s4 = s3[[r]]; {uu, ww, vv} =
75.     SingularValueDecomposition[R /. b -> s4];
76.    NN = Last[Transpose[vv]];   sub1 = Flatten[{var, b}];
77.    sub2 = Flatten[{NN, s4}];
78.    m = w /. Table[sub1[[i]] -> sub2[[i]], {i, 1, Length[sub1]}];
79.    Return[m]];
80. n = 2;
81. comb = Tuples[{0, 1*^12}, 2];
82. g[i_, r_] :=
83.  Module[{s5}, spring = comb[[i]]; n1 = spring[[1]];
84.   n2 = spring[[2]];  n3 = r; s5 = f[0.25, 0.75, 1, n1, n2, n3]]
85. beammodes1 = Table[g[i, 1], {i, 1, 2^n}]
86. beammodes2 = Table[g[i, 2], {i, 1, 2^n}]
87. beammodes = Flatten[{beammodes1, beammodes2}];
88. Table[Plot[beammodes[[i]], {x1, 0, L1}, PlotRange -> All], {i, 1,
89.   Length[beammodes]}]
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

Top