You are on page 1of 30

Universitas Kristen Krida Wacana FR-08-03 / RO

Universitas Kristen Krida Wacana


Naskah Ujian

✓ UTS UAS  Susulan UTS / UAS Ganjil/ Genap 2022 / 2023

Jurusan : Teknik Sipil NIM :


242019005
Kode - Mata Kuliah : TS1WP021
: 2286 – Usman Wijaya Nama Mahasiswa :
NID - Nama Dosen
THALIA MARGARETHA
Hari / Tanggal : Senin / 7 November 2022
Waktu Ujian : 60 menit Tanda Tangan :
Sifat Ujian : Open Book
Lembar Jawaban : Ya / tidak
Kalkulator : Ya / tidak

Perhatian : 1. Taatilah segala peraturan ujian yang telah ditetapkan


2. Pelanggaran terhadap peraturan ujian dikenakan Sanksi Akademik

________________________________________________________________________________________

Soal No. 1 (bobot 20%)

Diketahui:

3 0 4  0 − 5 −3  0 2  6 1 2  −4.5
X =  −5 2 4  Y =  2 4 
 
W =  −1 2 2  Z =  −4 7   = 0  =  0.8 
 
   
 6 5 −1  −3 1 0   1 3   −8 3   −1  1.2 

Dengan menggunakan Jupiter Notebook/Google Colab, selesaikan:


a. Y + Z; Z + Y; 6(Z – Y); 6C – 6D
b. 5Y; 3Z; 2Y; 4W; 8Y-0Z;
c. W + Y-Z (Jawaban Tidak Terdefinisi); Y – Z; Z – Y; X + 2Y + 4Z (Jawaban Tidak
Terdifinisi)
d. 2(W+X); 2W +2X; 5W – ½X; X+Y+Z (Jawaban Tidak Terdifinisi)
e. 33α; 4β; 9α; 4(β+2.25α); α – β
f. WX; XY; Xβ; Wα
g. YZ; Yβ; αβ
h. XZ; βα; βX; αW

https://colab.research.google.com/drive/1al0ViDU3hkOV97G-o37sMZe08NWeElss?usp=share_link
Soal No. 2 (bobot 80%)

Dengan menggunakan Jupiter Notebook/Google Colab, tentukan gaya-gaya pada masing-masing


elemen batang. Gunakan penomoran batang dan DOF seperti terlihat pada Gambar dibawah ini:

2a. Asumsi: nilai EI konstan

30 kN r2
r1 10 kN/m
r3

1 2

5000
3000 3000

https://colab.research.google.com/drive/1Y445Mt5cLHfKl22ol4vv6XFPzAcfCnV?usp=share_link

2b. Asumsi: E = 200,000 MPa; I = 3200*106 mm4

Impoe

https://colab.research.google.com/drive/1G2ME8ZmSHh3SXyQZBXxTBGYKV58MfIv?usp=share_link

LINK GOOGLE COLAB: (SILAKAN DIISI MASING-MASING)


import numpy as np
W = np.array([[3,0,4], [-1,2,2], [6,5,-1]])
X = np.array([[0,-5,-3], [-5,2,4], [-3,1,0]])
Y = np.array([[0,2], [2,4], [1,3]])
Z = np.array([[6,1], [-4,7], [-8,3]])
a = np.array([[2,0,-1]])
b = np.array([[-4,0,1]])
R1 = np.add(Y,Z)
R2 = np.add(Z,Y)
R3 = np.subtract(Z,Y)
R4 = np.dot(6,R3)
R5 = np.dot(6,W)
R6 = np.dot(6,X)
R7 = np.subtract(R5,R6)
print(Y, "\n+\n", Z, "\n=\n", R1)
print("=====")
print(Z, "\n+\n", Y, "\n=\n", R2)
print("=====")
print(Z, "\n-\n", Y, "\n=\n", R3)
print("=====")
print(6, "\n+\n", R3, "\n=\n", R4)
print("=====")
print(6, "\nx\n", W, "\n=\n", R5)
print("=====")
print(6, "\nx\n", X, "\n=\n", R6)
print("=====")
print(R5, "\n-\n", R6, "\n=\n", R7)

[[0 2]
[2 4]
[1 3]]
+
[[ 6 1]
[-4 7]
[-8 3]]
=
[[ 6 3]
[-2 11]
[-7 6]]
=====
[[ 6 1]
[-4 7]
[-8 3]]
+
[[0 2]
[2 4]
[1 3]]
=
[[ 6 3]
[-2 11]
[-7 6]]
=====
[[ 6 1]
[-4 7]
[-8 3]]
-
[[0 2]
[2 4]
[1 3]]
=
[[ 6 -1]
[-6 3]
[-9 0]]
=====
6
+
[[ 6 -1]
[-6 3]
[-9 0]]
=
[[ 36 -6]
[-36 18]
[-54 0]]
=====
6
x
[[ 3 0 4]
[-1 2 2]
[ 6 5 -1]]
=
[[18 0 24]
[-6 12 12]
[36 30 -6]]
=====
6
x
[[ 0 -5 -3]
[-5 2 4]
[-3 1 0]]
=
[[ 0 -30 -18]
[-30 12 24]
[-18 6 0]]
=====
[[18 0 24]
[-6 12 12]
[36 30 -6]]
-
[[ 0 -30 -18]
[-30 12 24]
[-18 6 0]]
=
[[ 18 30 42]
[ 24 0 -12]
[ 54 24 -6]]

import numpy as np
Y = np.array([[0,2], [2,4], [1,3]])
R1 = np.dot(5,Y)
print(5, "\nx\n", Y, "\n=\n", R1)

5
x
[[0 2]
[2 4]
[1 3]]
=
[[ 0 10]
[10 20]
[ 5 15]]

import numpy as np
Z = np.array([[6,1], [-4,7], [-8,3]])
R1 = np.dot(3,Z)
print(3, "\nx\n", Z, "\n=\n", R1)

3
x
[[ 6 1]
[-4 7]
[-8 3]]
=
[[ 18 3]
[-12 21]
[-24 9]]

