'*********************************************************************************** '* Frequencies and Modes of Mass-spring Systems without Damping By Transfer Method * '* ------------------------------------------------------------------------------- * '* EXPLANATION: * '* Find resonance frequencies and modes of 2 d.o.f. system below: * '* * '* --> x1 --> x2 * '* \| k ------ k ------ k |/ * '* \|--/\/\/\--| 3m |--/\/\/\--| m |--/\/\/\--|/ * '* \| ----- ----- |/ * '* --> F1(t) --> F2(t) * '* * '* composed of two masses, 3m and m, and three springs of stiffness k, with fixed- * '* fixed limit conditions (damping and friction here neglected). * '* * '* The differential system of mass motions, x1(t) and x2(t), is given by: * '* 3mx1" + 2kx1 - kx2 = F1(t) * '* mx2" +2kx2 - kx1 = F2(t) * '* where F1(t) anf F2(t) are respectively the forces acting on masses 3m and m. * '* * '* Or with matrix notation: M x" + K x = F(t) * '* * '* | 3m 0 | | 2k -k | * '* with mass matrix M = | | and stiffness matrix K = | | * '* | 0 m | | -k 2k | * '* * '* | x1 | | F1(t) | * '* displacement vector X = | | force vector F(t) = | | * '* | x2 | | F2(t) | * '* * '* For F1(t)=F2(t)=0 (free motion), the exact solution is: * '* f1 = 0.10693 sqrt(k/m) Hz * '* f2 = 0.23686 sqrt(k/m) Hz * '* with corresponding modal vectors: * '* | X1 | | 1 | | X1 | | 1 | * '* phi1 = | | = | | phi2 = | | = | | * '* | X2 | |0.6457| | X2 | |-4.646| * '* ------------------------------------------------------------------------------- * '* SAMPLE RUN: * '* * '* Frequencies and Modes of Mass-spring Systems * '* By Transfer Method. * '* * '* Kind of elements * '* ---------------- * '* C(I)=1: Spring * '* C(I)=2: Mass * '* * '* Number of Elements: 5 * '* * '* Kind of element 1 C(1) = 1 * '* Kind of element 2 C(2) = 2 * '* Kind of element 3 C(3) = 1 * '* Kind of element 4 C(4) = 2 * '* Kind of element 5 C(1) = 1 * '* * '* Fixed-Fixed System, code=1. * '* Fixed-Free System, code=2. * '* Free-Fixed System, code=3. * '* Free-Free System, code=4. * '* * '* Code = 1 * '* * '* Mass #1 = 3 * '* Mass #2 = 1 * '* * '* Spring #1 = 1 * '* Spring #2 = 1 * '* Spring #3 = 1 * '* * '* Frequency Sweep: (S)WEEP * '* Calculate Mode.: (M)ODE * '* Exit Program...: (E)XIT * '* * '* Answer = S * '* * '* Frequency Sweep * '* --------------- * '* Starting Frequency: 0 * '* Ending Frequency..: 1 * '* Frequency Step....: 0.1 * '* * '* Frequency= 0.0000 Hz Determinant= 3 * '* Frequency= 0.1000 Hz Determinant= .3092902287417004 * '* Frequency= 0.2000 Hz Determinant=-2.152075442116123 * '* Frequency= 0.3000 Hz Determinant= 12.44819391617776 * '* Frequency= 0.4000 Hz Determinant= 72.16391651820871 * '* Frequency= 0.5000 Hz Determinant= 216.2704378643961 * '* Frequency= 0.6000 Hz Determinant= 495.2646307409936 * '* Frequency= 0.7000 Hz Determinant= 970.8648952200887 * '* Frequency= 0.8000 Hz Determinant= 1716.011158659605 * '* Frequency= 0.9000 Hz Determinant= 2814.864875703296 * '* Frequency= 1.0000 Hz Determinant= 4362.809028280752 * '* * '* Note: A minimum value of matrix determinant (here T[2,1]) occurs near a * '* resonance frequency, here f=0.1 hz. Refine sweep to improve solution. * '* * '* Frequency Sweep: (S)WEEP * '* Calculate Mode.: (M)ODE * '* Exit Program...: (E)XIT * '* * '* Answer = S * '* * '* Frequency Sweep * '* --------------- * '* Starting Frequency: 0 * '* Ending Frequency..: 0.2 * '* Frequency Step....: 0.01 * '* * '* Frequency= 0.0000 Hz Determinant= 3 * '* Frequency= 0.0100 Hz Determinant= 2.96846402228201 * '* Frequency= 0.0200 Hz Determinant= 2.874417165492333 * '* Frequency= 0.0300 Hz Determinant= 2.719542658723844 * '* Frequency= 0.0400 Hz Determinant= 2.506645883798001 * '* Frequency= 0.0500 Hz Determinant= 2.239654375264846 * '* Frequency= 0.0600 Hz Determinant= 1.923617820403004 * '* Frequency= 0.0700 Hz Determinant= 1.564708059219686 * '* Frequency= 0.0800 Hz Determinant= 1.170219084450681 * '* Frequency= 0.0900 Hz Determinant= .7485670415603668 * '* Frequency= 0.1000 Hz Determinant= .3092902287417012 * '* Frequency= 0.1100 Hz Determinant=-.1369509030837721 * '* Frequency= 0.1200 Hz Determinant=-.578373750265928 * '* Frequency= 0.1300 Hz Determinant=-1.002073556426057 * '* Frequency= 0.1400 Hz Determinant=-1.394023412456868 * '* Frequency= 0.1500 Hz Determinant=-1.739074256522483 * '* Frequency= 0.1600 Hz Determinant=-2.020954874058443 * '* Frequency= 0.1700 Hz Determinant=-2.222271897771706 * '* Frequency= 0.1800 Hz Determinant=-2.324509807640643 * '* Frequency= 0.1900 Hz Determinant=-2.308030930915047 * '* * '* Note: Now the minimum absolute value is for f = 0.11 hz. Refine again value. * '* * '* Frequency Sweep: (S)WEEP * '* Calculate Mode.: (M)ODE * '* Exit Program...: (E)XIT * '* * '* Answer = S * '* * '* Frequency Sweep * '* --------------- * '* Starting Frequency: 0.10 * '* Ending Frequency..: 0.12 * '* Frequency Step....: 0.0005 * '* * '* Frequency= 0.1000 Hz Determinant= .3092902287417004 * '* Frequency= 0.1005 Hz Determinant= .2870501791825932 * '* Frequency= 0.1010 Hz Determinant= .2647938918262428 * '* Frequency= 0.1015 Hz Determinant= .242522779883742 * '* Frequency= 0.1020 Hz Determinant= .2202382635796379 * '* Frequency= 0.1025 Hz Determinant= .1979417701519323 * '* Frequency= 0.1030 Hz Determinant= .1756347338520816 * '* Frequency= 0.1035 Hz Determinant= .153318595944996 * '* Frequency= 0.1040 Hz Determinant= .1309948047090411 * '* Frequency= 0.1045 Hz Determinant= .1086648154360368 * '* Frequency= 0.1050 Hz Determinant= 8.633009043125761D-02 * '* Frequency= 0.1055 Hz Determinant= .0639920990134325 * '* Frequency= 0.1060 Hz Determinant= 4.165231751474496D-02 * '* Frequency= 0.1065 Hz Determinant= 1.931222928083343D-02 * '* Frequency= 0.1070 Hz Determinant=-3.026675329210193D-03 * '* Frequency= 0.1075 Hz Determinant=-2.536289894283816D-02 * '* Frequency= 0.1080 Hz Determinant=-.0476949371740486 * '* Frequency= 0.1085 Hz Determinant=-.0700212786233857 * '* Frequency= 0.1090 Hz Determinant=-9.234040487793826D-02 * '* Frequency= 0.1095 Hz Determinant=-.1146507905113407 * '* Frequency= 0.1100 Hz Determinant=-.1369509030837736 * '* Frequency= 0.1105 Hz Determinant=-.1592392031419622 * '* Frequency= 0.1110 Hz Determinant=-.1815141442191769 * '* Frequency= 0.1115 Hz Determinant=-.2037741728352348 * '* Frequency= 0.1120 Hz Determinant=-.2260177284964975 * '* Frequency= 0.1125 Hz Determinant=-.2482432436958718 * '* Frequency= 0.1130 Hz Determinant=-.2704491439128115 * '* Frequency= 0.1135 Hz Determinant=-.2926338476133133 * '* Frequency= 0.1140 Hz Determinant=-.3147957662499223 * '* Frequency= 0.1145 Hz Determinant=-.3369333042617261 * '* Frequency= 0.1150 Hz Determinant=-.3590448590743595 * '* Frequency= 0.1155 Hz Determinant=-.3811288211000038 * '* Frequency= 0.1160 Hz Determinant=-.4031835737373827 * '* Frequency= 0.1165 Hz Determinant=-.4252074933717681 * '* Frequency= 0.1170 Hz Determinant=-.4471989493749758 * '* Frequency= 0.1175 Hz Determinant=-.4691563041053678 * '* Frequency= 0.1180 Hz Determinant=-.4910779129078507 * '* Frequency= 0.1185 Hz Determinant=-.5129621241138782 * '* Frequency= 0.1190 Hz Determinant=-.5348072790414466 * '* Frequency= 0.1195 Hz Determinant=-.5566117119951016 * '* * '* Note: now our best first resonance frequency is: 0.107 hz (exact value 0.10693).* '* We can now try to calculate the first modal vector: * '* * '* Frequency Sweep: (S)WEEP * '* Calculate Mode.: (M)ODE * '* Exit Program...: (E)XIT * '* * '* Answer = M * '* * '* Calculate a Mode * '* ---------------- * '* Resonance Frequency: 0.107 * '* * '* Node # 1 Force= 1 Displacement= 0 * '* Node # 2 Force= 1 Displacement= 1 * '* Node # 3 Force=-.3559652093793524 Displacement= 1 * '* Node # 4 Force=-.3559652093793524 Displacement= .6440347906206476 * '* Node # 5 Force=-.647061465949857 Displacement= .6440347906206476 * '* Node # 6 Force=-.647061465949857 Displacement=-3.026675329209416D-03 * '* * '* Note: here the modal vector found is [1.000 0.644], exact value is [1 0.6457]. * '* A small error occurs because the frequency is still approximate. * '* Proceed in the same way to approximate 2nd frequency and modal vector. * '* This program is only intended to demonstrate the transfer method, it is * '* not suitable to solve, as is, real problems. * '* ------------------------------------------------------------------------------- * '* REFERENCE: "Mécanique des vibrations linéaires By M. Lalanne, P. Berthier, * '* J. Der Hagopian, Masson, Paris 1980" [BIBLI 16]. * '* * '* Basic Release By J-P Moreau, Paris. * '* (www.jpmoreau.fr) * '*********************************************************************************** 'Program Modes DEFDBL A-H, O-Z DEFINT I-N PI = 3.1415926535# CLS PRINT PRINT " Frequencies and Modes of Mass-spring Systems" PRINT " By Transfer Method." PRINT PRINT " Kind of elements" PRINT "-----------------" PRINT " C(I)=1: Spring" PRINT " C(I)=2: Mass" PRINT INPUT " Number of Elements: ", N M9 = 0: K9 = 0 DIM C(N) AS INTEGER DIM T(2, 2), T1(2, 2), A(2, 2) DIM C6 AS INTEGER DIM C8 AS INTEGER PRINT FOR I = 1 TO N PRINT " Kind of element"; I; " C("; I; ") = "; INPUT "", C(I) IF C(I) = 1 THEN K9 = K9 + 1 IF C(I) = 2 THEN M9 = M9 + 1 NEXT I DIM M1(M9) AS DOUBLE DIM K1(K9) AS DOUBLE PRINT PRINT " Fixed-Fixed System, code=1." PRINT " Fixed-Free System, code=2." PRINT " Free-Fixed System, code=3." PRINT " Free-Free System, code=4." PRINT INPUT " Code = ", C8 PRINT IF M9 <> 0 THEN 'There are masses FOR I = 1 TO M9 PRINT " Mass #"; I; " = "; INPUT "", M1(I) NEXT I END IF PRINT IF K9 <> 0 THEN 'There are springs FOR I = 1 TO K9 PRINT " Spring #"; I; " = "; INPUT "", K1(I) NEXT I END IF 680 PRINT PRINT " Frequency Sweep: SWE" PRINT " Calculate Mode.: MOD" PRINT " Exit Program...: EXI" PRINT INPUT " Answer = ", A$ IF A$ = "MOD" THEN GOTO 1000 IF A$ = "EXI" THEN END PRINT PRINT " Frequency Sweep" PRINT " ---------------" INPUT " Starting Frequency: ", F2 INPUT " Ending Frequency..: ", F3 INPUT " Frequency Step....: ", f4 GOTO 1280 1000 PRINT " Calculate a Mode" PRINT " ----------------" INPUT " Resonance Frequency: ", F M9 = 0: K9 = 0 W = 2 * PI * F W2 = W * W DIM V1(2), V2(2) V1(1) = 0#: V1(2) = 0#: C6 = 1 IF C8 = 3 OR C8 = 4 THEN 'system is free-fixed or free-free V1(2) = 1# ELSE V1(1) = 1# END IF PRINT " Node #"; C6; " Force="; V1(1); " Displacement="; V1(2) FOR I = 1 TO N C6 = C6 + 1 C1 = C(I) IF C1 = 1 THEN GOSUB 1650 ELSE GOSUB 1600 END IF 'V2 = A MPY V1 V2(1) = A(1, 1) * V1(1) + A(1, 2) * V1(2) V2(2) = A(2, 1) * V1(1) + A(2, 2) * V1(2) V1(1) = V2(1): V1(2) = V2(2) PRINT " Node #"; C6; " Force="; V1(1); " Displacement="; V1(2) NEXT I GOTO 680 1280 'Frequency sweep FOR F = F2 TO F3 STEP f4 M9 = 0: K9 = 0 W = 2# * PI * F: W2 = W * W: T = 0# FOR I = 1 TO N C1 = C(I) IF C1 = 1 THEN GOSUB 1650 ELSE GOSUB 1600 END IF IF I = 1 THEN ' T=A T(1, 1) = A(1, 1): T(1, 2) = A(1, 2) T(2, 1) = A(2, 1): T(2, 2) = A(2, 2) ELSE ' T1=A MPY T T1(1, 1) = A(1, 1) * T(1, 1) + A(1, 2) * T(2, 1) T1(1, 2) = A(1, 1) * T(1, 2) + A(1, 2) * T(2, 2) T1(2, 1) = A(2, 1) * T(1, 1) + A(2, 2) * T(2, 1) T1(2, 2) = A(2, 1) * T(1, 2) + A(2, 2) * T(2, 2) ' T=T1 T(1, 1) = T1(1, 1): T(1, 2) = T1(1, 2) T(2, 1) = T1(2, 1): T(2, 2) = T1(2, 2) END IF NEXT I IF C8 = 1 THEN X = T(2, 1) ELSEIF C8 = 2 THEN X = T(1, 1) ELSEIF C8 = 3 THEN X = T(2, 2) ELSE X = T(1, 2) END IF PRINT " Frequency="; PRINT USING "#####.####"; F; PRINT " Hz Determinant="; X NEXT F PRINT GOTO 680 END 'of main program 1600 'Mass Matrix M9 = M9 + 1 A(1, 1) = 1#: A(1, 2) = 0# A(2, 1) = 0#: A(2, 2) = 1# A(1, 2) = -M1(M9) * W2 RETURN 1650 'Stiffness Matrix K9 = K9 + 1 A(1, 1) = 1#: A(1, 2) = 0# A(2, 1) = 0#: A(2, 2) = 1# A(2, 1) = 1# / K1(K9) RETURN 'end of file modes.bas