Académique Documents
Professionnel Documents
Culture Documents
entra
Yn = Input["Valor inicial de la coordenada en y"];
entra
Xf = Input["Valor final de la coordenada en x"];
entra
Yf = Input["Valor final de la coordenada en y"];
entra
GLT = Input["Grados de libertad totales"];
entra
L = ((Xf - Xn) ^ 2 + (Yf - Yn) ^ 2) ^ 0.5;
a = 12 / L ^ 3;
b = 6 / L ^ 2;
c = 4 / L;
d = 2 / L;
MatrixForm[k1 = {{a, b, - a, b}, {b, c, - b, d}, {- a, - b, a, - b}, {b, d, - b, c}}]
forma de matriz
kg1 = ConstantArray[0, {GLT, GLT}];
arreglo constante
f[{ny_, nz_, fy_, fz_}] := (kg1〚ny, ny〛 = k1〚1, 1〛;
kg1〚ny, nz〛 = k1〚1, 2〛;
kg1〚ny, fy〛 = k1〚1, 3〛;
kg1〚ny, fz〛 = k1〚1, 4〛;
kg1〚nz, ny〛 = k1〚2, 1〛;
kg1〚nz, nz〛 = k1〚2, 2〛;
kg1〚nz, fy〛 = k1〚2, 3〛;
kg1〚nz, fz〛 = k1〚2, 4〛;
kg1〚fy, ny〛 = k1〚3, 1〛;
kg1〚fy, nz〛 = k1〚3, 2〛;
kg1〚fy, fy〛 = k1〚3, 3〛;
kg1〚fy, fz〛 = k1〚3, 4〛;
kg1〚fz, ny〛 = k1〚4, 1〛;
kg1〚fz, nz〛 = k1〚4, 2〛;
kg1〚fz, fy〛 = k1〚4, 3〛;
kg1〚fz, fz〛 = k1〚4, 4〛;)
f[{4, 1, 2, 3}];
Out[11]//MatrixForm=
0.00694444 0.0416667 - 0.00694444 0.0416667
0.0416667 0.333333 - 0.0416667 0.166667
- 0.00694444 - 0.0416667 0.00694444 - 0.0416667
0.0416667 0.166667 - 0.0416667 0.333333
2 Viga 1.nb
Take: Nonatomic expression expected at position 1 in Take [K, {1, 4}, {1, 4}].
Out[30]//MatrixForm=
Take: Nonatomic expression expected at position 1 in Take [K, {1, 4}, {5, 6}].
Out[31]//MatrixForm=
Take: Nonatomic expression expected at position 1 in Take [K, {5, 6}, {1, 4}].
Out[32]//MatrixForm=
Take[K, {5, 6}, {1, 4}]
Take: Nonatomic expression expected at position 1 in Take [K, {5, 6}, {5, 6}].
Out[33]//MatrixForm=
Out[ ]= {}