import numpy as np
Y = np.array([[0,2], [2,4], [1,3]])
R1 = np.dot(2,Y)
print(2, "\nx\n", Y, "\n=\n", R1)

2
x
[[0 2]
[2 4]
[1 3]]
=
[[0 4]
[4 8]
[2 6]]
import numpy as np
W = np.array([[3,0,4], [-1,2,2], [6,5,-1]])
R1 = np.dot(4,W)
print(4, "\nx\n", W, "\n=\n", R1)

4
x
[[ 3 0 4]
[-1 2 2]
[ 6 5 -1]]
=
[[12 0 16]
[-4 8 8]
[24 20 -4]]

import numpy as np
Y = np.array([[0,2], [2,4], [1,3]])
Z = np.array([[6,1], [-4,7], [-8,3]])
R1 = np.dot(8,Y)
R2 = np.dot(0,Z)
R3 = np.subtract(R1,R2)
print(8, "\nx\n", Y, "\n=\n", R1)
print("=====")
print(0, "\nx\n", Z, "\n=\n", R2)
print("=====")
print(R1, "\n-\n", R2, "\n=\n", R3)

8
x
[[0 2]
[2 4]
[1 3]]
=
[[ 0 16]
[16 32]
[ 8 24]]
=====
0
x
[[ 6 1]
[-4 7]
[-8 3]]
=
[[0 0]
[0 0]
[0 0]]
=====
[[ 0 16]
[16 32]
[ 8 24]]
-
[[0 0]
[0 0]
[0 0]]
=
[[ 0 16]
[16 32]
[ 8 24]]

import numpy as np
W = np.array([[3,0,4], [-1,2,2], [6,5,-1]])
Y = np.array([[0,2], [2,4], [1,3]])
Z = np.array([[6,1], [-4,7], [-8,3]])
R1 = np.add(W,Y)
R2 = np.substract(R1,Z)
print(W, "\n+\n", Y, "\n=\n", R1)
print("=====")
print(R1, "\n-\n", Z, "\n=\n", R2)

----------------------------------------------------------------------
-----
ValueError Traceback (most recent call
last)
<ipython-input-9-3fe04d4dcfd5> in <module>
3 Y = np.array([[0,2], [2,4], [1,3]])
4 Z = np.array([[6,1], [-4,7], [-8,3]])
----> 5 R1 = np.add(W,Y)
6 R2 = np.substract(R1,Z)
7 print(W, "\n+\n", Y, "\n=\n", R1)

ValueError: operands could not be broadcast together with shapes (3,3)


(3,2)

import numpy as np
Y = np.array([[0,2], [2,4], [1,3]])
Z = np.array([[6,1], [-4,7], [-8,3]])
R1 = np.subtract(Y,Z)
R2 = np.subtract(Z,Y)
print(Y, "\n-\n", Z, "\n=\n", R1)
print("======")
print(Z, "\n-\n", Y, "\n=\n", R2)

[[0 2]
[2 4]
[1 3]]
-
[[ 6 1]
[-4 7]
[-8 3]]
=
[[-6 1]
[ 6 -3]
[ 9 0]]
======
[[ 6 1]
[-4 7]
[-8 3]]
-
[[0 2]
[2 4]
[1 3]]
=
[[ 6 -1]
[-6 3]
[-9 0]]

import numpy as np
X = np.array([[0,-5,-3], [-5,2,4], [-3,1,0]])
Y = np.array([[0,2], [2,4], [1,3]])
Z = np.array([[6,1], [-4,7], [-8,3]])
R1 = np.dot(2,Y)
R2 = np.dot(4,Z)
R3 = np.add(R1,R2)
R4 = np.add(X,R3)
print(2, "\n+\n", Y, "\n=\n", R1)
print("=====")
print(4,, "\n+\n", Z, "\n=\n", R2)
print("=====")
print(R1, "\n+\n", R2, "\n=\n", R3)
print("=====")
print(X, "\n+\n", R3, "\n=\n", R4)

File "<ipython-input-11-7f1e08f5fa5a>", line 11


print(4,, "\n+\n", Z, "\n=\n", R2)
^
SyntaxError: invalid syntax

import numpy as np
W = np.array([[3,0,4], [-1,2,2], [6,5,-1]])
X = np.array([[0,-5,-3], [-5,2,4], [-3,1,0]])
R1 = np.add(W,X)
R2 = np.dot(2,R1)
print(W, "\n+\n", X, "\n=\n", R1)
print("=====")
print(2, "\nx\n", R1, "\n=\n", R2)

[[ 3 0 4]
[-1 2 2]
[ 6 5 -1]]
+
[[ 0 -5 -3]
[-5 2 4]
[-3 1 0]]
=
[[ 3 -5 1]
[-6 4 6]
[ 3 6 -1]]
=====
2
x
[[ 3 -5 1]
[-6 4 6]
[ 3 6 -1]]
=
[[ 6 -10 2]
[-12 8 12]
[ 6 12 -2]]

import numpy as np
W = np.array([[3,0,4], [-1,2,2], [6,5,-1]])
X = np.array([[0,-5,-3], [-5,2,4], [-3,1,0]])
Y = np.array([[0,2], [2,4], [1,3]])
Z = np.array([[6,1], [-4,7], [-8,3]])
R1 = np.dot(2,W)
R2 = np.dot(2,X)
R3 = np.add(R1,R2)
R4 = np.dot(5,W)
R5 = np.dot(0.5,X)
R6 = np.subtract(R4,R5)
print(2, "\nx\n", W, "\n=\n", R1)
print("=====")
print(2, "\nx\n", X, "\n=\n", R2)
print("=====")
print(R1, "\n+\n", R2, "\n=\n", R3)
print("=====")
print(5, "\nx\n", W, "\n=\n", R4)
print("=====")
print(0.5, "\nx\n", X, "\n=\n", R5)
print("=====")
print(R4, "\n-\n", R5, "\n=\n", R6)

