Mechanical Vibrations 

Function: calc[SpringMassCouplet] - animates the motion of spring-couplet masses 

Calling Sequence:  

SpringMassCouplet(L, inits, F, tr, n, print1, print2) 

Parameters: 

L -  [m[1], k[1]],[m[2], k[2]],[m[3], k[3]], k[4], three masses and four springs, spring ( k[4]) connected to the right-hand wall. 

L -  [m[1], k[1]],[m[2], k[2]],[m[3], k[3]], three masses and three springs, no spring connected to the right-hand wall. 

L -  [m[1], k[1]],[m[2], k[2]], k[3], two masses and three springs, spring ( k[3]) connected to the right-hand wall. 

L -  [m[1], k[1]],[m[2], k[2]], two masses and two springs, no spring connected to the right-hand wall 

inits - x[1](0), x[2](0), x[3](0), (D(x[1]))(0), (D(x[2]))(0), (D(x[3]))(0), initial conditions in the case of three masses and three springs. 

F -  f[1](t), f[2](t), f[3](t) , external force vector.
n - number of frames. 

tr - maximum value of the independent variable t used in the plot. 

print1 - any name, arrayprint1 prints out  `*`(coefficient, `*`(matrix)) and the print2 - any name, prints out the solution of the system. 

Description: 

  • SpringMassCouplet animates the motion of two or three masses connected to attached springs. The motion is described by the differential equations
 

m[1] diff(x[1](t), t, t) = `+`(`-`(`*`(k[1], `*`(x[1](t))))) `*`(k[2], `*`(`+`(x[2](t), `-`(x[1](t))))) f[1](t)
m[2] diff(x[2](t), t, t) = `+`(`-`(`*`(k[2], `*`(`+`(x[2](t), `-`(x[1](t))))))) `*`(k[3], `*`(`+`(x[3](t), `-`(x[2](t))))) f[2](t)
m[3] diff(x[3](t), t, t) = `+`(`-`(`*`(k[3], `*`(`+`(x[3](t), `-`(x[2](t))))))) `*`(k[4], `*`(x[3](t))) f[3](t)
 

Examples: 

> restart: with(calc):
 

> L:=[[1,1],[1,2],[1,2],3]:init:=[-1.5,1,0,0,0,0]: F:=[0,0,0]: #three masses and four springs
 

> SpringMassCouplet(L,init,F,10,40,p1,p2,scaling=unconstrained,axes=frame):
 

 

`+`(diff(diff(x[1](t), t), t), `*`(3, `*`(x[1](t))), `-`(`*`(2, `*`(x[2](t))))) = 0, `+`(diff(diff(x[2](t), t), t), `*`(4, `*`(x[2](t))), `-`(`*`(2, `*`(x[1](t)))), `-`(`*`(2, `*`(x[3](t))))) = 0, `+`...
`+`(diff(diff(x[1](t), t), t), `*`(3, `*`(x[1](t))), `-`(`*`(2, `*`(x[2](t))))) = 0, `+`(diff(diff(x[2](t), t), t), `*`(4, `*`(x[2](t))), `-`(`*`(2, `*`(x[1](t)))), `-`(`*`(2, `*`(x[3](t))))) = 0, `+`...
Plot_2d
 

> p2;
 

x[1](t) = `+`(`-`(`*`(`/`(7, 18), `*`(cos(`*`(`^`(7, `/`(1, 2)), `*`(t)))))), `-`(`*`(`/`(8, 9), `*`(cos(`+`(`*`(2, `*`(t))))))), `-`(`*`(`/`(2, 9), `*`(cos(t))))), x[2](t) = `+`(`*`(`/`(7, 9), `*`(co...
x[1](t) = `+`(`-`(`*`(`/`(7, 18), `*`(cos(`*`(`^`(7, `/`(1, 2)), `*`(t)))))), `-`(`*`(`/`(8, 9), `*`(cos(`+`(`*`(2, `*`(t))))))), `-`(`*`(`/`(2, 9), `*`(cos(t))))), x[2](t) = `+`(`*`(`/`(7, 9), `*`(co...
 

> array(p1);
 

array( 1 .. 6, 1 .. 1, [( 1, 1 ) = `Coefficient matrix`, ( 6, 1 ) = [omega[1], omega[2], omega[3]] = [2.000000000, 2.645751311, 1.], ( 5, 1 ) = `Natural frequencies`, ( 2, 1 ) = `*`(array( 1 .. 3, 1 ....