# Exercici 12.17

Massa, m = 10 kg
Pes de la massa, P = mg = 98 N  (g = 9.8 m/s2)
Constant de la molla, k = P/x0 = 140 N/m
Velocitat inicial, v0 = 1 m/s

kill(all)$

m = m: 10;
a = a: 90;
b = b: 140;

EDO:  m*'diff(x,t,2) +a*'diff(x,t) + b*x = 0;

ode2(EDO, x, t);

define (x(t) , k1*%e^(-2*t) + k2*%e^(-7*t)) ;

define (Dx(t) , diff(x(t) ,t));

Eq1 : x(0) = 0;
Eq2:  Dx(0) = -1;
solve ([Eq1, Eq2] , [k1,k2]);

k1 : -1/5$
k2 : 1/5$

Solució

'x(t) = x(t);

wxplot2d([x(t)], [t,0,5],  [ylabel, ""] , [legend, "x(t)"] , [style, [lines, 2]] ,
 [gnuplot_preamble, "set grid; set zeroaxis;"])$