2
x
[[ 3 0 4]
[-1 2 2]
[ 6 5 -1]]
=
[[ 6 0 8]
[-2 4 4]
[12 10 -2]]
=====
2
x
[[ 0 -5 -3]
[-5 2 4]
[-3 1 0]]
=
[[ 0 -10 -6]
[-10 4 8]
[ -6 2 0]]
=====
[[ 6 0 8]
[-2 4 4]
[12 10 -2]]
+
[[ 0 -10 -6]
[-10 4 8]
[ -6 2 0]]
=
[[ 6 -10 2]
[-12 8 12]
[ 6 12 -2]]
=====
5
x
[[ 3 0 4]
[-1 2 2]
[ 6 5 -1]]
=
[[15 0 20]
[-5 10 10]
[30 25 -5]]
=====
0.5
x
[[ 0 -5 -3]
[-5 2 4]
[-3 1 0]]
=
[[ 0. -2.5 -1.5]
[-2.5 1. 2. ]
[-1.5 0.5 0. ]]
=====
[[15 0 20]
[-5 10 10]
[30 25 -5]]
-
[[ 0. -2.5 -1.5]
[-2.5 1. 2. ]
[-1.5 0.5 0. ]]
=
[[15. 2.5 21.5]
[-2.5 9. 8. ]
[31.5 24.5 -5. ]]

import numpy as np
a = np.array([2,0,-1])
b = np.array([-4.5,0.8,1.2])
R1 = np.dot(33,a)
R2 = np.dot(4,b)
R3 = np.dot(9,a)
R4 = np.dot(2.25,a)
R5 = np.add(b,R4)
R6 = np.dot(4,R5)
R7 = np.subtract(a,b)
print(33, "\nx\n", a, "\n=\n", R1)
print("=====")
print(4, "\nx\n", b, "\n=\n", R2)
print("=====")
print(9, "\nx\n", a, "\n=\n", R3)
print("=====")
print(22.5, "\nx\n", a, "\n=\n", R4)
print("=====")
print(b, "\n+\n", R4, "\n=\n", R5)
print("=====")
print(4, "\nx\n", R5, "\n=\n", R6)
print("=====")
print(a, "\n-\n", b, "\n=\n", R7)

33
x
[ 2 0 -1]
=
[ 66 0 -33]
=====
4
x
[-4.5 0.8 1.2]
=
[-18. 3.2 4.8]
=====
9
x
[ 2 0 -1]
=
[18 0 -9]
=====
22.5
x
[ 2 0 -1]
=
[ 4.5 0. -2.25]
=====
[-4.5 0.8 1.2]
+
[ 4.5 0. -2.25]
=
[ 0. 0.8 -1.05]
=====
4
x
[ 0. 0.8 -1.05]
=
[ 0. 3.2 -4.2]
=====
[ 2 0 -1]
-
[-4.5 0.8 1.2]
=
[ 6.5 -0.8 -2.2]

import numpy as np
W = np.array([[3,0,4], [-1,2,2], [6,5,-1]])
X = np.array([[0,-5,-3], [-5,2,4], [-3,2,0]])
Y = np.array([[0,2], [2,4], [1,3]])
Z = np.array([[6,1], [-4,7], [-8,3]])
a = np.array([2,0,-1])
b = np.array([-4.5,0.8,1.2])
R1 = np.dot(W,X)
R2 = np.dot(X,Y)
R3 = np.dot(X,b)
R4 = np.dot(W,a)
print(W, "\nx\n", X, "\n=\n", R1)
print("=====")
print(X, "\nx\n", Y, "\n=\n", R2)
print("=====")
print(X, "\nx\n", b, "\n=\n", R3)
print("=====")
print(W, "\nx\n", a, "\n=\n", R4)

[[ 3 0 4]
[-1 2 2]
[ 6 5 -1]]
x
[[ 0 -5 -3]
[-5 2 4]
[-3 2 0]]
=
[[-12 -7 -9]
[-16 13 11]
[-22 -22 2]]
=====
[[ 0 -5 -3]
[-5 2 4]
[-3 2 0]]
x
[[0 2]
[2 4]
[1 3]]
=
[[-13 -29]
[ 8 10]
[ 4 2]]
=====
[[ 0 -5 -3]
[-5 2 4]
[-3 2 0]]
x
[-4.5 0.8 1.2]
=
[-7.6 28.9 15.1]
=====
[[ 3 0 4]
[-1 2 2]
[ 6 5 -1]]
x
[ 2 0 -1]
=
[ 2 -4 13]

import numpy as np
W = np.array([[3,0,4], [-1,2,2], [6,5,-1]])
X = np.array([[0,-5,-3], [-5,2,4], [-3,2,0]])
Y = np.array([[0,2], [2,4], [1,3]])
Z = np.array([[6,1], [-4,7], [-8,3]])
a = np.array([2,0,-1])
b = np.array([-4.5,0.8,1.2])
R1 = np.dot(Y,Z)
R2 = np.dot(Y,b)
R3 = np.dot(a,b)
print(Y, "\nx\n", Z, "\n=\n", R1)
print("=====")
print(Y, "\nx\n", b, "\n=\n", R2)
print("=====")
print(a, "\nx\n", b, "\n=\n", R3)

----------------------------------------------------------------------
-----
ValueError Traceback (most recent call
last)
<ipython-input-30-a34b2356f0be> in <module>
6 a = np.array([2,0,-1])
7 b = np.array([-4.5,0.8,1.2])
----> 8 R1 = np.dot(Y,Z)
9 R2 = np.dot(Y,b)
10 R3 = np.dot(a,b)

<__array_function__ internals> in dot(*args, **kwargs)

ValueError: shapes (3,2) and (3,2) not aligned: 2 (dim 1) != 3 (dim 0)

import numpy as np
W = np.array([[3,0,4], [-1,2,2], [6,5,-1]])
X = np.array([[0,-5,-3], [-5,2,4], [-3,2,0]])
Y = np.array([[0,2], [2,4], [1,3]])
Z = np.array([[6,1], [-4,7], [-8,3]])
a = np.array([2,0,-1])
b = np.array([-4.5,0.8,1.2])
R1 = np.dot(X,Z)
print(X, "\nx\n", Z, "\n=\n", R1)

