Damped springs with forcing

Some MAPLE output is omitted for simplicity. To see them, run the commands in MAPLE. This was written in MAPLE 5 but should work in later versions.

wdj,1-14-98

> de1:=2*diff(x(t),t$2)+4*diff(x(t),t)+100*x(t)=0;
ic1:=x(0)=0,D(x)(0)=1;

[Maple Math]

[Maple Math]

> soln1:=dsolve({de1,ic1},x(t));

[Maple Math]

> y1:=s->subs(t=s,rhs(simplify(soln1))):
y1(t);

[Maple Math]

> plot(y1(t),t=0..5,title=`damped spring with no forcing`);

[Maple Plot]

>

> de2:=2*diff(x(t),t$2)+4*diff(x(t),t)+100*x(t)=2*sin(7*t);
ic2:=x(0)=0,D(x)(0)=0;

[Maple Math]

[Maple Math]

> soln2:=dsolve({de2,ic2},x(t));
Notice the unusual form of the solution MAPLE gives without putting in the method=laplace option.

[Maple Math]
[Maple Math]
[Maple Math]

> soln2:=dsolve({de2,ic2},x(t),method=laplace);

[Maple Math]

> y2:=s->subs(t=s,rhs(simplify(soln2))):
y2(t);

[Maple Math]

> plot(y2(t),t=0..5,title=`damped spring with forcing`);

[Maple Plot]

> with(student);

[Maple Math]
[Maple Math]
[Maple Math]
[Maple Math]

> max_y1:=maximize(y1(t),{t},{t=0..10}):
evalf(max_y1);
max_y2:=maximize(y2(t),{t},{t=0..10}):
evalf(max_y2);

[Maple Math]

[Maple Math]

> min_y1:=minimize(y1(t),{t},{t=0..10}):
evalf(min_y1);
min_y2:=minimize(y2(t),{t},{t=0..10}):
evalf(min_y2);

[Maple Math]

[Maple Math]

> min2_y1:=maximize(-y1(t),{t},{t=0..10}):
evalf(min2_y1);
min2_y2:=maximize(-y2(t),{t},{t=0..10}):
evalf(min2_y2);

[Maple Math]

[Maple Math]

The amplitudes of the steady state part and transient part of the solution can be determined from the coefficients of the terms of y2(t):

> c1:=op(1,op(1,y2(t)));evalf(c1);
c2:=op(1,op(2,y2(t)));evalf(c2);
A:=sqrt(c1^2+c2^2);evalf(A);
A1:=op(1,op(3,y2(t)));evalf(A1);
A2:=op(1,op(4,y2(t)));evalf(A2);
B:=sqrt(A1^2+A2^2);evalf(B);

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

> phi:=arctan(c2/c1); evalf(phi);

[Maple Math]

[Maple Math]

> cos(phi); c1/A;
sin(phi); c2/A;
A*exp(-t)*cos(7*t-phi);
The transient term

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

> theta:=arctan(A2/A1)+Pi; evalf(theta);

[Maple Math]

[Maple Math]

> cos(theta); A1/B;
sin(theta); A2/B;
B*cos(10*t-theta);
The steady state term

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

[Maple Math]

>