Vous êtes sur la page 1sur 8

In[1]:= Xn = Input["Valor inicial de la coordenada en x"];

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

In[15]:= Xn = Input["Valor inicial de la coordenada en x"];


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[k2 = {{a, b, - a, b}, {b, c, - b, d}, {- a, - b, a, - b}, {b, d, - b, c}}]
forma de matriz
kg2 = ConstantArray[0, {GLT, GLT}];
arreglo constante
f[{ny_, nz_, fy_, fz_}] := (kg2〚ny, ny〛 = k2〚1, 1〛;
kg2〚ny, nz〛 = k2〚1, 2〛;
kg2〚ny, fy〛 = k2〚1, 3〛;
kg2〚ny, fz〛 = k2〚1, 4〛;
kg2〚nz, ny〛 = k2〚2, 1〛;
kg2〚nz, nz〛 = k2〚2, 2〛;
kg2〚nz, fy〛 = k2〚2, 3〛;
kg2〚nz, fz〛 = k2〚2, 4〛;
kg2〚fy, ny〛 = k2〚3, 1〛;
kg2〚fy, nz〛 = k2〚3, 2〛;
kg2〚fy, fy〛 = k2〚3, 3〛;
kg2〚fy, fz〛 = k2〚3, 4〛;
kg2〚fz, ny〛 = k2〚4, 1〛;
kg2〚fz, nz〛 = k2〚4, 2〛;
kg2〚fz, fy〛 = k2〚4, 3〛;
kg2〚fz, fz〛 = k2〚4, 4〛;)
f[{4, 1, 5, 6}];
Out[25]//MatrixForm=
0.0234375 0.09375 - 0.0234375 0.09375
0.09375 0.5 - 0.09375 0.25
- 0.0234375 - 0.09375 0.0234375 - 0.09375
0.09375 0.25 - 0.09375 0.5
Viga 1.nb 3

In[ ]:= MatrixForm[K = kg1 + kg2]


forma de matriz
Out[ ]//MatrixForm=
1.66667 - 0.166667 0.333333 0.541667 - 0.375 0.5
- 0.166667 0.0555556 - 0.166667 - 0.0555556 0 0
0.333333 - 0.166667 0.666667 0.166667 0 0
0.541667 - 0.0555556 0.166667 0.243056 - 0.1875 0.375
- 0.375 0 0 - 0.1875 0.1875 - 0.375
0.5 0 0 0.375 - 0.375 1.

In[29]:= GL = Input["Grados de libertad sin restricciones"];


entra
MatrixForm[k11 = Take[K, {1, GL}, {1, GL}]]
forma de matriz toma
MatrixForm[K22 = Take[K, {1, GL}, {GL + 1, GLT}]]
forma de matriz toma
MatrixForm[k33 = Take[K, {GL + 1, GLT}, {1, GL}]]
forma de matriz toma
MatrixForm[K44 = Take[K, {GL + 1, GLT}, {GL + 1, GLT}]]
forma de matriz toma

Take: Nonatomic expression expected at position 1 in Take [K, {1, 4}, {1, 4}].
Out[30]//MatrixForm=

Take[K, {1, 4}, {1, 4}]

Take: Nonatomic expression expected at position 1 in Take [K, {1, 4}, {5, 6}].
Out[31]//MatrixForm=

Take[K, {1, 4}, {5, 6}]

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=

Take[K, {5, 6}, {5, 6}]

In[ ]:= F1 = Input["Valor de fuerza"];


entra
P1 = {F1};
D1 = {δ1};
Inverse[k11];
matriz inversa
Solve[D1  Inverse[k11].P1, {δ1}]
resuelve matriz inversa

Out[ ]= {{δ1  Inverse[Take[K, {1, 4}, {1, 4}]].{10}}}


4 Viga 1.nb

P2 = {{R1 + 36}, {R2}, {R3 + 36}, {Ma + 18}, {R5}};


D1 = {45.00000000000001};
Solve[P2  k33.D1, {R1, R2, R3, R4, R5}]
resuelve

Out[ ]= {}

Vous aimerez peut-être aussi