Jump to content
Sign in to follow this  
senapang

Programmin Pakai Maple 12

Recommended Posts

assalamualaikum..

utk final year projek aku (FYP) aku wat pasal "structural pounding due to earthquake"..apa yg aku perlu buat adalah wat calculation pasal displacement 1 bangunan bula earthquake berlaku..(bape jarak bangunan tu bleh sway bila earthquake berlaku)..

utk calculation manual tu, aku takda masalah...dah siap dah pon...

tapi prob nya, adalah nak wat dlm maple...aku command2 nih tak la tau menau pon..aku ikut tutorial yg diberi dlm maple tu sendiri..kadang2 menjadi, kadang2 tak menjadi..byk nye yg tak paham..huhuhu...

pehtu aku search tutorial google jgk...mcm td, ada yg bleh, ada yg tak bleh kua output yg aku nak..

so tu yg mintak tolong kat sinih..
dah sbulan aku kaji n blaja cara nak pakai maple nih (termasuk study cara manual calculation dulu)...

pengiraan mengguna kan Matrix yg panjang berjela 10x10...tapi aku nak try yg sket dulu...aku wat 5x5...

kat bawah aku akan letak ape yg aku dah wat...korang tgk la ey..


CODE
> restart;
> with(LinearAlgebra);

>
This software is to find the value of displacement for 5 storey building due to seismic excitation.
All the input data that will be use in the calculation will be put here.



Put the value of mass for each floor, mass.

> mass1:=25*10^3;

                            mass1 := 25000

> mass2:=25*10^3;

                            mass2 := 25000

> mass3:=30*10^3;

                            mass3 := 30000

> mass4:=30*10^3;

                            mass4 := 30000

> mass5:=35*10^3;

                            mass5 := 35000



Put the value of striffness for each floor, stiffness.

> stiffness1:=5*10^5;

                         stiffness1 := 500000

> stiffness2:=5*10^5;

                         stiffness2 := 500000

> stiffness3:=6*10^5;
>

                         stiffness3 := 600000

> stiffness4:=6*10^5;

                         stiffness4 := 600000

> stiffness5:=7*10^5;

                         stiffness5 := 700000




The Mass Matrix is:-

> m:=Matrix( [ [mass1,0,0,0,0],[0,mass2,0,0,0],[0,0,mass3,0,0],[0,0,0,mass4,0],[0,0,0,0,mass5] ] );

                [25000        0        0        0        0]
                [                                         ]
                [    0    25000        0        0        0]
                [                                         ]
           m := [    0        0    30000        0        0]
                [                                         ]
                [    0        0        0    30000        0]
                [                                         ]
                [    0        0        0        0    35000]



The Stiffness Matrix is:-

> k:=Matrix( [ [stiffness1+stiffness2,-stiffness2,0,0,0],[-stiffness2,stiffness2+stiffness3,-stiffness3,0,0],[0,-stiffness3,stiffness3+stiffness4,-stiffness4,0],[0,0,-stiffness4,stiffness4+stiffness5,-stiffness5],[0,0,0,-stiffness5,stiffness5] ] );

           [1000000    -500000          0          0          0]
           [                                                   ]
           [-500000    1100000    -600000          0          0]
           [                                                   ]
      k := [      0    -600000    1200000    -600000          0]
           [                                                   ]
           [      0          0    -600000    1300000    -700000]
           [                                                   ]
           [      0          0          0    -700000     700000]




Put the value of peak ground acceleration, PGA.

> pga:=1.04;

                             pga := 1.04



The PGA Matrix is:-

> PGA:=Matrix( [ [pga],[pga],[pga],[pga],[pga] ] );

                                   [1.04]
                                   [    ]
                                   [1.04]
                                   [    ]
                            PGA := [1.04]
                                   [    ]
                                   [1.04]
                                   [    ]
                                   [1.04]




The Power Matrix is:-

> P:=MatrixMatrixMultiply(m,PGA);

                                 [26000.]
                                 [      ]
                                 [26000.]
                                 [      ]
                            P := [31200.]
                                 [      ]
                                 [31200.]
                                 [      ]
                                 [36400.]




To calculate the Eigenvalue.

Let w²=lambda.

so the equation,A will be:-