[[ 0 -5 -3]
[-5 2 4]
[-3 2 0]]
x
[[ 6 1]
[-4 7]
[-8 3]]
=
[[ 44 -44]
[-70 21]
[-26 11]]

import numpy as np
W = np.array([[3,0,4], [-1,2,2], [6,5,-1]])
X = np.array([[0,-5,-3], [-5,2,4], [-3,2,0]])
Y = np.array([[0,2], [2,4], [1,3]])
Z = np.array([[6,1], [-4,7], [-8,3]])
a = np.array([2,0,-1])
b = np.array([-4.5,0.8,1.2])
R1 = np.dot(b,a)
print(b, "\nx\n", a, "\n=\n", R1)

[-4.5 0.8 1.2]


x
[ 2 0 -1]
=
-10.2

import numpy as np
W = np.array([[3,0,4], [-1,2,2], [6,5,-1]])
X = np.array([[0,-5,-3], [-5,2,4], [-3,2,0]])
Y = np.array([[0,2], [2,4], [1,3]])
Z = np.array([[6,1], [-4,7], [-8,3]])
a = np.array([2,0,-1])
b = np.array([-4.5,0.8,1.2])
R1 = np.dot(b,X)
print(b, "\nx\n", X, "\n=\n", R1)

[-4.5 0.8 1.2]


x
[[ 0 -5 -3]
[-5 2 4]
[-3 2 0]]
=
[-7.6 26.5 16.7]

import numpy as np
W = np.array([[3,0,4], [-1,2,2], [6,5,-1]])
X = np.array([[0,-5,-3], [-5,2,4], [-3,2,0]])
Y = np.array([[0,2], [2,4], [1,3]])
Z = np.array([[6,1], [-4,7], [-8,3]])
a = np.array([2,0,-1])
b = np.array([-4.5,0.8,1.2])
R1 = np.dot(a,W)
print(a, "\nx\n", W, "\n=\n", R1)

[ 2 0 -1]
x
[[ 3 0 4]
[-1 2 2]
[ 6 5 -1]]
=
[ 0 -5 9]
import numpy as np
P = 30
L = 3
R1 = np.dot(P,L)
R2 = (R1/8)
print(P, "\nx\n", L, "\n=\n", R1)
print(R1, "\n/\n", 8, "\n=\n", R2)

30
x
3
=
90
90
/
8
=
11.25

import numpy as np
q = 10
L = 8.5
R1 = np.dot(2,L)
R2 = np.dot(q,R1)
R3 = (R2/12)
print(2, "\nx\n", L, "\n=\n", R1)
print(q, "\nx\n", R1, "\n=\n", R2)
print(R2, "\n/\n", 12, "\n=\n", R3)

2
x
8.5
=
17.0
10
x
17.0
=
170.0
170.0
/
12
=
14.166666666666666

import numpy as np
q = 10
L = 11
R1 = np.dot(2,L)
R2 = np.dot(q,R1)
R3 = (R2/12)
print(2, "\nx\n", L, "\n=\n", R1)
print(q, "\nx\n", R1, "\n=\n", R2)
print(R2, "\n/\n", 12, "\n=\n", R3)

2
x
11
=
22
10
x
22
=
220
220
/
12
=
18.333333333333332

import numpy as np
EI1 = np.array([[11.25, 14.17], [14.17, 11.25]])
EI2 = np.array([[14.17, 18.33], [18.33, 14.17]])
print(EI1)
print("=====")
print(EI2)

[[11.25 14.17]
[14.17 11.25]]
=====
[[14.17 18.33]
[18.33 14.17]]

import numpy as np
EI = np.array([[11.25, 14.17, 0], [14.17, 29.58, 11.25], [0, 11.25,
18.33]])
d_EI = np.linalg.inv(EI)
print(EI, "\n=====\n |invers| \n=====\n", d_EI, "\n")

[[11.25 14.17 0. ]
[14.17 29.58 11.25]
[ 0. 11.25 18.33]]
=====
|invers|
=====
[[ 0.41752734 -0.2609162 0.16013678]
[-0.2609162 0.20714942 -0.12713753]
[ 0.16013678 -0.12713753 0.13258577]]
import numpy as np
edof = np.array([[1,2,3,4,5,6], [4,5,6,7,8,9], [7,8,9,10,11,12]])
print(edof)

[[ 1 2 3 4 5 6]
[ 4 5 6 7 8 9]
[ 7 8 9 10 11 12]]
pip install calfem-python

Looking in indexes: https://pypi.org/simple, https://us-


