Difference between revisions of "John Audrick"
John Audrick (talk | contribs) (→Minggu 1 (11 November 2020)) |
John Audrick (talk | contribs) (→Minggu 1 (11 November 2020)) |
||
Line 63: | Line 63: | ||
class TrussPR | class TrussPR | ||
− | parameter Integer N=8; | + | parameter Integer N=8; |
− | parameter Real A=0.001; | + | parameter Real A=0.001; |
− | parameter Real E=200*10e9; | + | parameter Real E=200*10e9; |
− | Real KG[N,N]; //ukuran matriks (global) | + | Real KG[N,N]; //ukuran matriks (global) |
− | Real KGinitial[N,N]; | + | Real KGinitial[N,N]; |
− | Real Sol[N]; | + | Real Sol[N]; |
− | Real X[N]={0,0,-1035.2762,-3863.7033,0,0,-1035.2762,-3863.7033}; | + | Real X[N]={0,0,-1035.2762,-3863.7033,0,0,-1035.2762,-3863.7033}; |
− | Real R[N]; | + | Real R[N]; |
− | Real SolMat[N,1]; | + | Real SolMat[N,1]; |
− | Real XMat[N,1]; | + | Real XMat[N,1]; |
− | Real L1 = 1; | + | Real L1 = 1; |
− | Real L2 = 1; | + | Real L2 = 1; |
− | Real L3 = 1.6; | + | Real L3 = 1.6; |
− | Real L4 = 1.25; | + | Real L4 = 1.25; |
− | Real L5 = 1.6; | + | Real L5 = 1.6; |
− | Real teta1 =degtorad(0); | + | Real teta1 =degtorad(0); |
− | Real teta2 =degtorad(0); | + | Real teta2 =degtorad(0); |
− | Real teta3 =degtorad(231.34); | + | Real teta3 =degtorad(231.34); |
− | Real teta4 =degtorad(270); | + | Real teta4 =degtorad(270); |
− | Real teta5 =degtorad(308.66); | + | Real teta5 =degtorad(308.66); |
− | //boundary condition | + | //boundary condition |
− | Integer b1=1; | + | Integer b1=1; |
− | Integer b2=3; | + | Integer b2=3; |
− | //Truss 1 | + | //Truss 1 |
− | parameter Real X1=0; | + | parameter Real X1=0; |
− | Real k1=A*E/1; | + | Real k1=A*E/1; |
− | Real K1[4,4]; | + | Real K1[4,4]; |
− | Integer p1a = 1; | + | Integer p1a = 1; |
− | Integer p1b = 2; | + | Integer p1b = 2; |
− | Real KG1[N,N]; | + | Real KG1[N,N]; |
− | //truss 2 | + | //truss 2 |
− | parameter Real X2=0; | + | parameter Real X2=0; |
− | Real k2=A*E/1; | + | Real k2=A*E/1; |
− | Real K2[4,4]; | + | Real K2[4,4]; |
− | Integer p2a=2; | + | Integer p2a=2; |
− | Integer p2b=3; | + | Integer p2b=3; |
− | Real KG2[N,N]; | + | Real KG2[N,N]; |
− | //truss 3 | + | //truss 3 |
− | parameter Real X3=90; | + | parameter Real X3=90; |
− | Real k3=A*E/1.25; | + | Real k3=A*E/1.25; |
− | Real K3[4,4]; | + | Real K3[4,4]; |
− | Integer p3a=2; | + | Integer p3a=2; |
− | Integer p3b=4; | + | Integer p3b=4; |
− | Real KG3[N,N]; | + | Real KG3[N,N]; |
− | //truss 4 | + | //truss 4 |
− | parameter Real X4=90+38.6598; | + | parameter Real X4=90+38.6598; |
− | Real k4=A*E/1.6; | + | Real k4=A*E/1.6; |
− | Real K4[4,4]; | + | Real K4[4,4]; |
− | Integer p4a=1; | + | Integer p4a=1; |
− | Integer p4b=4; | + | Integer p4b=4; |
− | Real KG4[N,N]; | + | Real KG4[N,N]; |
+ | |||
+ | //truss 5 | ||
+ | parameter Real X5=90-38.6598; | ||
+ | Real k5=A*E/1.6; | ||
+ | Real K5[4,4]; | ||
+ | Integer p5a=3; | ||
+ | Integer p5b=4; | ||
+ | Real KG5[N,N]; | ||
+ | |||
+ | algorithm | ||
+ | //creating global matrice | ||
+ | K1:=Stiffness_Matrices(X1); | ||
+ | G1:=k1*Local_Global(K1,N,p1a,p1b); | ||
− | + | K2:=Stiffness_Matrices(X2); | |
− | + | G2:=k2*Local_Global(K2,N,p2a,p2b); | |
− | + | ||
− | + | K3:=Stiffness_Matrices(X3); | |
− | + | G3:=k3*Local_Global(K3,N,p3a,p3b); | |
− | |||
− | |||
− | + | K4:=Stiffness_Matrices(X4); | |
− | + | G4:=k4*Local_Global(K4,N,p4a,p4b); | |
− | + | ||
− | + | K5:=Stiffness_Matrices(X5); | |
+ | G5:=k5*Local_Global(K5,N,p5a,p5b); | ||
− | + | KG:=KG1+KG2+KG3+KG4+KG5; | |
− | + | Ginitial:=G; | |
− | + | //implementing boundary condition | |
− | + | for i in 1:N loop | |
+ | G[2*b1-1,i]:=0; | ||
+ | G[2*b1,i]:=0; | ||
+ | G[2*b2-1,i]:=0; | ||
+ | G[2*b2,i]:=0; | ||
+ | end for; | ||
− | + | G[2*b1-1,2*b1-1]:=1; | |
− | + | G[2*b1,2*b1]:=1; | |
+ | G[2*b2-1,2*b2-1]:=1; | ||
+ | G[2*b2,2*b2]:=1; | ||
− | + | //solving displacement | |
− | + | Sol:=Gauss_Jordan(N,G,X); | |
− | + | //solving reaction force | |
− | + | SolMat:=matrix(Sol); | |
+ | XMat:=matrix(X); | ||
+ | R:=Reaction_Trusses(N,Ginitial,SolMat,XMat); | ||
− | + | end TrussPR; | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | end | ||
− | |||
− | |||
− | |||
− | |||
− | + | Stiffness Matricies | |
− | + | function Stiffness_Matrices | |
− | + | input Real A; | |
− | + | Real Y; | |
− | + | output Real X[4,4]; | |
− | + | Real float_error = 10e-10; | |
+ | protected | ||
+ | final constant Real pi=2*Modelica.Math.asin(1.0); | ||
− | end | + | algorithm |
+ | |||
+ | Y:=A/180*pi; | ||
+ | |||
+ | X:=[(Modelica.Math.cos(Y))^2,Modelica.Math.cos(Y)*Modelica.Math.sin(Y),-(Modelica.Math.cos(Y))^2,-Modelica.Math.cos(Y)*Modelica.Math.sin(Y); | ||
+ | |||
+ | Modelica.Math.cos(Y)*Modelica.Math.sin(Y),(Modelica.Math.sin(Y))^2,-Modelica.Math.cos(Y)*Modelica.Math.sin(Y),-(Modelica.Math.sin(Y))^2; | ||
+ | |||
+ | -(Modelica.Math.cos(Y))^2,-Modelica.Math.cos(Y)*Modelica.Math.sin(Y),(Modelica.Math.cos(Y))^2,Modelica.Math.cos(Y)*Modelica.Math.sin(Y); | ||
+ | |||
+ | -Modelica.Math.cos(Y)*Modelica.Math.sin(Y),-(Modelica.Math.sin(Y))^2,Modelica.Math.cos(Y)*Modelica.Math.sin(Y),(Modelica.Math.sin(Y))^2]; | ||
+ | |||
+ | for i in 1:4 loop | ||
+ | for j in 1:4 loop | ||
+ | if abs(X[i,j]) <= float_error then | ||
+ | X[i,j] := 0; | ||
+ | end if; | ||
+ | end for; | ||
+ | end for; | ||
+ | |||
+ | end Stiffness_Matrices; | ||
+ | |||
+ | Local Global | ||
+ | |||
+ | function Local_Global | ||
+ | |||
+ | input Real Y[4,4]; | ||
+ | input Integer M; | ||
+ | input Integer p1; | ||
+ | input Integer p2; | ||
+ | output Real G[M,M]; | ||
+ | |||
+ | algorithm | ||
+ | |||
+ | for i in 1:M loop | ||
+ | for j in 1:M loop | ||
+ | G[i,j]:=0; | ||
+ | end for; | ||
+ | end for; | ||
+ | |||
+ | G[2*p1,2*p1]:=Y[2,2]; | ||
+ | G[2*p1-1,2*p1-1]:=Y[1,1]; | ||
+ | G[2*p1,2*p1-1]:=Y[2,1]; | ||
+ | G[2*p1-1,2*p1]:=Y[1,2]; | ||
+ | |||
+ | G[2*p2,2*p2]:=Y[4,4]; | ||
+ | G[2*p2-1,2*p2-1]:=Y[3,3]; | ||
+ | G[2*p2,2*p2-1]:=Y[4,3]; | ||
+ | G[2*p2-1,2*p2]:=Y[3,4]; | ||
+ | |||
+ | G[2*p2,2*p1]:=Y[4,2]; | ||
+ | G[2*p2-1,2*p1-1]:=Y[3,1]; | ||
+ | G[2*p2,2*p1-1]:=Y[4,1]; | ||
+ | G[2*p2-1,2*p1]:=Y[3,2]; | ||
+ | |||
+ | end Local_Global; | ||
+ | |||
+ | Reaction Trusses | ||
+ | |||
+ | function Reaction_Trusses | ||
+ | |||
+ | input Integer N; | ||
+ | input Real A[N,N]; | ||
+ | input Real B[N,1]; | ||
+ | input Real C[N,1]; | ||
+ | Real X[N,1]; | ||
+ | output Real Sol[N]; | ||
+ | Real float_error = 10e-10; | ||
+ | |||
+ | algorithm | ||
+ | X:=A*B-C; | ||
+ | |||
+ | for i in 1:N loop | ||
+ | if abs(X[i,1]) <= float_error then | ||
+ | X[i,1] := 0; | ||
+ | end if; | ||
+ | end for; | ||
+ | |||
+ | for i in 1:N loop | ||
+ | Sol[i]:=X[i,1]; | ||
+ | end for; | ||
+ | |||
+ | end Reaction_Trusses; | ||
+ | |||
+ | Gauss Jordan | ||
+ | |||
+ | function GJ | ||
+ | |||
+ | input Integer N; | ||
+ | input Real A[N,N]; | ||
+ | input Real B[N]; | ||
+ | output Real X[N]; | ||
+ | protected | ||
+ | |||
+ | |||
+ | Real float_error = 10e-10; | ||
+ | |||
+ | algorithm | ||
+ | X:=Modelica.Math.Matrices.solve(A,B); | ||
+ | |||
+ | for i in 1:N loop | ||
+ | if abs(X[i]) <= float_error then | ||
+ | X[i] := 0; | ||
+ | end if; | ||
+ | end for; | ||
+ | |||
+ | end GJ; |
Revision as of 14:24, 2 December 2020
John Audrick | |
---|---|
Nama Lengkap | John Audrick |
Nama Panggilan | John |
NPM | 1806201043 |
Tempat, tanggal lahir | Jakarta, 22 Februari 2000 |
Jurusan | Teknik Mesin 2018 |
Mengenal John Audrick
Saya adalah mahasiswa FTUI angkatan 2018 dari jurusan Teknik Mesin dan saya adalah salah satu ciptaan terbaik dari Tuhan Yang Maha Esa, karena pada prinsipnya Tuhan Yang Maha Esa itu mendesain manusia dengan sebaik-baiknya makhluk. Saya termotivasi untuk mengembangkan diri saya dengan sebaik-baiknya dan dapat menjadi berguna untuk masyarakat luas dan terutama untuk keluarga saya.
Minggu 1 (11 November 2020)
- Metode numerik memiliki beberapa prinsip dasar seperti aljabar simultan, istiliah algoritma, istilah regresi, cuve fitting. persamaan diferensial, dan lain-lain. - Kita harus bisa menerapkan pemahaman konsep didalam permodelan numerik. Permodelan numerik menyelesaikan masalah dengan metode numerik. - Contohnya adalah kita mengerti persamaan aljabar simultan dan mampu menerapkan metode numerik dalam persoalan perteknikan. Tujuan dari metode numerik adalah : 1. Memahami konsep dan prinsip dasar dalam metode numerik. contohnya adalah persamaan aljabar, agoritma, pencocokan kurva, persamaan diferensia, parsial, dan lain lain. 2. Mengerti aplikasi metode numerik. 3. Mampu Menerapkan metode numerik dalam persoalan teknik. 4. Mendapat nilai tambah/adab sehingga kita menjadi orang yang lebih beradab.
Pada dasarnya, manusia merupakan makhluk ciptaan Tuhan yang sangat baik. Komputer merupakan ciptaan manusia dan memiliki banyak kelebihan, seperti kemampuan menghitung yang cepat. Namun komputer memiliki limitasi hal ini diberikan contoh dengan membagi 1/10^-400 dimana komputer tidak dapat mengeluarkan hasil tapi kita mengetahui hasilnya 10^400. Namun manusiapun memiliki limitasinya juga hal ini juga dijelaskan dengan contoh 1/0 dimana tidak ada manusia yang tau, namun hanya Tuhan yang mengetahui jawaban tersebut. Hal ini membuktikan bahwa manusia hanya merupakan makhluk ciptaan Tuhan dan manusia tidak boleh sombong dengan apa yang diketahui, karena sesungguhnya hanya Tuhan yang merupakan sumber segala ilmu dan maha tahu.
Tugas Minggu 1
Pada minggu pertama ini saya mempelajari aplikasi Open Modelica melalui video berikut
https://www.youtube.com/watch?v=m0Ahs8fEN28
https://www.youtube.com/watch?v=esSMzMCFwbo
Hasil pembelajaran saya, diaplikasikan melalui video sebagai berikut
video saya :
Tugas Minggu 2
Untuk tugas pada minggu kedua, kami diminta untuk membuat program menggunakan suatu fungsi panggil, pada saat kelas menggunakan persamaan aljabar simultan dan variable array. Persamaan Aljabar Simultan adalah persamaan yang memiliki banyak variabel dan banyak persamaan. Variabel ini harus dicari nilainya. Variable array merupakan viarabel dengan bebereapa data nilai didalamnya. Pada tugas kali ini, saya menggunakan persamaan dengan 4 variabel dan 4 persamaan.
Tugas Truss
class TrussPR
parameter Integer N=8; parameter Real A=0.001; parameter Real E=200*10e9; Real KG[N,N]; //ukuran matriks (global) Real KGinitial[N,N]; Real Sol[N]; Real X[N]={0,0,-1035.2762,-3863.7033,0,0,-1035.2762,-3863.7033}; Real R[N]; Real SolMat[N,1]; Real XMat[N,1];
Real L1 = 1; Real L2 = 1; Real L3 = 1.6; Real L4 = 1.25; Real L5 = 1.6;
Real teta1 =degtorad(0); Real teta2 =degtorad(0); Real teta3 =degtorad(231.34); Real teta4 =degtorad(270); Real teta5 =degtorad(308.66);
//boundary condition Integer b1=1; Integer b2=3;
//Truss 1 parameter Real X1=0; Real k1=A*E/1; Real K1[4,4]; Integer p1a = 1; Integer p1b = 2; Real KG1[N,N];
//truss 2 parameter Real X2=0; Real k2=A*E/1; Real K2[4,4]; Integer p2a=2; Integer p2b=3; Real KG2[N,N];
//truss 3 parameter Real X3=90; Real k3=A*E/1.25; Real K3[4,4]; Integer p3a=2; Integer p3b=4; Real KG3[N,N];
//truss 4 parameter Real X4=90+38.6598; Real k4=A*E/1.6; Real K4[4,4]; Integer p4a=1; Integer p4b=4; Real KG4[N,N]; //truss 5 parameter Real X5=90-38.6598; Real k5=A*E/1.6; Real K5[4,4]; Integer p5a=3; Integer p5b=4; Real KG5[N,N]; algorithm //creating global matrice K1:=Stiffness_Matrices(X1); G1:=k1*Local_Global(K1,N,p1a,p1b);
K2:=Stiffness_Matrices(X2); G2:=k2*Local_Global(K2,N,p2a,p2b); K3:=Stiffness_Matrices(X3); G3:=k3*Local_Global(K3,N,p3a,p3b);
K4:=Stiffness_Matrices(X4); G4:=k4*Local_Global(K4,N,p4a,p4b); K5:=Stiffness_Matrices(X5); G5:=k5*Local_Global(K5,N,p5a,p5b);
KG:=KG1+KG2+KG3+KG4+KG5; Ginitial:=G;
//implementing boundary condition for i in 1:N loop G[2*b1-1,i]:=0; G[2*b1,i]:=0; G[2*b2-1,i]:=0; G[2*b2,i]:=0; end for;
G[2*b1-1,2*b1-1]:=1; G[2*b1,2*b1]:=1; G[2*b2-1,2*b2-1]:=1; G[2*b2,2*b2]:=1;
//solving displacement Sol:=Gauss_Jordan(N,G,X);
//solving reaction force SolMat:=matrix(Sol); XMat:=matrix(X); R:=Reaction_Trusses(N,Ginitial,SolMat,XMat);
end TrussPR;
Stiffness Matricies
function Stiffness_Matrices
input Real A; Real Y; output Real X[4,4]; Real float_error = 10e-10; protected final constant Real pi=2*Modelica.Math.asin(1.0);
algorithm
Y:=A/180*pi; X:=[(Modelica.Math.cos(Y))^2,Modelica.Math.cos(Y)*Modelica.Math.sin(Y),-(Modelica.Math.cos(Y))^2,-Modelica.Math.cos(Y)*Modelica.Math.sin(Y);
Modelica.Math.cos(Y)*Modelica.Math.sin(Y),(Modelica.Math.sin(Y))^2,-Modelica.Math.cos(Y)*Modelica.Math.sin(Y),-(Modelica.Math.sin(Y))^2;
-(Modelica.Math.cos(Y))^2,-Modelica.Math.cos(Y)*Modelica.Math.sin(Y),(Modelica.Math.cos(Y))^2,Modelica.Math.cos(Y)*Modelica.Math.sin(Y);
-Modelica.Math.cos(Y)*Modelica.Math.sin(Y),-(Modelica.Math.sin(Y))^2,Modelica.Math.cos(Y)*Modelica.Math.sin(Y),(Modelica.Math.sin(Y))^2];
for i in 1:4 loop for j in 1:4 loop if abs(X[i,j]) <= float_error then X[i,j] := 0; end if; end for; end for;
end Stiffness_Matrices;
Local Global
function Local_Global
input Real Y[4,4]; input Integer M; input Integer p1; input Integer p2; output Real G[M,M];
algorithm
for i in 1:M loop for j in 1:M loop G[i,j]:=0; end for; end for;
G[2*p1,2*p1]:=Y[2,2]; G[2*p1-1,2*p1-1]:=Y[1,1]; G[2*p1,2*p1-1]:=Y[2,1]; G[2*p1-1,2*p1]:=Y[1,2];
G[2*p2,2*p2]:=Y[4,4]; G[2*p2-1,2*p2-1]:=Y[3,3]; G[2*p2,2*p2-1]:=Y[4,3]; G[2*p2-1,2*p2]:=Y[3,4];
G[2*p2,2*p1]:=Y[4,2]; G[2*p2-1,2*p1-1]:=Y[3,1]; G[2*p2,2*p1-1]:=Y[4,1]; G[2*p2-1,2*p1]:=Y[3,2];
end Local_Global;
Reaction Trusses
function Reaction_Trusses
input Integer N; input Real A[N,N]; input Real B[N,1]; input Real C[N,1]; Real X[N,1]; output Real Sol[N]; Real float_error = 10e-10;
algorithm X:=A*B-C;
for i in 1:N loop if abs(X[i,1]) <= float_error then X[i,1] := 0; end if; end for;
for i in 1:N loop Sol[i]:=X[i,1]; end for;
end Reaction_Trusses;
Gauss Jordan
function GJ
input Integer N; input Real A[N,N]; input Real B[N]; output Real X[N]; protected
Real float_error = 10e-10;
algorithm X:=Modelica.Math.Matrices.solve(A,B);
for i in 1:N loop if abs(X[i]) <= float_error then X[i] := 0; end if; end for;
end GJ;