> A:=k-lambda*m;

           [1000000 - 25000 lambda ,   -500000 ,   0 ,  0 ,  0]
           [                                                  ]
           [-500000 , 1100000 - 25000 lambda , -600000 , 0 , 0]
           [                                                  ]
      A := [0 , -600000 , 1200000 - 30000 lambda , -600000 , 0]
           [                                                  ]
           [0 , 0 , -600000 , 1300000 - 30000 lambda , -700000]
           [                                                  ]
           [0 ,   0 ,   0 ,   -700000 ,  700000 - 35000 lambda]



To calculate the Eigenvalue, ev of the equation, determinant the matrix of A will equal to zero.

> equation1:=Determinant(A)=0;

  equation1 := 63000000000000000000000000000

         - 53340000000000000000000000000 lambda

                                              2
         + 6137250000000000000000000000 lambda

                                             3
         - 238087500000000000000000000 lambda

                                           4
         + 3688125000000000000000000 lambda

                                         5
         - 19687500000000000000000 lambda  = 0

> ev:=solve(equation1,lambda);

  ev := 2 RootOf(%1, index = 1), 2 RootOf(%1, index = 2),

        2 RootOf(%1, index = 3), 2 RootOf(%1, index = 4),

        2 RootOf(%1, index = 5)

                                       2          3         4       5
  %1 := -300000 + 508000 _Z - 116900 _Z  + 9070 _Z  - 281 _Z  + 3 _Z

> evalf(ev);

   1.392378130, 14.20252484, 35.47864614, 59.14763316, 77.11215108



The value of lambda or w² is:-

> lambda1:=evalf(ev[1]);

                        lambda1 := 1.392378130

> lambda2:=evalf(ev[2]);

                        lambda2 := 14.20252484

> lambda3:=evalf(ev[3]);

                        lambda3 := 35.47864614

> lambda4:=evalf(ev[4]);

                        lambda4 := 59.14763316

> lambda5:=evalf(ev[5]);

                        lambda5 := 77.11215108


Value of w is:-

> w1:=sqrt(lambda1);

                          w1 := 1.179990733

> w2:=sqrt(lambda2);

                          w2 := 3.768623733

> w3:=sqrt(lambda3);

                          w3 := 5.956395398

> w4:=sqrt(lambda4);

                          w4 := 7.690749844

> w5:=sqrt(lambda5);

                          w5 := 8.781352463



Calculation of Eigenvalue for first frequency:-


> freq1:=subs(lambda=lambda1,A);

                [965190.5468 ,    -500000 ,    0 ,    0 ,   0]
                [                                            ]
                [                         7                  ]
                [-500000 , 0.1065190547 10  , -600000 , 0 , 0]
                [                                            ]
       freq1 := [                             7              ]
                [0 , -600000 , 0.1158228656 10  , -600000 , 0]
                [                                            ]
                [                                 7          ]
                [0 , 0 , -600000 , 0.1258228656 10  , -700000]
                [                                            ]
                [0 ,    0 ,    0 ,    -700000 ,   651266.7654]


prob aku kat sinih...aku nak darab kan equation freq1 tu dgn X...dimana freq1 tu adalah matrix (mcm yg dlm output diatas)...dan hasil nya, akan dpt 5 nilai X (sbb klu kita kira biasa, ia akan jd 5 persamaan serentak dan akan dpt 5 nilai X)...

haa, mcmana, agak2 paham tak soalan aku?

maybe korang tak paham klu tgk result output yg panjang berjela tu...apa kata korang cuba sendirik kat maple korang...huhuhu
kat bwh aku kasik command yg aku guna tu...korang try la,mana tau lg paham ke...

CODE
restart;with(LinearAlgebra);
>
This software is to find the value of displacement for 5 storey building due to seismic excitation.
All the input data that will be use in the calculation will be put here.



Put the value of mass for each floor, mass.

> mass1:=25*10^3;
> mass2:=25*10^3;
> mass3:=30*10^3;
> mass4:=30*10^3;
> mass5:=35*10^3;


Put the value of striffness for each floor, stiffness.

> stiffness1:=5*10^5;
> stiffness2:=5*10^5;
> stiffness3:=6*10^5;
>
> stiffness4:=6*10^5;
> stiffness5:=7*10^5;



The Mass Matrix is:-