python.pkg.dev/colab-wheels/public/simple/
Collecting calfem-python
Downloading calfem_python-3.6.3-py3-none-any.whl (169 kB)
ent already satisfied: matplotlib in /usr/local/lib/python3.7/dist-
packages (from calfem-python) (3.2.2)
Requirement already satisfied: scipy in /usr/local/lib/python3.7/dist-
packages (from calfem-python) (1.7.3)
Collecting pyvtk
Downloading PyVTK-0.5.18.zip (31 kB)
Requirement already satisfied: tabulate in
/usr/local/lib/python3.7/dist-packages (from calfem-python) (0.8.10)
Collecting visvis
Downloading visvis-1.13.0.tar.gz (5.1 MB)
sh
Downloading gmsh-4.11.0-py2.py3-none-manylinux1_x86_64.whl (41.3 MB)
ent already satisfied: numpy in /usr/local/lib/python3.7/dist-packages
(from calfem-python) (1.21.6)
Requirement already satisfied: cycler>=0.10 in
/usr/local/lib/python3.7/dist-packages (from matplotlib->calfem-
python) (0.11.0)
Requirement already satisfied: python-dateutil>=2.1 in
/usr/local/lib/python3.7/dist-packages (from matplotlib->calfem-
python) (2.8.2)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!
=2.1.6,>=2.0.1 in /usr/local/lib/python3.7/dist-packages (from
matplotlib->calfem-python) (3.0.9)
Requirement already satisfied: kiwisolver>=1.0.1 in
/usr/local/lib/python3.7/dist-packages (from matplotlib->calfem-
python) (1.4.4)
Requirement already satisfied: typing-extensions in
/usr/local/lib/python3.7/dist-packages (from kiwisolver>=1.0.1-
>matplotlib->calfem-python) (4.1.1)
Requirement already satisfied: six>=1.5 in
/usr/local/lib/python3.7/dist-packages (from python-dateutil>=2.1-
>matplotlib->calfem-python) (1.15.0)
Requirement already satisfied: packaging in
/usr/local/lib/python3.7/dist-packages (from qtpy->calfem-python)
(21.3)
Collecting vtk
Downloading vtk-9.2.2-cp37-cp37m-
manylinux_2_17_x86_64.manylinux2014_x86_64.whl (79.3 MB)
ent already satisfied: wrapt<2,>=1.10 in
/usr/local/lib/python3.7/dist-packages (from Deprecated->vedo->calfem-
python) (1.14.1)
Requirement already satisfied: pyOpenGl in
/usr/local/lib/python3.7/dist-packages (from visvis->calfem-python)
(3.1.6)
Collecting wslink>=1.0.4
Downloading wslink-1.9.1-py3-none-any.whl (28 kB)
Requirement already satisfied: aiohttp<4 in
/usr/local/lib/python3.7/dist-packages (from wslink>=1.0.4->vtk->vedo-
>calfem-python) (3.8.3)
Requirement already satisfied: yarl<2.0,>=1.0 in
/usr/local/lib/python3.7/dist-packages (from aiohttp<4->wslink>=1.0.4-
>vtk->vedo->calfem-python) (1.8.1)
Requirement already satisfied: charset-normalizer<3.0,>=2.0 in
/usr/local/lib/python3.7/dist-packages (from aiohttp<4->wslink>=1.0.4-
>vtk->vedo->calfem-python) (2.1.1)
Requirement already satisfied: frozenlist>=1.1.1 in
/usr/local/lib/python3.7/dist-packages (from aiohttp<4->wslink>=1.0.4-
>vtk->vedo->calfem-python) (1.3.1)
Requirement already satisfied: asynctest==0.13.0 in
/usr/local/lib/python3.7/dist-packages (from aiohttp<4->wslink>=1.0.4-
>vtk->vedo->calfem-python) (0.13.0)
Requirement already satisfied: async-timeout<5.0,>=4.0.0a3 in
/usr/local/lib/python3.7/dist-packages (from aiohttp<4->wslink>=1.0.4-
>vtk->vedo->calfem-python) (4.0.2)
Requirement already satisfied: multidict<7.0,>=4.5 in
/usr/local/lib/python3.7/dist-packages (from aiohttp<4->wslink>=1.0.4-
>vtk->vedo->calfem-python) (6.0.2)
Requirement already satisfied: aiosignal>=1.1.2 in
/usr/local/lib/python3.7/dist-packages (from aiohttp<4->wslink>=1.0.4-
>vtk->vedo->calfem-python) (1.2.0)
Requirement already satisfied: attrs>=17.3.0 in
/usr/local/lib/python3.7/dist-packages (from aiohttp<4->wslink>=1.0.4-
>vtk->vedo->calfem-python) (22.1.0)
Requirement already satisfied: idna>=2.0 in
/usr/local/lib/python3.7/dist-packages (from yarl<2.0,>=1.0-
>aiohttp<4->wslink>=1.0.4->vtk->vedo->calfem-python) (2.10)
Building wheels for collected packages: pyvtk, vedo, visvis
Building wheel for pyvtk (setup.py) ... e=PyVTK-0.5.18-py3-none-
any.whl size=24735
sha256=1c511250ae53b03055a0a91e2de05e7bb9f9e16666e1bbef202eb9086243cf4
b
Stored in directory:
/root/.cache/pip/wheels/83/bb/df/9d8af5e23c0eb53cc886ded8ce7765973ddc7
442423cf7890c
Building wheel for vedo (setup.py) ... e=vedo-2022.4.1-py3-none-
any.whl size=15441603
sha256=386c7fc2194c9e82e714fff5d48a638ba6f815d47cd1aeba3adb66493c84541
2
Stored in directory:
/root/.cache/pip/wheels/e0/06/bc/9f88c779594fbe283225203fc2a209f17b5ba
91e39eced7efe
Building wheel for visvis (setup.py) ... e=visvis-1.13.0-py3-none-
any.whl size=4905512
sha256=66ad17ce25db1d110c99d38f3ce85b2f58caf9622d3f503d8c581af14d83d3b
4
Stored in directory:
/root/.cache/pip/wheels/9a/f2/44/b8615cca361ce9196cd44e960ad4216265b30
ebe6d8afb6b58
Successfully built pyvtk vedo visvis
Installing collected packages: wslink, vtk, Deprecated, visvis, vedo,
qtpy, pyvtk, gmsh, calfem-python
Successfully installed Deprecated-1.2.13 calfem-python-3.6.3 gmsh-
4.11.0 pyvtk-0.5.18 qtpy-2.2.1 vedo-2022.4.1 visvis-1.13.0 vtk-9.2.2
wslink-1.9.1

import calfem.core as cfc


import numpy as np
edof1 = np.array([[1,2,3,4,5,6], [4,5,6,7,8,9], [7,8,9,10,11,12],
[10,11,12,13,14,15]])
print(edof1)

[[ 1 2 3 4 5 6]
[ 4 5 6 7 8 9]
[ 7 8 9 10 11 12]
[10 11 12 13 14 15]]

import numpy as np
# Stiffness matrix K and load vector f
K = np.mat(np.zeros((15, 15)))
f = np.mat(np.zeros((15, 1)))
f[5] = -30000
f[11] = -50000
E = 1
A = 45.3e-4
I = 1
ep = np.array([E, A,I])
ex = np.array([0, 3]); ex2 = np.array([3, 6]); ex3 = np.array([6,
11]);
ey = np.array([0, 0]); ey2 = np.array([0, 0]); ey3 = np.array([0, 0])
Ke = cfc.beam2e(ex, ey, ep)
Ke2 = cfc.beam2e(ex2, ey2, ep)
Ke3 = cfc.beam2e(ex3, ey3, ep)
print('Hasil Ke')
print(Ke)
print("")
print('Hasil Ke2')
print(Ke2)
print("")
print('Hasil Ke3')
print(Ke3)