> m:=Matrix( [ [mass1,0,0,0,0],[0,mass2,0,0,0],[0,0,mass3,0,0],[0,0,0,mass4,0],[0,0,0,0,mass5] ] );


The Stiffness Matrix is:-

> k:=Matrix( [ [stiffness1+stiffness2,-stiffness2,0,0,0],[-stiffness2,stiffness2+stiffness3,-stiffness3,0,0],[0,-stiffness3,stiffness3+stiffness4,-stiffness4,0],[0,0,-stiffness4,stiffness4+stiffness5,-stiffness5],[0,0,0,-stiffness5,stiffness5] ] );



Put the value of peak ground acceleration, PGA.

> pga:=1.04;


The PGA Matrix is:-

> PGA:=Matrix( [ [pga],[pga],[pga],[pga],[pga] ] );



The Power Matrix is:-

> P:=MatrixMatrixMultiply(m,PGA);



To calculate the Eigenvalue.

Let w²=lambda.

so the equation,A will be:-

> A:=k-lambda*m;


To calculate the Eigenvalue, ev of the equation, determinant the matrix of A will equal to zero.

> equation1:=Determinant(A)=0;
> ev:=solve(equation1,lambda);
> evalf(ev);


The value of lambda or w² is:-

> lambda1:=evalf(ev[1]);
> lambda2:=evalf(ev[2]);
> lambda3:=evalf(ev[3]);
> lambda4:=evalf(ev[4]);
> lambda5:=evalf(ev[5]);

Value of w is:-

> w1:=sqrt(lambda1);
> w2:=sqrt(lambda2);
> w3:=sqrt(lambda3);
> w4:=sqrt(lambda4);
> w5:=sqrt(lambda5);


Calculation of Eigenvalue for first frequency:-

> freq1:=subs(lambda=lambda1,A);


klu tak paham, tanya aku lg utk bantu korang paham supaya dpt membantu aku..hehehehe

pehtu ada lg soalan2 lain nak di tanya...tapi maybe lepas nih.. smile.gif

aku mengharap sgt bantuan dari korang..aku dah buntu dah nih... sad.gif

maybe senang bg korang...tapi mmg terlampau lah susah bagi aku yg tak tau pape pasal software maple nih...jgn mara ngan soalan bodo aku nih yek smile.gif

thanks in advance..

Share this post


Link to post
Share on other sites
aaa lupa plak nak ditambah kan...

selepas step yg tadi tu...aku wat satu equation yg dinama kan A1..

CODE
> A1:=freq1*X=0;

          [965190.5468 X ,     -500000 X ,    0 ,    0 ,    0]
          [                                                  ]
          [                           7                      ]
          [-500000 X , 0.1065190547 10  X , -600000 X , 0 , 0]
          [                                                  ]
    A1 := [                               7                  ] = 0
          [0 , -600000 X , 0.1158228656 10  X , -600000 X , 0]
          [                                                  ]
          [                                   7              ]
          [0 , 0 , -600000 X , 0.1258228656 10  X , -700000 X]
          [                                                  ]
          [0 ,     0 ,    0 ,    -700000 X ,    651266.7654 X]

> A2:=solve(A1,X);
Error, (in solve) invalid arguments


nampak tak masalah aku tu...waaaa aku tak tau la prob nape..sbb pada post #1, aku ada jalan kan command solve tu utk setel kan equation1..maybe utk linear equation je kot command solve tu...klu dlm bentuk matrix mcmana yek? Edited by senapang

Share this post


Link to post
Share on other sites
hoho..akhir nya ada jgk orang reply aku pnya thread..setelah lama menanti..wlu pon tak menjawab soalan, tapi takpe lah..hehehe..a'a ada coding2 dia...tapi tak la susah sgt...

tapi yg aku wat kat atas tu pakai Classic Maple Worksheet...tak pakai byk memori sgt

try la blaja, aku pon masih menuntut sorg2 ja nih...

Share this post


Link to post
Share on other sites
aku pon blajaq sendiri...ko bleh check kat maple tu...ada tutorial dlm tu..aku skang nih fokus kat Linear Algebra je..sbb tu berkait ngan projek yg aku nak wat nih...

aku blaja ikut tutorial dlm tu je...

ada yg carik google sket..tapi yg dlm google pon sbnr nya dari tutorial maple tu jgk

good luck smile.gif

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...