Hasil Ke
[[ 0.00151 0. 0. -0.00151 0. 0.
]
[ 0. 0.44444444 0.66666667 0. -0.44444444
0.66666667]
[ 0. 0.66666667 1.33333333 0. -0.66666667
0.66666667]
[-0.00151 0. 0. 0.00151 0. 0.
]
[ 0. -0.44444444 -0.66666667 0. 0.44444444 -
0.66666667]
[ 0. 0.66666667 0.66666667 0. -0.66666667
1.33333333]]

Hasil Ke2
[[ 0.00151 0. 0. -0.00151 0. 0.
]
[ 0. 0.44444444 0.66666667 0. -0.44444444
0.66666667]
[ 0. 0.66666667 1.33333333 0. -0.66666667
0.66666667]
[-0.00151 0. 0. 0.00151 0. 0.
]
[ 0. -0.44444444 -0.66666667 0. 0.44444444 -
0.66666667]
[ 0. 0.66666667 0.66666667 0. -0.66666667
1.33333333]]

Hasil Ke3
[[ 0.000906 0. 0. -0.000906 0. 0. ]
[ 0. 0.096 0.24 0. -0.096 0.24 ]
[ 0. 0.24 0.8 0. -0.24 0.4 ]
[-0.000906 0. 0. 0.000906 0. 0. ]
[ 0. -0.096 -0.24 0. 0.096 -0.24 ]
[ 0. 0.24 0.4 0. -0.24 0.8 ]]
Hasil Ke
[[ 0.00151 0. 0. -0.00151 0. 0.
]
[ 0. 0.44444444 0.66666667 0. -0.44444444
0.66666667]
[ 0. 0.66666667 1.33333333 0. -0.66666667
0.66666667]
[-0.00151 0. 0. 0.00151 0. 0.
]
[ 0. -0.44444444 -0.66666667 0. 0.44444444 -
0.66666667]
[ 0. 0.66666667 0.66666667 0. -0.66666667
1.33333333]]

Hasil Ke2
[[ 0.00151 0. 0. -0.00151 0. 0.
]
[ 0. 0.44444444 0.66666667 0. -0.44444444
0.66666667]
[ 0. 0.66666667 1.33333333 0. -0.66666667
0.66666667]
[-0.00151 0. 0. 0.00151 0. 0.
]
[ 0. -0.44444444 -0.66666667 0. 0.44444444 -
0.66666667]
[ 0. 0.66666667 0.66666667 0. -0.66666667
1.33333333]]

Hasil Ke3
[[ 0.000906 0. 0. -0.000906 0. 0. ]
[ 0. 0.096 0.24 0. -0.096 0.24 ]
[ 0. 0.24 0.8 0. -0.24 0.4 ]
[-0.000906 0. 0. 0.000906 0. 0. ]
[ 0. -0.096 -0.24 0. 0.096 -0.24 ]
[ 0. 0.24 0.4 0. -0.24 0.8 ]]

# Assemble Ke into K
K = cfc.assem(edof1, K, Ke)
K = cfc.assem(edof1, K, Ke2)
K = cfc.assem(edof1, K, Ke3)
# Solve the system equations and compute support forces
bc = np.array([1, 2, 8, 14])
(a, r) = cfc.solveq(K, f, bc)
# Section Forces
ed = cfc.extract_ed(edof1, a)
es1, ed1, ec1 = cfc.beam2s(ex, ey, ep, ed[0, :], nep=10)
es2, ed2, ec2 = cfc.beam2s(ex2, ey2, ep, ed[1, :], nep=10)
es3, ed3, ec3 = cfc.beam2s(ex3, ey3, ep, ed[2, :], nep=10)
# Results
print("displacement(a)=")
print(a)
print("")
print("support force (r)=")
print(r)
print("")
print("es1=")
print(es1)
print("")
print("es2=")
print(es2)
print("")
print("es3=")
print(es3)
print("")
print("ed1=")
print(ed1)
print("")
print("ed2=")
print(ed2)
print("")
print("ed3=")
print(ed3)

displacement(a)=
[[ 0. ]
[ 0. ]
[ 2439.01485943]
[ 0. ]
[-1123.93321593]
[-5898.21525332]
[ 0. ]
[ 0. ]
[ 3846.15384615]
[ 0. ]
[-1123.93321593]
[-9486.4001313 ]
[ 0. ]
[ 0. ]
[ 5253.29283288]]

support force (r)=


[[ 0.00000000e+00]
[-4.33552595e+03]
[ 0.00000000e+00]
[ 0.00000000e+00]
[-3.63797881e-12]
[ 3.63797881e-12]
[ 0.00000000e+00]
[-3.43151220e+03]
[ 0.00000000e+00]
[ 0.00000000e+00]
[ 3.63797881e-12]
[-1.45519152e-11]
[ 0.00000000e+00]
[ 7.76703815e+03]
[ 0.00000000e+00]]

es1=
[[ 0. 1806.60772218 -69.16512098]
[ 0. 1806.60772218 -671.36769504]
[ 0. 1806.60772218 -1273.5702691 ]
[ 0. 1806.60772218 -1875.77284316]
[ 0. 1806.60772218 -2477.97541722]
[ 0. 1806.60772218 -3080.17799128]
[ 0. 1806.60772218 -3682.38056534]
[ 0. 1806.60772218 -4284.5831394 ]
[ 0. 1806.60772218 -4886.78571346]
[ 0. 1806.60772218 -5488.98828752]
[ 0. 1806.60772218 -6091.19086158]]
es2=
[[ 0. 1867.56681186 6049.47325094]
[ 0. 1867.56681186 5426.95098032]
[ 0. 1867.56681186 4804.42870971]
[ 0. 1867.56681186 4181.90643909]
[ 0. 1867.56681186 3559.38416847]
[ 0. 1867.56681186 2936.86189785]
[ 0. 1867.56681186 2314.33962723]
[ 0. 1867.56681186 1691.81735661]
[ 0. 1867.56681186 1069.29508599]
[ 0. 1867.56681186 446.77281537]
[ 0. 1867.56681186 -175.74945525]]

es3=
[[ 0. 1245.7615197 447.89300377]
[ 0. 1245.7615197 -244.1967294 ]
[ 0. 1245.7615197 -936.28646257]
[ 0. 1245.7615197 -1628.37619574]
[ 0. 1245.7615197 -2320.46592891]
[ 0. 1245.7615197 -3012.55566207]
[ 0. 1245.7615197 -3704.64539524]
[ 0. 1245.7615197 -4396.73512841]
[ 0. 1245.7615197 -5088.82486158]
[ 0. 1245.7615197 -5780.91459475]]

ed1=
[[ 0. 0. ]
[ 0. 798.0105469 ]
[ 0. 1521.42468324]
[ 0. 2103.33101191]
[ 0. 2476.81813578]
[ 0. 2574.97465773]
[ 0. 2330.88918066]
[ 0. 1677.65030743]
[ 0. 548.34664094]
[ 0. -1123.93321593]
[ 0. -3406.10066031]]

ed2=
[[ 0.00000000e+00 -1.12393322e+03]
[ 0.00000000e+00 -2.76545131e+03]
[ 0.00000000e+00 -3.80397485e+03]
[ 0.00000000e+00 -4.30867298e+03]
[ 0.00000000e+00 -4.34871484e+03]
[ 0.00000000e+00 -3.99326956e+03]
[ 0.00000000e+00 -3.31150630e+03]
[ 0.00000000e+00 -2.37259419e+03]
[ 0.00000000e+00 -1.24570238e+03]
[ 0.00000000e+00 7.27595761e-12]
[ 0.00000000e+00 1.29534380e+03]]

ed3=
[[ 0. 0. ]
[ 0. 2170.27010374]
[ 0. 4265.17084654]
[ 0. 6071.09428609]
[ 0. 7374.43248004]
[ 0. 7961.57748606]
[ 0. 7618.92136181]
[ 0. 6132.85616495]
[ 0. 3289.77395315]
[ 0. -1123.93321593]]

import calfem.core as cfc


import numpy as np
edof2 = np.array([[1,2,3,4,5,6], [4,5,6,7,8,9], [7,8,9,10,11,12],])
print(edof2)

[[ 1 2 3 4 5 6]
[ 4 5 6 7 8 9]
[ 7 8 9 10 11 12]]

import numpy as np
# Stiffness matrix K and load vector f
K = np.mat(np.zeros((12, 12)))
f = np.mat(np.zeros((12, 1)))
f[5] = -120000
E = 2e11
A = 45.3e-4
I = 3200e-6
ep = np.array([E, A,I])
ex = np.array([0, 3]); ex2 = np.array([3, 6]); ex3 = np.array([6,
12]);
ey = np.array([0, 0]); ey2 = np.array([0, 0]); ey3 = np.array([0, 0]);
Ke = cfc.beam2e(ex, ey, ep)
Ke2 = cfc.beam2e(ex2, ey2, ep)
Ke3 = cfc.beam2e(ex3, ey3, ep)
print('Hasil Ke')
print(Ke)
print("")
print('Hasil Ke2')
print(Ke2)
print("")
print('Hasil Ke3')
print(Ke3)

Hasil Ke
[[ 3.02000000e+08 0.00000000e+00 0.00000000e+00 -3.02000000e+08
0.00000000e+00 0.00000000e+00]
[ 0.00000000e+00 2.84444444e+08 4.26666667e+08 0.00000000e+00
-2.84444444e+08 4.26666667e+08]
[ 0.00000000e+00 4.26666667e+08 8.53333333e+08 0.00000000e+00
-4.26666667e+08 4.26666667e+08]
[-3.02000000e+08 0.00000000e+00 0.00000000e+00 3.02000000e+08
0.00000000e+00 0.00000000e+00]
[ 0.00000000e+00 -2.84444444e+08 -4.26666667e+08 0.00000000e+00
2.84444444e+08 -4.26666667e+08]
[ 0.00000000e+00 4.26666667e+08 4.26666667e+08 0.00000000e+00
-4.26666667e+08 8.53333333e+08]]

Hasil Ke2
[[ 3.02000000e+08 0.00000000e+00 0.00000000e+00 -3.02000000e+08
0.00000000e+00 0.00000000e+00]
[ 0.00000000e+00 2.84444444e+08 4.26666667e+08 0.00000000e+00
-2.84444444e+08 4.26666667e+08]
[ 0.00000000e+00 4.26666667e+08 8.53333333e+08 0.00000000e+00
-4.26666667e+08 4.26666667e+08]
[-3.02000000e+08 0.00000000e+00 0.00000000e+00 3.02000000e+08
0.00000000e+00 0.00000000e+00]
[ 0.00000000e+00 -2.84444444e+08 -4.26666667e+08 0.00000000e+00
2.84444444e+08 -4.26666667e+08]
[ 0.00000000e+00 4.26666667e+08 4.26666667e+08 0.00000000e+00
-4.26666667e+08 8.53333333e+08]]

Hasil Ke3
[[ 1.51000000e+08 0.00000000e+00 0.00000000e+00 -1.51000000e+08
0.00000000e+00 0.00000000e+00]
[ 0.00000000e+00 3.55555556e+07 1.06666667e+08 0.00000000e+00
-3.55555556e+07 1.06666667e+08]
[ 0.00000000e+00 1.06666667e+08 4.26666667e+08 0.00000000e+00
-1.06666667e+08 2.13333333e+08]
[-1.51000000e+08 0.00000000e+00 0.00000000e+00 1.51000000e+08
0.00000000e+00 0.00000000e+00]
[ 0.00000000e+00 -3.55555556e+07 -1.06666667e+08 0.00000000e+00
3.55555556e+07 -1.06666667e+08]
[ 0.00000000e+00 1.06666667e+08 2.13333333e+08 0.00000000e+00
-1.06666667e+08 4.26666667e+08]]

# Assemble Ke into K
K = cfc.assem(edof2, K, Ke)
K = cfc.assem(edof2, K, Ke2)
K = cfc.assem(edof2, K, Ke3)
# Solve the system equations and compute support forces
bc = np.array([1, 2, 3, 8, 11])
(a, r) = cfc.solveq(K, f, bc)
# Section Forces
ed = cfc.extract_ed(edof2, a)
es1, ed1, ec1 = cfc.beam2s(ex, ey, ep, ed[0, :], nep=10)
es2, ed2, ec2 = cfc.beam2s(ex2, ey2, ep, ed[1, :], nep=10)
es3, ed3, ec3 = cfc.beam2s(ex3, ey3, ep, ed[2, :], nep=10)
# Results
print("displacement(a)=")
print(a)
print("")
print("support force (r)=")
print(r)
print("")
print("es1=")
print(es1)
print("")
print("es2=")
print(es2)
print("")
print("es3=")
print(es3)
print("")
print("ed1=")
print(ed1)
print("")
print("ed2=")
print(ed2)
print("")
print("ed3=")
print(ed3)

displacement(a)=
[[ 0.00000000e+00]
[ 0.00000000e+00]
[ 0.00000000e+00]
[ 0.00000000e+00]
[-8.80945476e-06]
[-3.08983469e-05]
[ 0.00000000e+00]
[ 0.00000000e+00]
[ 1.10933875e-05]
[ 0.00000000e+00]
[ 0.00000000e+00]
[-5.54669374e-06]]

support force (r)=


[[ 0.00000000e+00]
[-2.43375870e+04]
[-2.45011601e+04]
[ 0.00000000e+00]
[-6.13689655e-13]
[ 0.00000000e+00]
[ 0.00000000e+00]
[ 2.96624130e+04]
[ 0.00000000e+00]
[ 0.00000000e+00]
[-5.32482599e+03]
[ 0.00000000e+00]]

es1=
[[ 0. 10677.49419954 9424.59396752]
[ 0. 10677.49419954 5865.42923434]
[ 0. 10677.49419954 2306.26450116]
[ 0. 10677.49419954 -1252.90023202]
[ 0. 10677.49419954 -4812.0649652 ]
[ 0. 10677.49419954 -8371.22969838]
[ 0. 10677.49419954 -11930.39443155]
[ 0. 10677.49419954 -15489.55916473]
[ 0. 10677.49419954 -19048.72389791]
[ 0. 10677.49419954 -22607.88863109]
[ 0. 10677.49419954 -26167.05336427]]

es2=
[[ 0. 10955.91647332 25392.11136891]
[ 0. 10955.91647332 21740.13921114]
[ 0. 10955.91647332 18088.16705336]
[ 0. 10955.91647332 14436.19489559]
[ 0. 10955.91647332 10784.22273782]
[ 0. 10955.91647332 7132.25058005]
[ 0. 10955.91647332 3480.27842227]
[ 0. 10955.91647332 -171.6937355 ]
[ 0. 10955.91647332 -3823.66589327]
[ 0. 10955.91647332 -7475.63805104]
[ 0. 10955.91647332 -11127.61020882]]

es3=
[[ 0.00000000e+00 -5.91647332e+02 -3.54988399e+03]
[ 0.00000000e+00 -5.91647332e+02 -3.15545244e+03]
[ 0.00000000e+00 -5.91647332e+02 -2.76102088e+03]
[ 0.00000000e+00 -5.91647332e+02 -2.36658933e+03]
[ 0.00000000e+00 -5.91647332e+02 -1.97215777e+03]
[ 0.00000000e+00 -5.91647332e+02 -1.57772622e+03]
[ 0.00000000e+00 -5.91647332e+02 -1.18329466e+03]
[ 0.00000000e+00 -5.91647332e+02 -7.88863109e+02]
[ 0.00000000e+00 -5.91647332e+02 -3.94431555e+02]
[ 0.00000000e+00 -5.91647332e+02 -5.42101086e-13]
[ 0.00000000e+00 -5.91647332e+02 3.94431555e+02]]

ed1=
[[ 0.00000000e+00 0.00000000e+00]
[ 0.00000000e+00 7.15122025e-07]
[ 0.00000000e+00 2.44854774e-06]
[ 0.00000000e+00 4.58236659e-06]
[ 0.00000000e+00 6.49866804e-06]
[ 0.00000000e+00 7.57954155e-06]
[ 0.00000000e+00 7.20707657e-06]
[ 0.00000000e+00 4.76336255e-06]
[ 0.00000000e+00 -3.69511042e-07]
[ 0.00000000e+00 -8.80945476e-06]
[ 0.00000000e+00 -2.11743791e-05]]

ed2=
[[ 0.00000000e+00 -8.80945476e-06]
[ 0.00000000e+00 -1.70103979e-05]
[ 0.00000000e+00 -2.14370113e-05]
[ 0.00000000e+00 -2.27233179e-05]
[ 0.00000000e+00 -2.15033406e-05]
[ 0.00000000e+00 -1.84111025e-05]
[ 0.00000000e+00 -1.40806265e-05]
[ 0.00000000e+00 -9.14593538e-06]
[ 0.00000000e+00 -4.24105225e-06]
[ 0.00000000e+00 2.71050543e-20]
[ 0.00000000e+00 2.94319842e-06]]

ed3=
[[ 0.00000000e+00 0.00000000e+00]
[ 0.00000000e+00 6.20864484e-06]
[ 0.00000000e+00 1.02260033e-05]
[ 0.00000000e+00 1.23259861e-05]
[ 0.00000000e+00 1.27825041e-05]
[ 0.00000000e+00 1.18694681e-05]
[ 0.00000000e+00 9.86078886e-06]
[ 0.00000000e+00 7.03037724e-06]
[ 0.00000000e+00 3.65214402e-06]
[ 0.00000000e+00 1.35525272e-20]
[ 0.00000000e+00 -3.65214402e-06]]

You might also like